-
Notifications
You must be signed in to change notification settings - Fork 112
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
deserializing and serializing results in faulty json #67
Comments
Hmm, looks indeed like it is doing something wrong in the default Serde parser. I think this is because of the Looks like we might need to add But would have to look at it when I have some more time to be sure this solves it and does not create other problems. The |
For the moment i'm fixing this post-deser.. which for now is fine for me Simply ignoring extensions when deserializing seems a bit drastic, so my first thought was to create a simple custom deserializer which ignores the fields already added to flattened ParameterValue enum.. But that got me thinking if this isn't actualy a bug in serde as i don't see how passing a deserialized field to two different flattened members will ever result in a valid structure when serializing again.... |
The 'extensions' fields of various structs within okapi/src/openapi3.rs was not deserialized correctly. This commit fixes the behavior if the Object is an indexmap. Using rocket_okapi enables the feature 'preserve_order' by default and hence an indexmap is used. If the feature 'preserve_order' is disables, this commit should not change the behavior. Belongs to GREsau#67 Signed-off-by: Philippe Schaaf <[email protected]>
The 'extensions' fields of various structs within okapi/src/openapi3.rs was not deserialized correctly. This commit fixes the behavior if the Object is an indexmap. Using rocket_okapi enables the feature 'preserve_order' by default and hence an indexmap is used. If the feature 'preserve_order' is disables, this commit should not change the behavior. Belongs to GREsau#67 Signed-off-by: Philippe Schaaf <[email protected]>
When deserializing from json the schemas from a param also get added to the extensions object of a param, resulting in faulty json being outputted when serializing again (schema attribute is added twice)
results in
The same happens when deserializing an operation with responses, deserializing and serializing this
results in this
The text was updated successfully, but these errors were encountered: