- use the same OpenAPI description document as in the OpenAPI backend POC
- use a code generator to create the SDK providing a typed fetcher based on the description document
- Use the SDK to load, add and delete pets
The same OpenAPI description document could be used. No changes were made.
The openapi-codgen project generated all the needed code for the SDK
npx @openapi-codegen/cli init
npm install -D @openapi-codegen/{cli,typescript}
npx openapi-codegen gen generated
The generated SDK was used. Type checks worked out of the box. Fetching, pushing and deleting data was simple.