Skip to content

feat: validate OpenAPI YAML #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 6, 2020
Merged

feat: validate OpenAPI YAML #10

merged 1 commit into from
Jul 6, 2020

Conversation

lidel
Copy link
Member

@lidel lidel commented Jul 6, 2020

Aims to close #3 by adding relevant Github Action.

Uses spectral OAS linter via https://github.com/github/super-linter

Sample output (with some manually created errors):

Linting [OPENAPI] files...
----------------------------------------------
----------------------------------------------
---------------------------
File:[/github/workspace/ipfs-pinning-service.yaml]
ERROR! Found errors in [spectral] linter!
ERROR:[OpenAPI 3.x detected

/github/workspace/ipfs-pinning-service.yaml
   1:1   warning  openapi-tags                   OpenAPI object should have non-empty `tags` array.
   2:6   warning  info-contact                   Info object should contain `contact` object.
  33:9   warning  operation-operationId          Operation should have an `operationId`.
  36:11  warning  operation-tag-defined          Operation tags should be defined in global tags.
  48:17    error  invalid-ref                    '#/components/responses/BadRequest' does not exist
  50:17    error  invalid-ref                    '#/components/responses/InternalServerError' does not exist
  51:10  warning  operation-operationId          Operation should have an `operationId`.
  54:11  warning  operation-tag-defined          Operation tags should be defined in global tags.
  63:23    error  invalid-ref                    '#/components/schemas/Pin' does not exist
  70:17    error  invalid-ref                    '#/components/responses/Unauthorized' does not exist
  72:17    error  invalid-ref                    '#/components/responses/NotFound' does not exist
  74:17    error  invalid-ref                    '#/components/responses/InsufficientFunds' does not exist
  85:9   warning  operation-operationId          Operation should have an `operationId`.
  88:11  warning  operation-tag-defined          Operation tags should be defined in global tags.
 104:10  warning  operation-operationId          Operation should have an `operationId`.
 106:17    error  invalid-ref                    '#/components/parameters/pinReplicationParam' does not exist
 107:17    error  invalid-ref                    '#/components/parameters/pinMetaParam' does not exist
 110:11  warning  operation-tag-defined          Operation tags should be defined in global tags.
 125:12  warning  operation-operationId          Operation should have an `operationId`.
 128:11  warning  operation-tag-defined          Operation tags should be defined in global tags.
 144:11  warning  oas3-unused-components-schema  Potentially unused components schema has been detected.
  152:9  warning  oas3-unused-components-schema  Potentially unused components schema has been detected.
 158:14  warning  oas3-unused-components-schema  Potentially unused components schema has been detected.
 163:23  warning  oas3-unused-components-schema  Potentially unused components schema has been detected.

✖ 24 problems (8 errors, 16 warnings, 0 infos, 0 hints)]

----------------------------------------------
----------------------------------------------
The script has completed

@lidel lidel force-pushed the feat/linter branch 3 times, most recently from 7373c75 to fb28c42 Compare July 6, 2020 18:12
@lidel lidel requested a review from jacobheun July 6, 2020 18:27
@lidel lidel marked this pull request as ready for review July 6, 2020 18:27
@lidel lidel changed the title feat: spectral OAS linter feat: OpenAPI linter Jul 6, 2020
@lidel lidel added the topic/devexp Developer experience related things label Jul 6, 2020
@lidel
Copy link
Member Author

lidel commented Jul 6, 2020

All green.
I'm merging this, so we have more confidence in accepting PRs from the community.

@lidel lidel changed the title feat: OpenAPI linter feat: validate OpenAPI YAML Jul 6, 2020
@lidel lidel merged commit 4ac7b4e into master Jul 6, 2020
@lidel lidel deleted the feat/linter branch July 6, 2020 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/devexp Developer experience related things
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validate ipfs-pinning-service.yaml in PRs
1 participant