Releases: onebeyond/swagger-endpoint-validator
v4.1.0
What's Changed
- Add commitlint by @inigomarquinez in #66
- refactor: add option to configure error propagation by @neodmy in #67
- docs: add neodmy as a contributor for code, and test by @allcontributors in #68
New Contributors
Full Changelog: v4.0.0...v4.1.0
v4.0.0
What's Changed
- Deps by @inigomarquinez in #50
- Docs: Update license by @UlisesGascon in #53
- docs: added await to docs usage reference by @UlisesGascon in #56
- Update express-openapi-validator to latest version by @inigomarquinez in #55
- docs: add kevinccbsg as a contributor for bug, code, and 4 more by @allcontributors in #58
- docs: add LonelyPrincess as a contributor for bug, and code by @allcontributors in #60
- docs: add irenemherrero as a contributor for code by @allcontributors in #61
- docs: add inigomarquinez as a contributor for bug, code, and 5 more by @allcontributors in #62
- docs: add UlisesGascon as a contributor for bug, code, and 5 more by @allcontributors in #64
New Contributors
- @allcontributors made their first contribution in #58
Full Changelog: v3.0.2...v4.0.0
v3.0.2
Full Changelog: v3.0.1...v3.0.2
v3.0.1
What's Changed
- chore(deps): bump lodash from 4.17.15 to 4.17.19 by @dependabot in #25
- chore(deps): bump express-jsdoc-swagger from 1.0.4 to 1.1.0 by @kevinccbsg in #27
- Upgraded express-openapi-validator by @inigomarquinez in #28
- Migrate CI/CD from Travis to GitHub Actions by @irenemherrero in #42
- Update deps by @inigomarquinez in #47
- New release by @inigomarquinez in #48
New Contributors
- @dependabot made their first contribution in #25
- @irenemherrero made their first contribution in #42
Full Changelog: v2.1.0...v3.0.1
v2.1.0
Main changes
This PR adds the possibility to set advanced configuration through the options object when initializing it.
This advanced configuration is related to the underlying validator. More information here (https://www.npmjs.com/package/express-openapi-validator#advanced-usage).
By default the validator will take the default values except for validateResponses, that we force to true if there is no property in the options object to customize it (I did it to avoid breaking down current systems using the validator).
This shouldn't affect to the services using this library, as all the options have a default value.
Other changes
- Updated depencencies:
js-yaml: 3.13.1 → 3.14.0eslint: 6.8.0 → 7.5.0eslint-config-airbnb-base: 14.1.0 → 14.2.0eslint-plugin-import: 2.20.2 → 2.22.0eslint-plugin-jest: 23.9.0 → 23.18.0jest: 26.0.1 → 26.1.0jest-junit: 10.0.0 → 11.0.1
Context
- Close #23
Changelog
- f6b2f6b feat: fully customize options of underlying validator by @inigomarquinez
- 248eae9 chore: updated dependencies by @inigomarquinez
- bca03c6 chore: upgrade package version by @inigomarquinez
v2.0.2
Main changes
- Added optional endpoint to show UI with API documentation (
apiDocEndpointin validator config parameters). - Added console warning message when using
jsdocformat to inform about deprecation of this format. - Removed
ignorePathsasapiDocEndpointandvalidationEndpointhave been declared before initializing the validator, so they are not included in the validation process any more. - Added example of
allOfto yaml docs.
Other changes
- Added a function to run a demo server to be able to test the library.
- Added
npm outdatedtopre-pushhook. - Updated depencencies:
express-openapi-validator: 3.10.0 => 3.12.7openapi-enforcer: 1.10.1 => 1.10.3swagger2openapi: 6.0.2 => 6.0.3eslint-plugin-jest: 23.8.2 => 23.9.0husky: 4.2.3 => 4.2.5jest: 25.2.4 => 26.0.1
Context
- Close #16
Changelog
- 0598fbd feat: added example of using allOf by @inigomarquinez
- f754245 feat: added optional endpoint to show UI with API doc by @inigomarquinez
v2.0.1
Main changes
- If the validator is initialized with an
validationEndpoint, this endpoint is skipped from the validator itself to be able to do requests to it without validation errors. - Improved
validateSchemamethod. - Renamed
inputtorequestin validation endpoint requestBody to have a more accurate name.
Other changes
- Force validator to fully validate formats.
- Simplified some debug messages.
- Removed obsolete documentation from README to avoid confusion.
- Fixed status code sent by the validator for some errors.
v2.0.0
⚠️ IMPORTANT! ⚠️
This is a new major version that is NOT compatible with the previous one. The validator is used in a totally different way. So be careful when updating your package.
Main changes
-
Changed how the validator is used: now you only need to initialize the validator (
init(app, options)) after creating the Express application and it will AUTOMATICALLY validate all the requests and responses (depending on the configuration options when initializing). No need to call the validate method explicitly (beforevalidateAPIInput()andvalidateAPIOutput()had to be called). -
Added
normalizeOptionsmodule to normalizeoptionsinput parameter and to set default values if any parameter is not set by the user. -
Added
openAPISpecificationmodule to generate the OpenAPI specification based on the format of the documentation used by the user to document the endpoints of the API. Supported formats are:yamlif the documentation is stored in a yaml file (see js-yaml).yaml_jsdocif the documentation is generated using yaml format in inline JSDoc documents tagged with@swagger(see swagger-jsdoc).jsdocif the documentation is generated using pure JSDoc format (see express-swagger-generator).
-
Added
customErrorHandlerthat catches requests validation errors and sends a custom error. -
Added
validationEndpointmodule to add an optional endpoint to be able to do explicit requests and responses validation (e.g. for e2e tests of the API). -
Removed dependency from swagger-model-validator.
Minor changes
huskyrchas been removed. Now it's insidepackage.json.- Improved methods documentation.
- Added debug information (prefix:
swagger-endpoint-validator). - Added
lib/constants.jsfile to store constants used across the library.
3rd party libraries used
- express-openapi-validator: this is the core library used to automatically validate API requests and responses using an OpenAPI 3 specification.
- swagger2openapi: used to convert from OpenAPI 2.0 to OpenAPI 3.0.x
- js-yaml: parses string as single YAML document and returns a JavaScript object. Used when the user uses a
yamlformat to write the API documentation. - express-swagger-generator: allows to integrate OpenAPI using JSDoc comments and generates the OpenAPI specification (v2 format). Used when the user uses a
yaml_jsdocformat file to write the API documentation. - swagger-jsdoc: allows to integrate Swagger using JSDoc comments in the code by just adding
@swaggeron top of the DocBlock and generates the OpenAPI specification (v3 format). Used when the user uses ajsdocformat to write the API documentation. - openapi-enforcer: this library is used to be able to do independent validation of values against OAS schemas.
- supertest: this is used in development to do e2e testing of the API.
Work in progress
There is still some work to be done. We are releasing the first version of this new validator so we can start using it. But these issues will be added to the backlog to work on them:
- Update documentation (README).
- Add unitary tests.
- Add optional endpoint validation tests.
- Support for
allOfand other tags added in the OpenAPI v3 spec. - Optional publication of the generated API doc (swagger-ui-express)
- Investigate validator-badge
- Add issue in express-swagger-generator because it doesn't
type: objectto the schemas and we have to do it manually.
v1.1.5
Notable changes
swagger-jsdoc ^3.5.0 → ^4.0.0
swagger-ui-express ^4.1.3 → ^4.1.4
eslint-config-airbnb-base ^14.0.0 → ^14.1.0
eslint-plugin-import ^2.20.0 → ^2.20.1
eslint-plugin-jest ^23.6.0 → ^23.8.2
husky ^4.2.1 → ^4.2.3
NPM Publication details
npm notice
npm notice 📦 swagger-endpoint-validator@1.1.5
npm notice === Tarball Contents ===
npm notice 101B .huskyrc
npm notice 0 docs/.nojekyll
npm notice 968B docs/index.html
npm notice 1.1kB test/jsdoc/e2e.invalid.test.js
npm notice 1.7kB test/yaml/e2e.invalid.test.js
npm notice 1.0kB test/jsdoc/e2e.valid.test.js
npm notice 1.0kB test/yaml/e2e.valid.test.js
npm notice 358B lib/errors.js
npm notice 2.5kB test/jsdoc/fake-server.js
npm notice 3.6kB test/yaml/fake-server.js
npm notice 4.6kB index.js
npm notice 164B test/jsdoc/models.js
npm notice 385B test/yaml/models.js
npm notice 570B test/jsdoc/unit.test.js
npm notice 1.2kB test/yaml/unit.test.js
npm notice 780B .eslintrc.json
npm notice 1.2kB package.json
npm notice 8.0kB docs/README.md
npm notice 7.8kB README.md
npm notice 293B .travis.yml
npm notice === Tarball Details ===
npm notice name: swagger-endpoint-validator
npm notice version: 1.1.5
npm notice package size: 6.4 kB
npm notice unpacked size: 37.3 kB
npm notice shasum: f0c3b17851c2f61db6e7fd2a1eaf1f482e1ffb94
npm notice integrity: sha512-k2nkbFByuytBg[...]gPiAX0ycWNTCQ==
npm notice total files: 20
npm notice
+ swagger-endpoint-validator@1.1.5
v1.1.4
NPM logs from CI
npm notice
npm notice 📦 swagger-endpoint-validator@1.1.4
npm notice === Tarball Contents ===
npm notice 101B .huskyrc
npm notice 0 docs/.nojekyll
npm notice 968B docs/index.html
npm notice 1.1kB test/jsdoc/e2e.invalid.test.js
npm notice 1.7kB test/yaml/e2e.invalid.test.js
npm notice 1.0kB test/jsdoc/e2e.valid.test.js
npm notice 1.0kB test/yaml/e2e.valid.test.js
npm notice 358B lib/errors.js
npm notice 2.5kB test/jsdoc/fake-server.js
npm notice 3.6kB test/yaml/fake-server.js
npm notice 4.6kB index.js
npm notice 164B test/jsdoc/models.js
npm notice 385B test/yaml/models.js
npm notice 570B test/jsdoc/unit.test.js
npm notice 1.2kB test/yaml/unit.test.js
npm notice 780B .eslintrc.json
npm notice 1.2kB package.json
npm notice 8.0kB docs/README.md
npm notice 8.0kB README.md
npm notice 293B .travis.yml
npm notice 1.6kB .circleci/config.yml
npm notice === Tarball Details ===
npm notice name: swagger-endpoint-validator
npm notice version: 1.1.4
npm notice package size: 6.9 kB
npm notice unpacked size: 39.1 kB
npm notice shasum: bae6d750c3f9514a1714c441844ad7cb5e80312c
npm notice integrity: sha512-e+5z/EAUDlwq0[...]LRM71e/g83TYw==
npm notice total files: 21
npm notice