Skip to content

Commit

Permalink
add github action to lint with redocly
Browse files Browse the repository at this point in the history
  • Loading branch information
yurisasuke committed Apr 19, 2024
1 parent 4717967 commit ba2a4e2
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/test-swagger-with-redocly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
on:
pull_request:
branches:
- master
- release-**
- document-process-to-generate-the-oas

jobs:
test_swagger_editor_validator_remote:
runs-on: redocly/cli
name: Validate the swagger with redocly

steps:
- uses: actions/checkout@v2
- name: Validate OpenAPI definition with redocly
55 changes: 55 additions & 0 deletions tyk-api-documentation/redocly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
rules:
#Special rules
no-unresolved-refs: error
no-unused-components: warn
security-defined: error
spec: error
spec-components-invalid-map-name: error #All the fixed fields declared below are objects that MUST use keys that match the regular expression
spec-strict-refs: error
#info
info-contact: warn
info-license: warn
info-license-url: warn
#Operations
operation-operationId: error
operation-operationId-unique: error
operation-operationId-url-safe: error
operation-summary: error
operation-2xx-response: error
operation-4xx-response: error
operation-description: error
#Parameters
no-invalid-parameter-examples:
severity: error
allowAdditionalProperties: false
operation-parameters-unique: error
parameter-description: error #uncomment this
path-declaration-must-exist: error
path-parameters-defined: error
#path rules
no-ambiguous-paths: error
no-http-verbs-in-paths:
severity: warn
splitIntoWords: true
no-identical-paths: error
no-path-trailing-slash: error

#Requests, Responses, and Schemas rules
no-enum-type-mismatch: error
no-example-value-and-externalValue: error
no-invalid-media-type-examples:
severity: error
allowAdditionalProperties: false
scalar-property-missing-example:
severity: warn
no-invalid-schema-examples:
severity: error
allowAdditionalProperties: false
#Server rules
no-empty-servers: error
no-server-trailing-slash: error
no-undefined-server-variable: error
#Tags rules
operation-singular-tag: error
operation-tag-defined: error

0 comments on commit ba2a4e2

Please sign in to comment.