├── .editorconfig ├── .eslintignore ├── .eslintrc.yaml ├── .gitignore ├── .mocharc.yaml ├── .npmignore ├── .nvmrc ├── .nycrc ├── .travis.yml ├── CHANGELOG.md ├── LICENSE ├── README.md ├── docs ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md └── PULL_REQUEST_TEMPLATE.md ├── errors ├── InvalidBodyError.js ├── InvalidContentTypeError.js ├── InvalidPathParamsError.js ├── InvalidQueryParamsError.js ├── MissingRequiredScopes.js └── SchemaValidationError.js ├── examples ├── greeting │ └── hello.js ├── index.js └── spec.json ├── index.js ├── lib ├── middleware-once-per-req.js ├── middlewares │ ├── body │ │ ├── defaults.js │ │ ├── parse.js │ │ └── validate.js │ ├── content-type │ │ └── validate.js │ ├── oauth │ │ └── oauth-scopes.js │ ├── path │ │ └── validate.js │ └── query │ │ ├── defaults.js │ │ ├── parse.js │ │ ├── pick.js │ │ └── validate.js ├── parsers │ ├── array.js │ ├── boolean.js │ ├── index.js │ ├── integer.js │ └── number.js └── utils │ ├── ref-resolver.js │ └── schema-defaults.js ├── middlewares ├── body │ ├── defaults.js │ ├── parse.js │ └── validate.js ├── content-type │ └── validate.js ├── controllers │ └── by-property.js ├── error-handlers │ └── missing-scopes.js ├── oauth │ └── oauth-scopes.js ├── path │ └── validate.js └── query │ ├── defaults.js │ ├── parse.js │ ├── pick.js │ └── validate.js ├── openapi ├── app.js ├── parameters.js ├── path.js └── request-body.js ├── package.json └── test ├── .eslintrc.yaml ├── app.spec.js ├── builders └── req.js ├── globals.js ├── lib ├── middleware-once-per-path.spec.js └── utils │ └── ref-resolver.spec.js └── middlewares ├── body ├── defaults.spec.js ├── parse.spec.js └── validate.spec.js ├── content-type └── validate.spec.js ├── controllers ├── by-property.spec.js ├── dir │ └── example.js ├── example.js └── rejected-promise-controller.js ├── error-handlers └── missing-scopes.spec.js ├── oauth └── oauth-scopes.spec.js ├── path └── validate.spec.js └── query ├── defaults.spec.js ├── parse.spec.js ├── pick.spec.js └── validate.spec.js /.editorconfig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/.editorconfig -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | coverage/ 2 | -------------------------------------------------------------------------------- /.eslintrc.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/.eslintrc.yaml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/.gitignore -------------------------------------------------------------------------------- /.mocharc.yaml: -------------------------------------------------------------------------------- 1 | recursive: true 2 | require: 3 | - ./test/globals.js 4 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/.npmignore -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 22 2 | -------------------------------------------------------------------------------- /.nycrc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/.nycrc -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/.travis.yml -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/CHANGELOG.md -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/README.md -------------------------------------------------------------------------------- /docs/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/docs/CODE_OF_CONDUCT.md -------------------------------------------------------------------------------- /docs/CONTRIBUTING.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/docs/CONTRIBUTING.md -------------------------------------------------------------------------------- /docs/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Description 2 | 3 | Closes # 4 | -------------------------------------------------------------------------------- /errors/InvalidBodyError.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/errors/InvalidBodyError.js -------------------------------------------------------------------------------- /errors/InvalidContentTypeError.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/errors/InvalidContentTypeError.js -------------------------------------------------------------------------------- /errors/InvalidPathParamsError.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/errors/InvalidPathParamsError.js -------------------------------------------------------------------------------- /errors/InvalidQueryParamsError.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/errors/InvalidQueryParamsError.js -------------------------------------------------------------------------------- /errors/MissingRequiredScopes.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/errors/MissingRequiredScopes.js -------------------------------------------------------------------------------- /errors/SchemaValidationError.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/errors/SchemaValidationError.js -------------------------------------------------------------------------------- /examples/greeting/hello.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/examples/greeting/hello.js -------------------------------------------------------------------------------- /examples/index.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/examples/index.js -------------------------------------------------------------------------------- /examples/spec.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/examples/spec.json -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./openapi/app') 2 | -------------------------------------------------------------------------------- /lib/middleware-once-per-req.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/lib/middleware-once-per-req.js -------------------------------------------------------------------------------- /lib/middlewares/body/defaults.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/lib/middlewares/body/defaults.js -------------------------------------------------------------------------------- /lib/middlewares/body/parse.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/lib/middlewares/body/parse.js -------------------------------------------------------------------------------- /lib/middlewares/body/validate.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/lib/middlewares/body/validate.js -------------------------------------------------------------------------------- /lib/middlewares/content-type/validate.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/lib/middlewares/content-type/validate.js -------------------------------------------------------------------------------- /lib/middlewares/oauth/oauth-scopes.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/lib/middlewares/oauth/oauth-scopes.js -------------------------------------------------------------------------------- /lib/middlewares/path/validate.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/lib/middlewares/path/validate.js -------------------------------------------------------------------------------- /lib/middlewares/query/defaults.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/lib/middlewares/query/defaults.js -------------------------------------------------------------------------------- /lib/middlewares/query/parse.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/lib/middlewares/query/parse.js -------------------------------------------------------------------------------- /lib/middlewares/query/pick.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/lib/middlewares/query/pick.js -------------------------------------------------------------------------------- /lib/middlewares/query/validate.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/lib/middlewares/query/validate.js -------------------------------------------------------------------------------- /lib/parsers/array.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/lib/parsers/array.js -------------------------------------------------------------------------------- /lib/parsers/boolean.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/lib/parsers/boolean.js -------------------------------------------------------------------------------- /lib/parsers/index.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/lib/parsers/index.js -------------------------------------------------------------------------------- /lib/parsers/integer.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/lib/parsers/integer.js -------------------------------------------------------------------------------- /lib/parsers/number.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/lib/parsers/number.js -------------------------------------------------------------------------------- /lib/utils/ref-resolver.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/lib/utils/ref-resolver.js -------------------------------------------------------------------------------- /lib/utils/schema-defaults.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/lib/utils/schema-defaults.js -------------------------------------------------------------------------------- /middlewares/body/defaults.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/middlewares/body/defaults.js -------------------------------------------------------------------------------- /middlewares/body/parse.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/middlewares/body/parse.js -------------------------------------------------------------------------------- /middlewares/body/validate.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/middlewares/body/validate.js -------------------------------------------------------------------------------- /middlewares/content-type/validate.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/middlewares/content-type/validate.js -------------------------------------------------------------------------------- /middlewares/controllers/by-property.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/middlewares/controllers/by-property.js -------------------------------------------------------------------------------- /middlewares/error-handlers/missing-scopes.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/middlewares/error-handlers/missing-scopes.js -------------------------------------------------------------------------------- /middlewares/oauth/oauth-scopes.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/middlewares/oauth/oauth-scopes.js -------------------------------------------------------------------------------- /middlewares/path/validate.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/middlewares/path/validate.js -------------------------------------------------------------------------------- /middlewares/query/defaults.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/middlewares/query/defaults.js -------------------------------------------------------------------------------- /middlewares/query/parse.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/middlewares/query/parse.js -------------------------------------------------------------------------------- /middlewares/query/pick.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/middlewares/query/pick.js -------------------------------------------------------------------------------- /middlewares/query/validate.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/middlewares/query/validate.js -------------------------------------------------------------------------------- /openapi/app.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/openapi/app.js -------------------------------------------------------------------------------- /openapi/parameters.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/openapi/parameters.js -------------------------------------------------------------------------------- /openapi/path.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/openapi/path.js -------------------------------------------------------------------------------- /openapi/request-body.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/openapi/request-body.js -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/package.json -------------------------------------------------------------------------------- /test/.eslintrc.yaml: -------------------------------------------------------------------------------- 1 | extends: '@smartrecruiters/eslint-config/node/mocha' 2 | 3 | -------------------------------------------------------------------------------- /test/app.spec.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/test/app.spec.js -------------------------------------------------------------------------------- /test/builders/req.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/test/builders/req.js -------------------------------------------------------------------------------- /test/globals.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/test/globals.js -------------------------------------------------------------------------------- /test/lib/middleware-once-per-path.spec.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/test/lib/middleware-once-per-path.spec.js -------------------------------------------------------------------------------- /test/lib/utils/ref-resolver.spec.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/test/lib/utils/ref-resolver.spec.js -------------------------------------------------------------------------------- /test/middlewares/body/defaults.spec.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/test/middlewares/body/defaults.spec.js -------------------------------------------------------------------------------- /test/middlewares/body/parse.spec.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/test/middlewares/body/parse.spec.js -------------------------------------------------------------------------------- /test/middlewares/body/validate.spec.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/test/middlewares/body/validate.spec.js -------------------------------------------------------------------------------- /test/middlewares/content-type/validate.spec.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/test/middlewares/content-type/validate.spec.js -------------------------------------------------------------------------------- /test/middlewares/controllers/by-property.spec.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/test/middlewares/controllers/by-property.spec.js -------------------------------------------------------------------------------- /test/middlewares/controllers/dir/example.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/test/middlewares/controllers/dir/example.js -------------------------------------------------------------------------------- /test/middlewares/controllers/example.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/test/middlewares/controllers/example.js -------------------------------------------------------------------------------- /test/middlewares/controllers/rejected-promise-controller.js: -------------------------------------------------------------------------------- 1 | module.exports = () => Promise.reject(new Error()) 2 | -------------------------------------------------------------------------------- /test/middlewares/error-handlers/missing-scopes.spec.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/test/middlewares/error-handlers/missing-scopes.spec.js -------------------------------------------------------------------------------- /test/middlewares/oauth/oauth-scopes.spec.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/test/middlewares/oauth/oauth-scopes.spec.js -------------------------------------------------------------------------------- /test/middlewares/path/validate.spec.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/test/middlewares/path/validate.spec.js -------------------------------------------------------------------------------- /test/middlewares/query/defaults.spec.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/test/middlewares/query/defaults.spec.js -------------------------------------------------------------------------------- /test/middlewares/query/parse.spec.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/test/middlewares/query/parse.spec.js -------------------------------------------------------------------------------- /test/middlewares/query/pick.spec.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/test/middlewares/query/pick.spec.js -------------------------------------------------------------------------------- /test/middlewares/query/validate.spec.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartrecruiters/openapi-first/HEAD/test/middlewares/query/validate.spec.js --------------------------------------------------------------------------------