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
Support for jsonpatch #199
Comments
i found a workaround: i changed the methodsignature from JsonPatchDocument to Operation[], that way swagger is generated correctly. i dont like this approach because i need JsonPatchDocument to apply the patch. Its constructor contains IContractResolver as parameter that now needs to be obtained somehow. and its simply not the way its ment to be according to: |
I wrote the following
|
in short no i didnt figure it out. thats why i changed the contract of my methods to be operation[]. but there must be some kind of serialization feature that makes shure the document is deserialized correctly but the swagger is wrong |
This does the trick:
|
that doesnt do anything it just fixed the example data but the type in the swagger.json remains the same. @domaindrivendev can u please elaborate why the type isnt detected correctly |
Hi folks, we logged aspnet/Mvc#5464 for MVC to describe this case more accurately in MVC's ApiExplorer. But for the meantime the workarounds here should be fine. Thanks! |
okay if the error is in mvc api explorer ill close this issue |
Hi
im triing to get my patch operations working but the generated swagger is/seems wrong.
i have seen domaindrivendev/Swashbuckle.WebApi#595 but that is related to asp.net classic
in asp.net core JsonPatch is part of the framework but the generated swagger.json is wrong:
i get:
"JsonPatchDocument[T]": {
"type": "object",
"properties": {
"operations": {
"type": "array",
"items": { "$ref": "#/definitions/Operation[T]" },
"readOnly": true
}
}
}
but it should be:
"JsonPatchDocument": {
"type": "array",
"items": { "$ref": "#/definitions/Operation" },
}
}
can someone please point me in the right direction?
The text was updated successfully, but these errors were encountered: