Closed cleftheris closed 1 year ago
There is actually a workaround. I have found that this bug stems from Microsoft.OpenApi
nuget package. If you include an explicit reference to the preview 1.6.4-preview2 version the issue is tackled and this pull request is not needed.
It was indeed the new OpenApiOperation(OpenApiOperation operation)
constructors fault.
do you want to send an update with that change?
Yes definitely
Updated with the said changes. Probably better if you squashed the pull request since I did a couple of extra commits revert my visualstudio tabs/spaces settings.
…when it originaly should be left null. This messes up operations in the openapi spec that otherwise have an empty body.
I cannot help but wonder though if the
new OpenApiOperation
constructor should be taking the liberty of initializing the RequestBody property since the passed parameter has it null. Maybe it is a bug with theMicrosoft.AspNetCore.OpenApi
library.I love this repo and was deeply influenced to start with minimal APIs (and docker for that matter). So my pull request is for all the people like me that copied the helpers (Extensions) from here as a starting point.
This is not related to the endpoints behavior but can be a problem when you are actually invested in generating clients from the open API spec.