Helper understanding withopenapi deprecation #5313
Unanswered
colin-s-ingram
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi we have a project where we are currently using Nswag. We have been using WithOpenApi and using it per endpoint to decorate the api docs with descriptions.
With the announcement here:
https://learn.microsoft.com/en-us/dotnet/core/compatibility/aspnet-core/10/withopenapi-deprecated
we were exploring switching to AddOpenApiOperationTransformer.
We added this to our minimal api but the summary and description are not added to the generated document.
The only way we could achieve this is by adding the attribute following to the handler method.
[OpenApiOperation(
summary: "Something",
description: "Something"
)]
Since the attribute usage is only on [AttributeUsage(AttributeTargets.Method)] using something like below on the delegate also doesn't appear to work.
The document says if we "used NSwag for document generation, use the IOperationProcessor API." I having a hard time understanding how in a nice minimal api friendly way I can use this to do the per endpoint specific documentation. It seems to me that I have register very specific operations far form the endpoint definition itself upon registering openApi.
Can anyone help me out and explain what our options are, and perhaps point me in the direction of documentation that would allow me fix this, Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions