https://github.com/thim81/spec-driven-openapi-contract-performance-testing
POC for Unlocking the Power of Spec-Driven API Development
https://github.com/thim81/spec-driven-openapi-contract-performance-testing
contract-testing openapi performance-testing postman rest-api
Last synced: 10 months ago
JSON representation
POC for Unlocking the Power of Spec-Driven API Development
- Host: GitHub
- URL: https://github.com/thim81/spec-driven-openapi-contract-performance-testing
- Owner: thim81
- License: apache-2.0
- Created: 2024-01-14T14:46:08.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-21T11:54:51.000Z (over 1 year ago)
- Last Synced: 2024-10-23T08:54:33.045Z (over 1 year ago)
- Topics: contract-testing, openapi, performance-testing, postman, rest-api
- Language: PHP
- Homepage:
- Size: 23.8 MB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
### OpenAPI Spec-driven concept
> Congrats, you just launched 🚀 an API! And next the questions are pouring in: Where are the docs? How many requests per minute can it handle? Which fields are required? How to test the API? 🤔
This repo contains a proof-of-concept used during a presentation about "Unlocking the Power of Spec-Driven API Development", for the Meetup: https://www.meetup.com/php-limburg-be/events/298068752/

It provides a working Marvel API, which is used to demonstrate all the steps & benefits of Spec-Driven API Development.
The outcome of this proof-of-concept is a working API, with a full set of documentation, tests, mock server, performance tests, client SDKs, ...

The meetup is recorded and can be watched on Youtube:
https://www.youtube.com/watch?v=YXRstde1SeA&t=198s

## Getting started
The repository contains a OpenAPI Spec file `openapi.yml`, which is used as the central source to generate documentation, mock server, postman collection, contract tests, performance tests and client SDKs.
Per folder, you can find a `package.json` file which contains the tools & scripts to generate the outputs.
### REST API Server
The REST API Server can be started in the folder "restapi-server" by running `npm run server-start`.
It is a simple NodeJS/Express/Prisma API server using SQLite. It provides a full CRUD API for managing Marvel characters, teams & movies.
## Publish documentation
Examples for using Redoc, Swagger UI, Scalar can be found in the folder "restapi-server/public/docs".
### Publish Postman Collection
The scripts to generate the Postman Collection can be found in the folder `publish-postman`
### Publish OpenAPI Spec
The scripts to generate the OpenAPI Spec can be found in the folder `publish-openapi`
### Generate Mock Server
The Mock server can be started in the folder "mock-prism" by running `npm run mock`
### Generate Contract Tests
The Contract Tests scripts can be found in the folder "testing-contract".
### Generate Performance Tests
The Performance Tests scripts can be found in the folder "testing-k6".
### Generate Client SDKs
The Client SDKs scripts can be found in the folder "client-sdk".