API Evangelist API Evangelist
API Learnings
APIs
API Governance
API Solutions
API Discovery
API Building Blocks
API Evangelist LLC

OpenAPI Operation Request Bodies Examples

Keeping up with the latest versions of the specification.

As with any other schema you should provide examples for any request bodies used for your POST, PUT, and PATCH requests. You should work to use the OpenAPI plural examples property, providing intuitive names for examples, and ideally provide multiple examples for use in mocking and testing.

Examples for your request bodies help automate the delivery and testing of your APIs, but they also help you think through design of your APIs, and allow for mocking even before you have written any backend code. Examples for your request bodies validate the request, but also the overall design of your API, and how you transport data as part of API operations.