Skip to main content

Petstore API for Testing Out Code Generation Tools

You might be familiar with the celebrated Petstore API spec used to learn about Swagger and OpenAPI tools.

For this exercise, we'll use this modified Petstore OpenAPI specification with updates following our API specification tips.

You can't try out an SDK without an API. So, we’ve mocked the Petstore API using Quickmocker. In our specification we've set the server property.

 "servers": [
{
"url": "https://src8wr32cg.api.quickmocker.com"
}
]

We’ve also added bearToken authentication in Quickmocker and our API specification.

"securitySchemes": {
"bearerAuth": {
"type": "http",
"scheme": "bearer",
"description": "bearer token security"
}
}

The mock server expects an access token set to 1234. Passing an invalid access token will return status code 401 access denied.

With our API and API specfication sorted, let’s look at code generation tools and try them out.

Share this page: