{"id":14986704,"url":"https://github.com/superfaceai/openapi-linter","last_synced_at":"2025-04-11T20:32:40.035Z","repository":{"id":65564280,"uuid":"530604809","full_name":"superfaceai/openapi-linter","owner":"superfaceai","description":"Is your OpenAPI Spec ready for SDK generators?","archived":false,"fork":false,"pushed_at":"2023-07-19T11:32:46.000Z","size":734,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-05-28T20:06:21.996Z","etag":null,"topics":["oas","openapi","openapi-validation","openapi2","openapi3","swagger"],"latest_commit_sha":null,"homepage":"","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/superfaceai.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-30T10:24:31.000Z","updated_at":"2024-05-08T16:57:02.000Z","dependencies_parsed_at":"2024-09-11T19:55:37.489Z","dependency_job_id":"7de9a316-b2d0-416b-a35c-d0d066ec70a9","html_url":"https://github.com/superfaceai/openapi-linter","commit_stats":{"total_commits":26,"total_committers":5,"mean_commits":5.2,"dds":"0.23076923076923073","last_synced_commit":"32cecce8e4a0401d0718c351bf4ac8db61e21b7b"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superfaceai%2Fopenapi-linter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superfaceai%2Fopenapi-linter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superfaceai%2Fopenapi-linter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superfaceai%2Fopenapi-linter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/superfaceai","download_url":"https://codeload.github.com/superfaceai/openapi-linter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223479565,"owners_count":17151931,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["oas","openapi","openapi-validation","openapi2","openapi3","swagger"],"created_at":"2024-09-24T14:13:22.979Z","updated_at":"2024-11-07T08:03:32.743Z","avatar_url":"https://github.com/superfaceai.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenAPI Linter\n\n[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/superfaceai/openapi-linter/CI)](https://github.com/superfaceai/openapi-linter/actions/workflows/main.yml)\n[![npm](https://img.shields.io/npm/v/@superfaceai/openapi-linter)](https://www.npmjs.com/package/@superfaceai/openapi-linter)\n[![license](https://img.shields.io/npm/l/@superfaceai/openapi-linter)](LICENSE)\n[![CLI built with oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)\n[![GitHub Discussions](https://img.shields.io/github/discussions/superfaceai/.github?logo=github\u0026logoColor=fff)](https://github.com/orgs/superfaceai/discussions)\n\n\u003e Is your OpenAPI Spec ready for SDK generators?\n\nOpenAPI Linter is a CLI and a Node.js library to validate OpenAPI specification.\nIt is based on [Spectral] by Stoplight with [OpenAPI rules](https://meta.stoplight.io/docs/spectral/4dec24461f3af-open-api-rules) with additional rules. The goal of Linter is to check whether the spec contains enough information to generate high quality, well documented SDK.\nWe use OpenAPI Linter in [Superface Integration Designer][designer], but any client code generator benefits from well written OpenAPI specs.\n\n## Setup\n\nInstall from npm globally:\n\n```shell\nnpm i -g @superfaceai/openapi-linter\n```\n\nNow you can use the linter with commands `openapi-linter` or `oal`.\n\nAlternatively you can use the linter without installation with `npx`:\n\n```\nnpx @superfaceai/openapi-linter lint \u003cfile or URL\u003e\n```\n\n## CLI commands\n\n  \u003c!-- commands --\u003e\n\n- [`openapi-linter lint SPECIFICATIONPATH`](#openapi-linter-lint-specificationpath)\n\n### `openapi-linter lint SPECIFICATIONPATH`\n\nLints OpenAPI specification using three different parsers/validators.\n\n```\nUSAGE\n  $ openapi-linter lint [SPECIFICATIONPATH] [-f yaml|json] [-e error|warning|any]\n\nARGUMENTS\n  SPECIFICATIONPATH  Path or URL to specification file\n\nFLAGS\n  -e, --throwOn=\u003coption\u003e     [default: error] On which kind of severty error should be thrown. When set to warning\n                             command will throw when there is a result with \"warning\" or \"error\" severity.\n                             \u003coptions: error|warning|any\u003e\n  -f, --fileFormat=\u003coption\u003e  Format of specification. Must be \"yaml\" or \"json\" when defined\n                             \u003coptions: yaml|json\u003e\n\nDESCRIPTION\n  Lints OpenAPI specification using three different parsers/validators.\n\nEXAMPLES\n  $ oal lint https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml\n\n  $ oal lint examples/petstore.yaml\n\n  $ oal lint examples/petstore.yaml -e any\n\n  $ oal lint examples/petstore.yaml -f yaml\n```\n\n\u003c!-- commandsstop --\u003e\n\n## Usage in code\n\nInstall the linter as a dependency into your project:\n\n```shell\nnpm i @superfaceai/openapi-linter\n```\n\nUse the `lint` function:\n\n\u003c!-- TODO: Add example what's in lintResult --\u003e\n\n```ts\nimport { lint } from 'openapi-linter';\n\n// Get specification as string\nconst specification = await fs.readFile(pathToSpec, { encoding: 'utf-8' });\n\n// Pass specification, its extension (\"yaml\" or \"json\") and name\nconst lintResult = await lint(specification, 'yaml', 'my-spec-name');\n\n//Do something with result\nconsole.log(lintResult);\n```\n\n\u003c!-- TODO\n## Added rules (WIP)\n\n* Each operation has to define at least one success response\n* Each operation has to define at least one error or default response\n--\u003e\n\n## Related projects\n\n- [Spectral], generic linter for JSON and YAML this project is based on\n- [OpenAPI Enforcer](https://openapi-enforcer.com/)\n- [OpenAPI Validator](https://github.com/IBM/openapi-validator)\n- [OAS Tools](https://oas-tools.github.io/)\n- [Redocly CLI](https://github.com/Redocly/redocly-cli)\n- [Cherrybomb](https://github.com/blst-security/cherrybomb) (Rust)\n- and [many more](https://openapi.tools/)\n\n## Maintainers\n\n- [Jakub Vacek](https://github.com/Jakub-Vacek)\n- [Radek Kyselý](https://github.com/kysely)\n\n## License\n\nThis project is licensed under the [MIT license](LICENSE).\n\n© 2023 Superface s.r.o.\n\n[spectral]: https://stoplight.io/open-source/spectral\n[designer]: https://superface.ai/designer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuperfaceai%2Fopenapi-linter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuperfaceai%2Fopenapi-linter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuperfaceai%2Fopenapi-linter/lists"}