{ "rules": { "info-title": { "description": "The API must have a title.", "given": "$.info", "severity": "error", "recommended": true, "type": "style", "formats": ["oas3"], "then": {"field":"title","function":"truthy"} } , "info-title-max-length": { "description": "The title of the API must not be more than 50 characters.", "given": "$.info", "severity": "error", "recommended": true, "type": "style", "formats": ["oas3"], "then": {"field":"title","function":"length","functionOptions":{"max":50}} } , "info-title-word-check": { "description": "The title of the API must not contain specific words, including REST, Public, and Developer.", "given": "$.info.title", "severity": "error", "recommended": true, "type": "style", "formats": ["oas3"], "then": {"function":"pattern","functionOptions":{"notMatch":"\\b(REST|Public|Developer)\\b"}} } , "info-title-in-kebab-case": { "given": "$.info.title", "then": {"function":"pattern","functionOptions":{"match":"^[a-z][a-z0-9\\-]*$"}}, "type": "style", "recommended": true, "formats": ["oas2","oas3"], "message": "Error in the format of the api title", "description": "The title of the API must be in kebab case.", "severity": "error" } , "info-summary": { "description": "The API must have a summary applied.", "given": "$.info", "severity": "error", "recommended": true, "type": "style", "formats": ["oas3"], "then": {"field":"summary","function":"truthy"} } , "info-summary-max-length": { "description": "The summary for the API should not be more than 50 characters in length.", "given": "$.info", "severity": "error", "recommended": true, "type": "style", "formats": ["oas3"], "then": {"field":"summary","function":"length","functionOptions":{"max":50}} } , "info-summary-word-check": { "description": "The API summary not contain specific words, including REST, Public, and Developer.", "given": "$.info.summary", "severity": "error", "recommended": true, "type": "style", "formats": ["oas3"], "then": {"function":"pattern","functionOptions":{"notMatch":"\\b(REST|Public|Developer)\\b"}} } , "info-description": { "description": "API must have a description available.", "given": "$.info", "severity": "error", "recommended": true, "type": "style", "formats": ["oas3"], "then": {"field":"description","function":"truthy"} } , "info-description-max-length": { "description": "The description of the API must not be greater than 250 characters.", "given": "$.info", "severity": "error", "recommended": true, "type": "style", "formats": ["oas3"], "then": {"field":"description","function":"length","functionOptions":{"max":250}} } , "info-description-word-check": { "description": "The API description must not contain specific words, including REST, Public, and Developer.", "given": "$.info.description", "severity": "error", "recommended": true, "type": "style", "formats": ["oas3"], "then": {"function":"pattern","functionOptions":{"notMatch":"\\b(REST|Public|Developer)\\b"}} } , "info-contact": { "description": "API must have a contact information available.", "given": "$.info", "severity": "error", "recommended": true, "type": "style", "formats": ["oas3"], "then": {"field":"contact","function":"truthy"} } , "info-contact-name": { "description": "API must have a contact name available.", "given": "$.info.contact", "severity": "error", "then": {"field":"name","function":"truthy"} } , "info-contact-email": { "description": "API must have a contact email available.", "given": "$.info.contact", "severity": "error", "then": {"field":"email","function":"truthy"} } , "info-contact-url": { "description": "API must have a contact url available.", "given": "$.info.contact", "severity": "error", "then": {"field":"url","function":"truthy"} } , "info-license": { "description": "API must have a license applied.", "given": "$.info", "severity": "error", "recommended": true, "type": "style", "formats": ["oas3"], "then": {"field":"license","function":"truthy"} } , "info-license-name": { "description": "API must have a license name applied.", "given": "$.info.license", "severity": "error", "then": {"field":"name","function":"truthy"} } , "info-license-url": { "description": "API must have a license url applied.", "given": "$.info.license", "severity": "error", "then": {"field":"url","function":"truthy"} } , "info-terms-of-service": { "description": "The API must have a terms of service applied.", "given": "$.info", "severity": "error", "recommended": true, "type": "style", "formats": ["oas3"], "then": {"field":"termsOfService","function":"truthy"} } , "info-version": { "description": "The API must have version information applied.", "given": "$.info", "severity": "error", "recommended": true, "type": "style", "formats": ["oas3"], "then": {"field":"version","function":"truthy"} } , "paths-trailing-slash": { "message": "Path with trailing slash is not allowed", "description": "All paths must end with a trailing slash.", "documentationUrl": "https://opensource.zalando.com/restful-api-guidelines/#136", "severity": "error", "given": "$.paths.*~", "then": {"function":"pattern","functionOptions":{"match":"/$"}} } , "paths-no-empty": { "message": "Empty path segments are not allowed", "description": "There should be no empty path segments.", "documentationUrl": "https://opensource.zalando.com/restful-api-guidelines/#136", "severity": "error", "given": "$.paths.*~", "then": {"function":"pattern","functionOptions":{"notMatch":"//"}} } , "operations-description": { "severity": "error", "message": "Missing {{property}} at {{path}}.", "given": "$.paths.*[get,post,patch,put,delete]", "then": [{"field":"description","function":"truthy"}] } , "operations-description-length": { "description": "Operation description should be short and sweet, no full stops, and less than 20 characters", "given": "$.paths.*[get,post,patch,put,delete]", "recommended": true, "then": [{"field":"description","function":"length","functionOptions":{"max":20}}], "type": "style" } , "operations-description-words-check": { "description": "Must not contain specific words, including REST, Public, and Developer.", "given": "$.paths.*[get,post,patch,put,delete].description", "recommended": true, "then": {"function":"pattern","functionOptions":{"notMatch":"\\b(word|word|word)\\b"}}, "type": "style" } , "operations-summary": { "severity": "error", "message": "Missing {{property}} at {{path}}.", "given": "$.paths.*[get,post,patch,put,delete]", "then": [{"field":"summary","function":"truthy"}] } , "operations-summary-length": { "description": "Operation summary should be short and sweet, no full stops, and less than 20 characters", "given": "$.paths.*[get,post,patch,put,delete]", "recommended": true, "then": [{"field":"summary","function":"length","functionOptions":{"max":20}}], "type": "style" } , "operations-summary-words-check": { "description": "Must not contain specific words, including REST, Public, and Developer.", "given": "$.paths.*[get,post,patch,put,delete].summary", "recommended": true, "then": {"function":"pattern","functionOptions":{"notMatch":"\\b(word|word|word)\\b"}}, "type": "style" } , "operations-tags": { "severity": "error", "description": "Operation must have tags.", "message": "Missing {{property}} at {{path}}.", "given": "$.paths.*[get,post,patch,put,delete]", "then": [{"field":"tags","function":"truthy"}] } , "operations-tags-one": { "description": "Must have at least one tag.", "given": "$", "severity": "error", "then": {"field":"tags","function":"length","functionOptions":{"min":1}}, "type": "style" } , "parameters-name": { "description": "Must not contain specific words, including REST, Public, and Developer.", "given": "$.paths.*.*.parameters[?(@.in=='query')]", "then": {"field":"name","function":"truthy"} } , "parameters-name-length": { "description": "The name can't be more than 20 characters.", "given": "$.paths.*.*.parameters[?(@.in=='query')].name", "then": {"field":"summary","function":"length","functionOptions":{"max":20}} } , "parameters-name-word-check": { "description": "Must not contain specific words, including REST, Public, and Developer.", "given": "$.paths.*.*.parameters[?(@.in=='query')].name", "then": {"function":"pattern","functionOptions":{"notMatch":"\\b(word|word|word)\\b"}} } , "parameters-description": { "description": "Must not contain specific words, including REST, Public, and Developer.", "given": "$.paths.*.*.parameters[?(@.in=='query')]", "then": {"field":"description","function":"truthy"} } , "parameters-description-length": { "description": "The description can't be more than 20 characters.", "given": "$.paths.*.*.parameters[?(@.in=='query')].description", "then": {"field":"summary","function":"length","functionOptions":{"max":20}} } , "parameters-description-word-check": { "description": "Must not contain specific words, including REST, Public, and Developer.", "given": "$.paths.*.*.parameters[?(@.in=='query')].description", "then": {"function":"pattern","functionOptions":{"notMatch":"\\b(word|word|word)\\b"}} } , "parameters-in": { "description": "Parameters must have an in.", "given": "$.paths.*.*.parameters[?(@.in=='query')]", "then": {"field":"in","function":"truthy"} } , "parameters-example": { "description": "Parameters must have a example.", "given": "$.paths.*.*.parameters[?(@.example=='query')]", "then": [{"field":"example","function":"truthy"},{"field":"examples","function":"truthy"}] } , "parameters-schema": { "description": "Parameters must have a schema.", "given": "$.paths.*.*.parameters[?(@.schema=='query')]", "then": {"field":"schema","function":"truthy"} } , "parameters-schema-type": { "description": "Parameters must have a schema.", "given": "$.paths.*.*.parameters[?(@.schema=='query')].schema", "then": {"field":"type","function":"truthy"} } , "request-bodies-get-oas3": { "description": "GET methods must have a request body.", "given": "$.paths.*.get", "message": "Method must not have a request body {{path}}", "recommended": true, "severity": "error", "then": {"field":"requestBody","function":"falsy"} } , "request-bodies-post-oas3": { "description": "POST methods must have a request body.", "given": "$.paths.*.post", "message": "Method must have a request body {{path}}", "recommended": true, "severity": "error", "then": {"field":"requestBody","function":"truthy"} } , "request-bodies-post-media-type-oas3": { "description": "POST request bodies must have a application/json media type.", "given": "$.paths.*.post[requestBody].content", "message": "application/json is required for POST requests {{path}}", "recommended": true, "severity": "error", "then": {"field":"application/json","function":"truthy"} } , "request-bodies-patch-oas3": { "description": "PATCH methods must have a request body.", "given": "$.paths.*.patch", "message": "Method must have a request body {{path}}", "recommended": true, "severity": "error", "then": {"field":"requestBody","function":"truthy"} } , "request-bodies-patch-media-type-oas3": { "description": "PATCH request bodies must have a application/json media type.", "given": "$.paths.*.patch[requestBody].content", "message": "application/json is required for PATCH requests {{path}}", "recommended": true, "severity": "error", "then": {"field":"application/json","function":"truthy"} } , "request-bodies-put-oas3": { "description": "PUT methods must have a request body.", "given": "$.paths.*.put", "message": "Method must have a request body {{path}}", "recommended": true, "severity": "error", "then": {"field":"requestBody","function":"truthy"} } , "request-bodies-put-media-type-oas3": { "description": "PUT request bodies must have a application/json media type.", "given": "$.paths.*.put[requestBody].content", "message": "application/json is required for PUT requests {{path}}", "recommended": true, "severity": "error", "then": {"field":"application/json","function":"truthy"} } , "request-bodies-delete-oas3": { "description": "DELETE methods must have a request body.", "given": "$.paths.*.delete", "message": "Method must not have a request body {{path}}", "recommended": true, "severity": "error", "then": {"field":"requestBody","function":"falsy"} } , "response-get-200-status-code": { "description": "A get operation should have a 200 response.", "message": "A GET operation should have a 200 response.", "severity": "warn", "formats": ["oas2","oas3"], "given": "$.paths[*].get.responses", "then": {"field":"200","function":"truthy"} } , "response-get-200-media-type": { "severity": "error", "description": "GET responses should not have body.", "given": "$paths.get.responses.200.content", "then": {"field":"application/json","function":"truthy"} } , "response-get-200-no-body": { "severity": "error", "description": "GET responses should not have body.", "given": "$paths.get.responses.200.content", "then": {"field":"application/json","function":"truthy"} } , "response-get-500-status-code": { "description": "A get operation should have a 500 response.", "message": "A GET operation should have a 500 response.", "severity": "warn", "formats": ["oas2","oas3"], "given": "$.paths[*].get.responses", "then": {"field":"500","function":"truthy"} } , "response-get-500-media-type": { "severity": "error", "description": "GET responses should have a 500 with Problem JSON media type.", "given": "$paths.get.responses.500.content", "then": {"field":"application/problem+json","function":"truthy"} } , "response-post-201-status-code": { "description": "A post operation should have a 201 response.", "message": "A POST operation should have a 201 response.", "severity": "warn", "formats": ["oas3"], "given": "$.paths[*].post.responses", "then": {"field":"201","function":"truthy"} } , "response-post-201-media-type": { "severity": "error", "description": "POST responses should have a JSON body.", "given": "$paths.post.responses.201.content", "then": {"field":"application/json","function":"truthy"} } , "response-post-500-status-code": { "description": "A post operation should have a 500 response.", "message": "A POST operation should have a 500 response.", "severity": "warn", "formats": ["oas2","oas3"], "given": "$.paths[*].post.responses", "then": {"field":"500","function":"truthy"} } , "response-post-500-media-type": { "severity": "error", "description": "POST responses should have a 500 with Problem JSON media type.", "given": "$paths.post.responses.500.content", "then": {"field":"application/problem+json","function":"truthy"} } , "response-put-204-status-code": { "description": "A put operation should have a 204 response.", "message": "A put operation should have a 204 response.", "severity": "warn", "formats": ["oas2","oas3"], "given": "$.paths[*].delete.responses", "then": {"field":"204","function":"truthy"} } , "response-put-204-no-body": { "severity": "error", "description": "PUT responses should not have body.", "given": "$paths.put.responses.204", "then": {"field":"content","function":"truthy"} } , "response-put-500-status-code": { "description": "A put operation should have a 500 response.", "message": "A PUT operation should have a 500 response.", "severity": "warn", "formats": ["oas2","oas3"], "given": "$.paths[*].put.responses", "then": {"field":"500","function":"truthy"} } , "response-put-500-media-type": { "severity": "error", "description": "PUT responses should have a 500 with Problem JSON media type.", "given": "$paths.put.responses.500.content", "then": {"field":"application/problem+json","function":"truthy"} } , "response-delete-204-status-code": { "description": "A delete operation should have a 204 response.", "message": "A delete operation should have a 204 response.", "severity": "warn", "formats": ["oas2","oas3"], "given": "$.paths[*].delete.responses", "then": {"field":"204","function":"truthy"} } , "response-delete-204-no-body": { "severity": "error", "description": "DELETE responses should not have body.", "given": "$paths.delete.responses.204", "then": {"field":"cont3ent","function":"truthy"} } , "response-delete-500-status-code": { "description": "A delete operation should have a 500 response.", "message": "A DELETE operation should have a 500 response.", "severity": "warn", "formats": ["oas2","oas3"], "given": "$.paths[*].delete.responses", "then": {"field":"500","function":"truthy"} } , "response-delete-500-media-type": { "severity": "error", "description": "DELETE responses should have a 500 with Problem JSON media type.", "given": "$paths.delete.responses.500.content", "then": {"field":"application/problem+json","function":"truthy"} } , "schema-names-length": { "description": "Schema names should be no more than 10 characters.", "message": "Should be less than 10 characters {{ property }}.", "severity": "error", "given": "$.components.schemas", "then": {"field":"@key","function":"length","functionOptions":{"max":20}} } , "schema-names-words": { "description": "Schema names should not contain certain words.", "message": "Should not contains certain words {{ parameter }}.", "severity": "error", "given": "$.components.schemas", "then": {"field":"@key","function":"pattern","functionOptions":{"notMatch":"\\b(word|word|word)\\b"}} } , "schema-description": { "description": "All schemas properties should have a description.", "message": "Should have schema property {{ property }}.", "severity": "warn", "formats": ["oas3"], "given": "$.components.schemas.*", "then": {"field":"description","function":"truthy"} } , "schema-description-length": { "description": "All schemas descriptions should be shorter than 20 characters.", "message": "Description needs to be less than 20 characters {{ property }}.", "severity": "warn", "formats": ["oas3"], "given": "$.components.schemas.*", "then": {"field":"description","function":"length","functionOptions":{"max":20}} } , "schema-description-words": { "description": "Some words should not be be contained within the schema description.", "message": "Words should not be contained within description {{ property }}.", "severity": "warn", "formats": ["oas3"], "given": "$.components.schemas.*", "then": {"field":"description","function":"pattern","functionOptions":{"notMatch":"\\b(word|word|word)\\b"}} } , "schema-required": { "description": "All schemas properties should have a required.", "message": "Should have schema property {{ property }}.", "severity": "warn", "formats": ["oas3"], "given": "$.components.schemas.*", "then": {"field":"required","function":"truthy"} } , "schema-type": { "description": "All schemas should have a type.", "message": "Should have schema {{ property }}.", "severity": "error", "formats": ["oas3"], "given": "$.components.schemas.*", "then": {"field":"type","function":"truthy"} } , "schema-properties": { "description": "All schemas should have a properties.", "message": "Should have schema properties {{ property }}.", "severity": "error", "formats": ["oas3"], "given": "$.components.schemas.*", "then": {"field":"properties","function":"truthy"} } , "schema-properties-type": { "description": "All schemas properties should have a type.", "message": "Should have schema property {{ property }}.", "severity": "warn", "formats": ["oas3"], "given": "$..properties.*", "then": {"field":"type","function":"truthy"} } , "schema-properties-descriptions": { "description": "All schemas properties should have a description.", "message": "Should have schema property {{ property }}.", "severity": "warn", "formats": ["oas3"], "given": "$..properties.*", "then": {"field":"description","function":"truthy"} } , "schema-properties-descriptions-length": { "description": "The length of the description needs to be lest than 20 characters.", "message": "The description length needs to be less than 20 characters {{ property }}.", "severity": "warn", "formats": ["oas3"], "given": "$..properties.*", "then": {"field":"description","function":"length","functionOptions":{"max":20}} } , "schema-properties-descriptions-words": { "description": "Some words should not exist within the property description.", "message": "Words should not exist within description {{ property }}.", "severity": "warn", "formats": ["oas3"], "given": "$..properties.*", "then": {"field":"description","function":"pattern","functionOptions":{"notMatch":"\\b(word|word|word)\\b"}} } , "schema-properties-maximum": { "description": "All schemas properties should have a maximum.", "message": "Should have schema property {{ property }}.", "severity": "warn", "formats": ["oas3"], "given": "$..properties.*", "then": {"field":"maximum","function":"truthy"} } , "schema-properties-minimum": { "description": "All schemas properties should have a minimum.", "message": "Should have schema property {{ property }}.", "severity": "warn", "formats": ["oas3"], "given": "$..properties.*", "then": {"field":"minimum","function":"truthy"} } , "tags-object": { "description": "Must have tags object.", "given": "$", "severity": "error", "then": {"field":"tags","function":"truthy"} } , "tags-one": { "description": "Must have at least one tag.", "given": "$", "severity": "error", "then": {"field":"tags","function":"length","functionOptions":{"min":1}}, "type": "style" } , "tags-name": { "description": "Tags must have a name.", "given": "$.tags[*]", "severity": "error", "then": {"field":"name","function":"truthy"} } , "tags-description": { "description": "Tags must have a description.", "given": "$.tags[*]", "severity": "error", "then": {"field":"description","function":"truthy"} } }}