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

Improve JSON validation schema generation in Microsoft.AspNetCore.OpenApi #41246

Closed
captainsafia opened this issue Apr 18, 2022 · 2 comments
Closed
Assignees
Labels
area-web-frameworks enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-openapi
Milestone

Comments

@captainsafia
Copy link
Member

captainsafia commented Apr 18, 2022

#41238 introduced a very reductive schema generation interface for the OpenApi package.

Moving forward we want to make this API a lot more robust which includes generating the full schema (types, formats, and constraints) for Types that are provided in MethodInfo including:

  • Accounting for nullability
  • Accounting for default values
  • Accounting for types and formats to match JSON validation
  • Accounting for types with TryParse methods
@captainsafia captainsafia added enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-openapi area-web-frameworks labels Apr 18, 2022
@captainsafia captainsafia added this to the .NET 7 Planning milestone Apr 18, 2022
@captainsafia captainsafia self-assigned this Apr 18, 2022
@ghost
Copy link

ghost commented Apr 18, 2022

Thanks for contacting us.

We're moving this issue to the .NET 7 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@captainsafia
Copy link
Member Author

With #42169 and domaindrivendev/Swashbuckle.AspNetCore#2441, we're in decent shape here for .NET 7. There are still a few small issues I need to fix on the Microsoft.AspNetCore.OpenApi side, but we're generating sufficient schemas here.

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).

@ghost ghost locked as resolved and limited conversation to collaborators Aug 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-web-frameworks enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-openapi
Projects
None yet
Development

No branches or pull requests

1 participant