{"id":39010277,"url":"https://github.com/uranium93/swagger-validation-express","last_synced_at":"2026-01-17T17:20:56.521Z","repository":{"id":42819799,"uuid":"267533476","full_name":"uranium93/swagger-validation-express","owner":"uranium93","description":"a validation middleware for express applications based on swagger file","archived":false,"fork":false,"pushed_at":"2022-12-12T22:40:23.000Z","size":459,"stargazers_count":6,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"development","last_synced_at":"2025-10-20T08:34:14.726Z","etag":null,"topics":["express","middleware","rest-api","swagger","validation"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uranium93.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-28T08:20:10.000Z","updated_at":"2023-05-19T04:53:49.000Z","dependencies_parsed_at":"2023-01-28T02:15:41.740Z","dependency_job_id":null,"html_url":"https://github.com/uranium93/swagger-validation-express","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/uranium93/swagger-validation-express","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uranium93%2Fswagger-validation-express","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uranium93%2Fswagger-validation-express/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uranium93%2Fswagger-validation-express/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uranium93%2Fswagger-validation-express/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uranium93","download_url":"https://codeload.github.com/uranium93/swagger-validation-express/tar.gz/refs/heads/development","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uranium93%2Fswagger-validation-express/sbom","scorecard":{"id":911695,"data":{"date":"2025-08-11","repo":{"name":"github.com/uranium93/swagger-validation-express","commit":"ced00612614cb16217a85f95ed5cbe34b9135fdb"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.8,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/8 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/node.js.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.js.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/uranium93/swagger-validation-express/node.js.yml/development?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.js.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/uranium93/swagger-validation-express/node.js.yml/development?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/node.js.yml:28","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"29 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-px4h-xg32-q955","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-44c6-4v22-4mhx","Warn: Project is vulnerable to: GHSA-4x5v-gmq8-25ch","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-24T19:27:04.967Z","repository_id":42819799,"created_at":"2025-08-24T19:27:04.967Z","updated_at":"2025-08-24T19:27:04.967Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28512559,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T13:38:16.342Z","status":"ssl_error","status_checked_at":"2026-01-17T13:37:44.060Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["express","middleware","rest-api","swagger","validation"],"created_at":"2026-01-17T17:20:56.433Z","updated_at":"2026-01-17T17:20:56.509Z","avatar_url":"https://github.com/uranium93.png","language":"TypeScript","readme":"# swagger-validation-express\n\n[![Build Status](https://travis-ci.org/joemccann/dillinger.svg?branch=master)](https://travis-ci.org/joemccann/dillinger)\n\nuse your swagger file as a validation for express application\n\n### Tech\n\nswagger-validation-express uses the open source definition of swagger to work properly:\n\n-   [Swagger] - the official website\n-   [OpenApi 3.0.0] - the module created based on version 3.0.0 definition\n\n### Coming soon\n\n-   headers validation ( included in version @1.1.0)\n-   formdata validation\n-   logger\n-   white listing of url\n-   flexible swagger file path\n\n### Installation\n\nswagger-validation-express:\n\n\u003e -requires [Node.js](https://nodejs.org/) v12+ to run as expected.\n\u003e -support typeScript\n\u003e -body should be parsed (use express.json() or body-parser)\n\n**1- Installing the module**\n\n```sh\n$ npm i swagger-validation-express\n```\n\nor\n\n```sh\n$ yarn add swagger-validation-express\n```\n\n---\n\n**2- Including the swagger file**\nin this version the module is expecting the swagger file to be as json at root level\n\n```sh\n├── package.json\n├── package-lock.json\n├── README.md\n├── server.js\n├── settings.json\n├── src\n├── swagger.json   //the same level with server.js and with exact name swagger.json\n└── tsconfig.json\n\n```\n\n**3-Use the middleware**\nbasicly theres two ways to use the module, one is flexible and the other is outside the box\n\n```javascript\nimport * as express from 'express';\nimport * as swaggerValidation from 'swagger-validation-express';\nconst app = express();\nconst PORT = 2900;\napp.use(express.json());\napp.use(swaggerValidation.middleware); //using the module as the midlleware\napp.post('/test', (req, res) =\u003e {\n    res.json({ status: 'success' });\n});\napp.listen(PORT);\n```\n\n#### OR\n\n```javascript\nimport * as express from 'express';\nimport * as swaggerValidation from 'swagger-validation-express';\nconst app = express();\nconst PORT = 2900;\napp.use(express.json());\napp.use((req, res, next) =\u003e {\n    // add your own logic...\n    try {\n        swaggerValidation.validate(req);\n        next();\n    } catch (error) {\n        res.status(401).json({ status: 'Rejected', message: error.message });\n    }\n});\napp.post('/test', (req, res) =\u003e {\n    res.json({ status: 'success' });\n});\napp.listen(PORT);\n```\n\n### Example\n\nLets use our swagger file : https://github.com/uranium93/swagger-validation-express/blob/development/swagger.json\nand now lets try to send this request to our server\n\n```curl\ncurl --location --request POST 'http://localhost:2900/service1/hjs/hold?query2=test\u0026query1=111-dd-XRPW' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n    \"key2\": \"string DATA\",\n    \"record\": {\n        \"subKey1\": 12345,\n        \"subKey2\": {\n            \"final\": true,\n            \"script\":\"\u003cscript\u003esome important scripts that should be allowed and well formated /script\u003e\"\n        }\n    }\n}'\n```\n\nthe request will be refused because script value didn't match the swagger pattern validation\n\n```json\n{\n    \"status\": \"Rejected\",\n    \"message\": \"\u003cscript\u003esome important scripts that should be allowed and well formated \u003cscript\u003e is not valid : ^\u003cscript\u003e.*\u003c/script\u003e$\"\n}\n```\n\n### Development\n\nWant to contribute? Great!\n\nswagger-valdiation-express uses `typescript` for secure developing.\nMake a change in your file and instantaneously see your updates!\n\nOpen your favorite Terminal and run these commands.\n\nFirst Tab:\n\n```sh\n$ git clone git@github.com:uranium93/swagger-validation-express.git\n```\n\nSecond Tab:\n\n```sh\n$ cd swagger-valdiation-express\n```\n\nThird:\n\n```sh\n$ npm install\n```\n\nFourth:\n\n```sh\n$ npm run dev\n```\n\nto run the development server\n\n[//]: # \"These are reference links used in the body of this note and get stripped out when the markdown processor does its job. There is no need to format nicely because it shouldn't be seen. Thanks SO - http://stackoverflow.com/questions/4823468/store-comments-in-markdown-syntax\"\n[dill]: https://github.com/joemccann/dillinger\n[git-repo-url]: https://github.com/joemccann/dillinger.git\n[john gruber]: http://daringfireball.net\n[df1]: http://daringfireball.net/projects/markdown/\n[markdown-it]: https://github.com/markdown-it/markdown-it\n[ace editor]: http://ace.ajax.org\n[node.js]: http://nodejs.org\n[twitter bootstrap]: http://twitter.github.com/bootstrap/\n[openapi 3.0.0]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md\n[@tjholowaychuk]: http://twitter.com/tjholowaychuk\n[express]: http://expressjs.com\n[swagger]: https://swagger.io/\n[gulp]: http://gulpjs.com\n[pldb]: https://github.com/joemccann/dillinger/tree/master/plugins/dropbox/README.md\n[plgh]: https://github.com/joemccann/dillinger/tree/master/plugins/github/README.md\n[plgd]: https://github.com/joemccann/dillinger/tree/master/plugins/googledrive/README.md\n[plod]: https://github.com/joemccann/dillinger/tree/master/plugins/onedrive/README.md\n[plme]: https://github.com/joemccann/dillinger/tree/master/plugins/medium/README.md\n[plga]: https://github.com/RahulHP/dillinger/blob/master/plugins/googleanalytics/README.md\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furanium93%2Fswagger-validation-express","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Furanium93%2Fswagger-validation-express","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furanium93%2Fswagger-validation-express/lists"}