Closed xantari closed 5 years ago
Figured out what it was!
Added this and all is right with the world now. Apparently when it is nullable, it wants to give you the example of blank / null instead of the example tag.
settings.GeneratorSettings.AllowNullableBodyParameters = false;
I've added example tags to my objects however they are not shown in the Swagger UI.
This seems to indicate that it will now process tags automatically without any operation processor.
https://github.com/RicoSuter/NJsonSchema/issues/1010
If you look at the above link it gives you an example: https://github.com/RicoSuter/NJsonSchema/wiki/XML-Documentation#define-examples
I have set the following:
My Controller:
My object:
Swagger setup:
However it is not showing the Example tag:
Update 1: I can see the example in the swagger.json file, The UI for some reason doesn't interpret them properly?
I can see it reference that object here:
It seems that perhaps the example shouldn't be on the components, but instead on the responseBody according to this? https://swagger.io/docs/specification/describing-request-body/
However that seems a bit odd, as it seems you would want it defined just on the component object so any other method that uses it would get the same example.