I am part of a large C# API project, and we are having issues with clients being confused due to unneeded properties showing in our Swagger documentation (we are using Swashbuckle to generate it)
In its simplest form, it comes down to this:
We have a simple class with just an ID and a Description property.
On the POST, we don't require the ID to be sent (will be auto generated). But on GET, and other verbs, the ID is required to be returned/sent
We would love to use the exact same model for all these endpoints (for simplicity), but exclude the ID from the POST request documentation
It would be great if it was excluded by endpoint, not by Verb - as I am sure we will run into some scenario where it is not Verb specific.
readOnly? This scenario is exactly whatreadOnlyis for. - HelenreadOnlyproperty @Helen suggested, or just add good examples to each action - Helder Sepulveda