Repository navigation
[Java][Spring] Adding example parameter in @Schema annotation for OAS 3.1 - #24801
thiswasdumb wants to merge 4 commits into
Conversation
|
@thiswasdumb Looks good. Thanks for the feature |
Thank you! I am just updating samples and hopefully pipeline will pass soon :) |
|
@thiswasdumb Just an idea to simplify the use of existing templates: So existing templates still work with And new templates can use: |
|
@jpfinne I wonder if we should change the semantics of |
@marek-g8i an option is the return the best of example and first value from examples. |
|
@thiswasdumb Hi! Are you planning to include this feature in nearest release 7.26? |
@dymitrstinski-collab Hi! Sorry I have just been moving from when I made this to now, but I was going to come back soon. I can hopefully give it a check tonight or tomorrow :) |
|
@thiswasdumb Please, let me know if any help is required to finish this pull request. |
|
@dymitrstinski-collab please submit a new PR on top of this one and we will review accordingly. |
Added logic so when multiple examples exist in 3.1 spec, they are generated int he corresponding
@Schemanotation and can be referenced as needed.Serves as a fix for #24755
PR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
Summary by cubic
Renders OpenAPI 3.1
examplesvalues into the@Schemaannotation for Java Spring generators, fixing #24755.New Features
examplesparameter support to@Schemawhen the spec declares multiple example values; single values render as a one-element array and properties without examples are unchanged.Written for commit d677a8c. Summary will update on new commits.