-
-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better ergonomics for Operations #11
Comments
I'm not sure that the swagger spec itself is designed for that at the moment each path maps to a path item object when I started on this journey my assumptions where the same as yours and what the struct that represents this is called Operations. In testing deserializing more openapi examples in the wild I came across some examples using the shared |
I found myself in a similar situation today. I need to iterate over all operations (it's just easier with my current code). So far I have created an let get = item.get.as_ref().map(|x| (Method::Get, x));
let post = // ....
get.into_iter().chain(post) // and so on While this works, I think it would be more suitable/ergonomic for all operations to be a map (let's assume a I am willing to work on researching and/or implementing this, if it's deemed appropriate. |
Since I needed this, I already implemented it in my fork https://github.com/IovoslavIovchev/openapi/blob/master/src/v3_0/schema.rs#L186 |
I've started working on code based on this library and working with Operations is difficult I want to do something like:
But each operation is a different field in the structure, I do not know if it's possible to iterate them in Rust
The text was updated successfully, but these errors were encountered: