Skip to content

Commit

Permalink
refactor(openapi): extend validation suite
Browse files Browse the repository at this point in the history
  • Loading branch information
mvegter authored May 10, 2020
2 parents b61ff4e + 3c66898 commit f5cfc89
Show file tree
Hide file tree
Showing 6 changed files with 2,114 additions and 55 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,23 @@ jobs:
runs-on: ubuntu-18.04
timeout-minutes: 5

steps:
- uses: actions/checkout@v2
- name: Use Node.js 12.16.1
uses: actions/setup-node@v1
with:
node-version: '12.16.1'
- name: Running validator
run: npx @openapitools/openapi-generator-cli validate -i spec/openapi.yaml
- name: Running validator
run: |
npm ci
npm run openapi:validate
breaking:
runs-on: ubuntu-18.04
timeout-minutes: 5

steps:
- name: Check out head branch
uses: actions/checkout@v2
Expand Down
103 changes: 103 additions & 0 deletions .validaterc
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
{
"shared": {
"operations": {
"no_operation_id": "error",
"operation_id_case_convention": [
"error",
"lower_camel_case"
],
"no_summary": "error",
"no_array_responses": "error",
"parameter_order": "error",
"unused_tag": "error",
"operation_id_naming_convention": "error"
},
"pagination": {
"pagination_style": "error"
},
"parameters": {
"no_parameter_description": "error",
"param_name_case_convention": [
"error",
"lower_snake_case"
],
"invalid_type_format_pair": "error",
"content_type_parameter": "error",
"accept_type_parameter": "error",
"authorization_parameter": "error",
"required_param_has_default": "error"
},
"paths": {
"missing_path_parameter": "error",
"duplicate_path_parameter": "error",
"snake_case_only": "error",
"paths_case_convention": [
"error",
"lower_snake_case"
]
},
"responses": {
"inline_response_schema": "error"
},
"security_definitions": {
"unused_security_schemes": "error",
"unused_security_scopes": "error"
},
"security": {
"invalid_non_empty_security_array": "error"
},
"schemas": {
"invalid_type_format_pair": "error",
"snake_case_only": "error",
"no_schema_description": "warning",
"no_property_description": "warning",
"description_mentions_json": "error",
"array_of_arrays": "error",
"inconsistent_property_type": "error",
"property_case_convention": [
"error",
"lower_snake_case"
],
"property_case_collision": "error",
"enum_case_convention": [
"error",
"lower_snake_case"
]
},
"walker": {
"no_empty_descriptions": "error",
"has_circular_references": "error",
"$ref_siblings": "error",
"duplicate_sibling_description": "error",
"incorrect_ref_pattern": "error"
}
},
"swagger2": {
"operations": {
"no_consumes_for_put_or_post": "error",
"get_op_has_consumes": "error",
"no_produces": "error"
}
},
"oas3": {
"operations": {
"no_request_body_content": "error",
"no_request_body_name": "error"
},
"parameters": {
"no_in_property": "error",
"invalid_in_property": "error",
"missing_schema_or_content": "error",
"has_schema_and_content": "error"
},
"responses": {
"no_response_codes": "error",
"no_success_response_codes": "error",
"no_response_body": "error",
"ibm_status_code_guidelines": "error"
},
"schemas": {
"json_or_param_binary_string": "error"
}
}
}
Loading

0 comments on commit f5cfc89

Please sign in to comment.