https://github.com/cdimascio/express-no-stress-openapi3-example
https://github.com/cdimascio/express-no-stress-openapi3-example
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/cdimascio/express-no-stress-openapi3-example
- Owner: cdimascio
- Created: 2019-03-22T21:02:16.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-03T18:21:09.000Z (over 3 years ago)
- Last Synced: 2025-04-06T22:23:25.361Z (about 1 year ago)
- Language: JavaScript
- Size: 3.27 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# express-no-stress-openapi3-example
This is a project to demonstrate [express-openapi-validator](https://github.com/cdimascio/express-openapi-validator) using an [express-no-stress](https://github.com/cdimascio/generator-express-no-stress) scaffolded api.
[express-openapi-validator](https://github.com/cdimascio/express-openapi-validator) is a new middleware style validator for OpenApi 3.x and expressjs. I intend to include this validator as an option for [generator-express-no-stress](https://github.com/cdimascio/generator-express-no-stress). This project exists as an early proof of concept.
## Get Started
Get started developing...
```shell
# clone this repo
git clone https://github.com/cdimascio/express-no-stress-openapi3-example
cd express-no-stress-openapi3-example
# install deps
npm install
# run in development mode
npm run dev
# run tests
npm run test
```
## Differences from the current express-no-stress generated app
1. [`Api.yaml`](server/common/Api.yaml) is converted to OpenApi 3
2. [`Api.yaml`](server/common/Api.yaml) is moved from `server/common/swagger` to `server/common`
3. `server/common/swagger`has been removed
4. [`server/common/server.js`](server/common/server.js) has been edited to:
- remove its dependencies on swagger
- add a dependency on [express-openapi-validator](https://github.com/cdimascio/express-openapi-validator)
## Try It
* Open you're browser to [http://localhost:3000](http://localhost:3000)
* Invoke the `/examples` endpoint
```shell
curl http://localhost:3000/api/v1/examples
```
express-openapi-validator