Skip to content
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

OAS 3.1 Initial support - Schema properties support in annotations - Enhanced Response Schema resolving #4129

Merged
merged 43 commits into from
Feb 23, 2022

Conversation

frantuma
Copy link
Member

@frantuma frantuma commented Feb 22, 2022

OAS 3.1 Initial support

This PR introduces support for OAS 3.1 representation (swagger-models), serialization and deserialization.

Changes aim to be backward compatible, therefore no code changes should be needed in clients. New OAS 3.1 constructs in swagger-models are annotated with @OpenAPI31 and additional helper classes Json31 and Yaml31 have been added to provide OAS 3.1 serialization / deserialization. Please see deserialization and serialization examples for usage scenarios.

References #3913

Support for schema properties resolution from annotations

this commit introduces support to define Schema properties via annotations. Please see this and this examples for usage scenarios.

Related tickets: #3633, #3547, #2891, #3433

Support for existing response schema resolving from method return type.

this commit introduces support to resolve a response schema from the method return type also for responses defined via @ApiResponse annotations. Please see this example for usage scenarios.

References #3870

frantuma and others added 30 commits February 22, 2022 18:16
@frantuma frantuma merged commit 3626f1d into master Feb 23, 2022
@frantuma frantuma deleted the oas3.1-full branch February 23, 2022 10:44
lWoHvYe added a commit to lWoHvYe/unicorn that referenced this pull request Apr 8, 2022
…3.oas.annotations 读取程序包 io.swagger.v3.oas.annotations

JPMS面临的问题就是第三方依赖不可控,短期无法进行升级。 swagger-api/swagger-core#4129
lWoHvYe added a commit to lWoHvYe/unicorn that referenced this pull request Apr 19, 2022
…3.oas.annotations 读取程序包 io.swagger.v3.oas.annotations

JPMS面临的问题就是第三方依赖不可控,短期无法进行升级。 swagger-api/swagger-core#4129
@antonlisovenko-toast
Copy link

@frantuma thanks for the PR, this is really helpful, am I right that this adds support only when ApiResponse is used only as a standalone annotation (@ApiResponse) rather than a part of responses in @Operation?
Trying this and it's not working:

@Operation(
        responses = [
            ApiResponse(responseCode = "200", useReturnTypeSchema = true),
            ApiResponse(responseCode = "422", description = "User already has restaurant access")
        ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants