-
-
Notifications
You must be signed in to change notification settings - Fork 159
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
Umbrella: OpenAPI integration #1046
Comments
This is so exciting! This will catapult JADNC to the next level 🚀 |
For anyone that wants to try out the latest bits: pick a version with "openapi" in the name from https://github.com/json-api-dotnet/JsonApiDotNetCore#trying-out-the-latest-build. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
JetBrains Rider has built-in IDE support for OpenAPI, see https://www.jetbrains.com/help/rider/OpenAPI.html. |
@bkoelman what's the status of the OpenAPI integration? I could have a look if there is a isolated issue about it. |
@verdie-g The OpenAPI integration is my primary priority. Picking up from @maurei's work, I've recently implemented support for triple-slash doc-comments, query string parameters, and included related resources in responses. I've updated the list of work items and marked several with the good first issue label. Feel free to give it a try. |
Happy to see this work is being picked up again! I wish I could devote a few months of my time to this again :-) |
OpenAPI generation is being added in ASP.NET 9, replacing the Swashbuckle support in Visual Studio. |
Does it change the plans regarding this issue? If the current openapi branch is merged into master I suppose it will be hard to migrate to Microsoft.AspNetCore.OpenApi so maybe we should consider doing the migration now. Note that Microsoft.AspNetCore.OpenApi targets .NET 7+ and JADNC targets .NET 6+. Though, .NET 6 EOL is in November of this year so I suppose JADNC could drop .NET 6 then. |
I've tried the built-in support in ASP.NET 9 preview4. It doesn't work at all with what we have today. The first issue is that the ApiExplorer integration (rewriting endpoints) is handled differently. The ASP.NET implementation is still in a very early stage and under active development. I've expressed our needs at dotnet/aspnetcore#54598 (comment), but the extension points we need don't yet exist. I don't think it makes sense to spend a lot of time on adopting it in the near future. And because Swashbuckle is now under active maintenance again, I suspect to finish our OpenAPI integration based on that. Because it is mature and stable, and our extensibility needs go way beyond what most other projects need. |
@bkoelman Following up on the comment that you left in the issue on the ASP.NET Core repo here. The
The biggest gap I noticed is around your schema generation-based customizations. Our implementation currently relies on the new
Do you use What discriminators are you referring to in the statement above? At the moment, our implementation supports STJ's polymorphism attributes by default. Does your library provide a custom set?
I assume you're doing this to work around the limitation in OpenAPI v3 that the JSON Schema
Requiredness/nullability are modeled independently in our system so you should be able to model required properties that can be null if need be. But to a more general point, I think your statement here:
is prudent and wise. It seems like you've done a lot of work in the area already building our Swashbuckle's model and I wouldn't through that away. In the future, it would be interesting to explore if you can extend this to support M.A.OpenAPI as well, and perhaps go even further and recommend some API changes to the underlying ApiExplorer metadata layer that both Swashbuckle/M.A.OpenAPI use for document generation to make your framework more resilient to whatever API document spec is supported. I hope this information was helpful! If you have any inquiries about this work (particularly in regard to the more ASP.NET Core-related aspects), I'm happy to share insights. |
Hi @captainsafia, Thanks for the follow-up, I really appreciate the proactivity here. |
OpenAPI integration
This document provides an overview of the work items involved in creating an OpenAPI integration for JsonApiDotNetCore.
Approach
Creating an OpenAPI integration for JADNC requires setting up a mechanism that generates an OpenAPI Specification (OAS) file from application code. This file allows for automatic generation of API docs (see eg. SwaggerUI) and client code (see eg. NSwag code generator). In the design choices for this mechanism precedence will be given to compatibility with client code generation tools because we believe this to be of the biggest impact to the JSON:API community (see eg. this issue and others).
In a private repository we have experimented for several months with integrating Swashbuckles SwaggerGen in a JADNC application. We have decided to extract this code into this repository and move forward from there.
Work items
The order of the list below reflects the order in which we intend to address the work items.
ResourceNameFormatter
#1049IApiRequestFormatMetadataProvider
, removing the input formatter workaround #1050required
. #1111included
object #1059jsonapi
object #1061meta
object #1063The state of the integration can be viewed in the openapi branch.
Feedback
The best way to give feedback is to create new issues or upvote/downvote existing ones.
Please give us feedback that will give us insight on the following points:
The text was updated successfully, but these errors were encountered: