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

Identify long-term strategy for JSON schema generation #2521

Open
captainsafia opened this issue Oct 20, 2022 · 1 comment
Open

Identify long-term strategy for JSON schema generation #2521

captainsafia opened this issue Oct 20, 2022 · 1 comment
Labels
feature suggestion help-wanted A change up for grabs for contributions from the community

Comments

@captainsafia
Copy link
Contributor

In .NET 7, we added support for a new Microsoft.AspNetCore.OpenApi package that is designed to work with minimal API applications and provide constructs that allow users to directly modify the OpenApiOperation associated with their endpoints.

At the moment, the package integrates into Swashbuckle using an ad-hoc merge and replace strategy wherein:

  • If an OpenApiOperation exists in the endpoint metadata, it is used instead of using the one generated by SwaggerGenerator and
  • Swashbuckle's schema generator is leveraged to generate the OpenApiSchema since Microsoft.AspNetCore.OpenApi doesn't support full reflection schema generation to put

In the future, it would be great to unify this ad-hoc strategy, especially now that OpenAPI v3.1's OpenAPI schema exactly matches JSON schema (ref).

Some possibilities include:

With the long-term goal of:

  • Removing the merge and replace strategy/hack in Swashbuckle
  • Allowing users to modify schemas in their WithOpenApi invocations on route handler endpoints

cc: @domaindrivendev @darrelmiller

Copy link
Contributor

This issue is stale because it has been open for 60 days with no activity. It will be automatically closed in 14 days if no further updates are made.

@github-actions github-actions bot added the stale Stale issues or pull requests label Apr 15, 2024
@martincostello martincostello added feature suggestion help-wanted A change up for grabs for contributions from the community and removed stale Stale issues or pull requests labels Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature suggestion help-wanted A change up for grabs for contributions from the community
Projects
None yet
Development

No branches or pull requests

2 participants