{"id":20617614,"url":"https://github.com/istreamlabs/rest-api-lint","last_synced_at":"2025-04-15T11:29:42.775Z","repository":{"id":40289971,"uuid":"237052565","full_name":"istreamlabs/rest-api-lint","owner":"istreamlabs","description":"REST API linting using OpenAPI and Spectral","archived":false,"fork":false,"pushed_at":"2024-12-10T17:08:16.000Z","size":393,"stargazers_count":5,"open_issues_count":7,"forks_count":2,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-28T19:21:38.369Z","etag":null,"topics":["api-linting","docker","docker-image","github-action","linter","openapi","openapi3"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/istreamlabs.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-29T18:23:40.000Z","updated_at":"2024-12-10T17:08:19.000Z","dependencies_parsed_at":"2024-11-15T12:16:32.500Z","dependency_job_id":null,"html_url":"https://github.com/istreamlabs/rest-api-lint","commit_stats":{"total_commits":50,"total_committers":5,"mean_commits":10.0,"dds":0.38,"last_synced_commit":"1e8e4cced95069edfc30b595dcf69fe8a10bd750"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/istreamlabs%2Frest-api-lint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/istreamlabs%2Frest-api-lint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/istreamlabs%2Frest-api-lint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/istreamlabs%2Frest-api-lint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/istreamlabs","download_url":"https://codeload.github.com/istreamlabs/rest-api-lint/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248964328,"owners_count":21190509,"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":["api-linting","docker","docker-image","github-action","linter","openapi","openapi3"],"created_at":"2024-11-16T12:05:00.170Z","updated_at":"2025-04-15T11:29:42.748Z","avatar_url":"https://github.com/istreamlabs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# REST API Linting Action\n\n[![.github/workflows/ci.yaml](https://github.com/istreamlabs/rest-api-lint/workflows/.github/workflows/ci.yaml/badge.svg)](https://github.com/istreamlabs/rest-api-lint/actions?query=workflow%3A.github%2Fworkflows%2Fci.yaml) [![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/istreamlabs/rest-api-lint)](https://hub.docker.com/r/istreamlabs/rest-api-lint) [![Docker Pulls](https://img.shields.io/docker/pulls/istreamlabs/rest-api-lint)](https://hub.docker.com/r/istreamlabs/rest-api-lint)\n\nA Docker image with opinionated REST API linting for iStreamPlanet. Supports GitHub Actions.\n\nThis is built using [Stoplight's Spectral](https://stoplight.io/open-source/spectral). The custom ruleset is defined in [isp-rules.yaml](https://github.com/istreamlabs/rest-api-lint/blob/master/isp-rules.yaml), where you can find the descriptions and rule names (if you want to disable individual rules).\n\n## Usage\n\nThere are two recommended ways to use this:\n\n1. GitHub Actions\n2. Any system that supports Docker images\n\n### GitHub Actions Example\n\nSet up a workflow that uses this image to do API linting and you are done:\n\n```yaml\non: [push]\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    name: Build \u0026 Test\n    steps:\n      - uses: actions/checkout@v1\n      - name: API Lint\n        uses: istreamlabs/rest-api-lint@master\n        with:\n          filename: path/to/openapi.yaml\n```\n\nThe path you pass should be relative to the checkout directory, which is automatically mounted in the container and becomes the working directory.\n\n### Docker Example\n\nWhile similar to the above, you will need to do an extra step when using Docker directly. You must ensure that the working directory gets mounted properly into the container.\n\nYou can either use the published [`istreamlabs/rest-api-lint`](https://hub.docker.com/r/istreamlabs/rest-api-lint) container or build it yourself locally.\n\n```sh\n# Create the image.\n$ docker build -t rest-api-lint .\n\n# Mount the current working directory to `/tmp` in the container and run linting.\n$ docker run -it -v $(pwd):/tmp rest-api-lint:latest /tmp/my-openapi.yaml\n\n# If you have a custom `.spectral.yaml` with overrides:\n$ docker run -it -w /workspace -v $(pwd):/workspace rest-api-lint:latest openapi.yaml\n```\n\nThe command will return a `0` on success and a `1` if any errors are found. Warnings do not trigger a failure.\n\n### Exceptions \u0026 Overrides\n\nWhen [stoplightio/spectral#747](https://github.com/stoplightio/spectral/issues/747) gets fixed you will be able to provide individual exceptions on a case-by-case basis.\n\nTo disable an entire rule, e.g. to support a legacy API, you can provide your own `.spectral.yaml` file in the root of your repo which sets some rules to `false`. Note that this disables the rule for the _entire file_:\n\n```yaml\nrules:\n  iso8601: false\n  server-version: false\n```\n\nIt's also possible to set it to `warn` or `info`.\n\nThe `extends` field is automatically added (or appended to) by the linter script to inject the iSP ruleset into your config.\n\n### Local Development\n\n1. Install `node 13.14.0` locally.\n2. Run `npm run build` to compile the `isp-functions`.\n3. Run `node ./entrypoint.js \u003cPATH_TO_OPENAPI_SPEC\u003e` to run the linter.\n\nThe `build` command may need to be re-run to pick up changes made to some of the `isp-functions`.\n\n#### Tests\n\n```sh\n# Compile the isp-functions\nnpm run build\n\n# Run test\nnpm run test\n```\n\n## License\n\nCopyright © 2020 iStreamPlanet Co., LLC\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fistreamlabs%2Frest-api-lint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fistreamlabs%2Frest-api-lint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fistreamlabs%2Frest-api-lint/lists"}