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

Remove generation of schemas in OpenAPI package #42169

Merged
merged 3 commits into from Jun 17, 2022

Conversation

captainsafia
Copy link
Member

Part of #41246.

Since generating accurate OpenAPI schemas for all DTOs in ✨ big work ✨, we're temporarily removing this from the OpenAPI package and instead opting with a "merge" strategy where we will leverage existing OpenAPI schema support in Swashbuckle.

Long-term, we want to explore more foundational support for generating JSON schemas (which OpenAPI schemas are a derivative of) in either System.Text.Json (ref) or Microsoft.OpenAPI (ref).

Co-authored-by: Damian Edwards <damian@damianedwards.com>
@captainsafia
Copy link
Member Author

@brunolins16 Mind giving this a review?

{
Schema = OpenApiSchemaGenerator.GetOpenApiSchema(type)
};
responseContent[contentType] = new OpenApiMediaType();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Swashbuckle will now read this information and populate the Schema, is that how it will work?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@brunolins16 brunolins16 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

src/OpenApi/test/OpenApiGeneratorTests.cs Show resolved Hide resolved
src/OpenApi/test/OpenApiGeneratorTests.cs Show resolved Hide resolved
@captainsafia captainsafia enabled auto-merge (squash) June 16, 2022 23:13
@captainsafia captainsafia merged commit 9304b39 into dotnet:main Jun 17, 2022
@ghost ghost added this to the 7.0-preview6 milestone Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants