-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Future of OpenApiOperation in endpoint metadata #2849
Comments
My thoughts on the above:
The halfway-house-ness is my biggest concern, but maybe it's unfounded? I'm just thinking out-loud here. My knee-jerk reaction here is that 1 is the "safest", and that an additional gesture/overload/something is what users should use/move to if they want to go all in on the new shiny OpenAPI stuff and move away from Swashbuckle/NSwag/A.N.Other. |
@martincostello Thanks for chiming in! The "halfway-house-ness" is definitely a concern I share. I'm torn between whether we try to carry Option 1 appeals to me because of its cheapness. The drawback of user confusion might not be a big deal if we're proactive about documenting what it is and why it doesn't make sense to use it in a post-.NET 8 world.
Good point! There's a decent amount of usage of OK, given that Option 1 requires no engineering work (but some docs work), I'll move with that as the option. If we decide it was a bad choice, we can change it in the future. I suppose that's another benefit of Option 1, it's the easiest one to "take back" if we decide to go with it. 😅 |
Hi everyone!
Filing this issue because I'd like to hear some perspectives on something I'm reasoning through in the
Microsoft.AspNetCore.OpenApi
implementation.In .NET 7, we added support for the
WithOpenApi
endpoint extension method for minimal APIs. When this API was invoked, we would generate anOpenApiOperation
associated with the endpoint using the OpenApiGenerator. ThisOpenApiOperation
would be inserted into endpoint metadata. From there, we made a change so that Swashbuckle would consume theOpenApiOperation
that was present in metadata and insert it into the document it was generating (see here).Now that built-in OpenAPI document generation is supported in
Microsoft.AspNetCore.OpenApi
, I am trying to figure out what the best path forwardWithOpenApi
andOpenApiOperation
in metadata is. Here's some of the options on the table:WithOpenApi
andOpenApiGenerator
as detached from the new document generation in Microsoft.AspNetCore.OpenApi.WithOpenApi
and (eventually) remove logic for integrating OpenApiOperation from metadata into Swashbuckle's document.WithOpenApi
as shorthand for producing an operation transformer but remove functionality for inserting the OpenAPI operation into metadata for Swashbuckle to consume.WithOpenApi
as shorthand for producing an operation transformer and project the OpenApiOperation from the built-in document into metadata for Swashbuckle to consume.Of the options above, #4 is probably the most expensive to implement but retains the most amount of behavior for users. #1 is cheap but doesn't leave users in a good place WRT whether they should use
WithOpenApi
at all.Thoughts?
The text was updated successfully, but these errors were encountered: