-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skip IO of fields added in OpenAPI 3.1 when reading or writing OpenAP…
…I 3.0 documents (#2117) * Skip IO of fields for newer OpenAPI versions - Add a field to the model metadata indicating the minimum version of OpenAPI that includes that field - When reading or writing objects, ignore fields which require a newer version of OpenAPI than the one specified in the current document. When the metadata is updated to set the new field, this will prevent the inclusion of fields from OpenAPI 3.1 when writing OpenAPI 3.0 documents. Implementation notes: - Move IOContext.OpenApiVersion to its own file in the model project so we can use it from the OASModelProperty annotation. - Move generated SmallRyeOASModels.Properties interface to its own file in the model project so we can reference it from BaseModel. Rename to PropertyMetadata so that it doesn't clash with other uses of the word "properties". - Add a new method to BaseModel to get the PropertiesMetadata for the object. Add a PROPERTIES constant to each generated model class to implement this method. * Add minVersion for fields added in OpenAPI 3.1 Update the model metadata to set minVersion for all fields added in OpenAPI 3.1. * Add missing tests for OpenAPI 3.1 new fields Test that new fields added for OpenAPI 3.1 are read and written correctly in 3.1 and 3.0 modes.
- Loading branch information
Showing
19 changed files
with
191 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.