oas3-rs
oas3-rs copied to clipboard
Cannot Resolve ObjectOrReference<Header>
Cannot call resolve on ObjectOrReference<Header>. In a minimal example project, the compiler error message:
the method
resolveexists for enumObjectOrReference<Header>, but its trait bounds were not satisfied the following trait bounds were not satisfied:oas3::spec::Header: FromRefrustcClick for full compiler diagnostic header.rs(20, 1): doesn't satisfyoas3::spec::Header: FromRef
The code showing the issue with oas3 = "0.4" in cargo.toml:
fn main() {
let mut spec = oas3::from_path("path").unwrap();
let path = spec.paths.pop_first();
let operation = path.unwrap().1.get.unwrap();
let mut responses = operation.responses(&spec);
let response = responses.pop_first().unwrap();
let mut headers_refs = response.1.headers;
let header_ref = headers_refs.pop_first().unwrap();
let header = header_ref.1.resolve(&spec); // compile error here
}
I'd appreciate if someone could at least provide a workaround until the issue is fixed. 🙇