# Amazon FreeRTOS Spectral Rules extends: spectral:oas rules: freertos-info-contact: description: API must include contact information severity: warn given: "$.info" then: field: contact function: truthy freertos-info-description: description: API must have a description severity: error given: "$.info" then: field: description function: truthy freertos-server-https: description: Server URLs must use HTTPS severity: error given: "$.servers[*].url" then: function: pattern functionOptions: match: "^https://" freertos-operation-summary: description: Operations must have a summary severity: error given: "$.paths[*][get,post,put,patch,delete]" then: field: summary function: truthy freertos-operation-description: description: Operations should have a description severity: warn given: "$.paths[*][get,post,put,patch,delete]" then: field: description function: truthy freertos-operation-tags: description: Operations must have at least one tag severity: error given: "$.paths[*][get,post,put,patch,delete]" then: field: tags function: truthy freertos-operation-id: description: Operations must have operationId severity: error given: "$.paths[*][get,post,put,patch,delete]" then: field: operationId function: truthy freertos-operation-id-camel-case: description: operationId should use camelCase severity: warn given: "$.paths[*][get,post,put,patch,delete].operationId" then: function: pattern functionOptions: match: "^[a-z][a-zA-Z0-9]*$" freertos-response-200: description: POST operations should define 200 response severity: warn given: "$.paths[*][post]" then: field: responses.200 function: truthy freertos-response-400: description: Operations should define 400 response severity: warn given: "$.paths[*][get,post,put,patch,delete]" then: field: responses.400 function: truthy freertos-response-500: description: Operations should define 500 response severity: warn given: "$.paths[*][get,post,put,patch,delete]" then: field: responses.500 function: truthy freertos-response-404: description: Resource-by-ID operations should define 404 severity: warn given: "$.paths[*~'\\{[^}]+\\}'][get,put,patch,delete].responses" then: field: "404" function: truthy freertos-delete-204: description: DELETE operations should return 204 severity: info given: "$.paths[*].delete" then: field: responses.204 function: truthy freertos-parameter-description: description: Parameters must have descriptions severity: error given: "$.paths[*][get,post,put,patch,delete].parameters[*]" then: field: description function: truthy freertos-path-param-required: description: Path parameters must be required severity: error given: "$.paths[*][get,post,put,patch,delete].parameters[?(@.in=='path')]" then: field: required function: truthy freertos-schema-description: description: Schema components should have descriptions severity: warn given: "$.components.schemas[*]" then: field: description function: truthy freertos-tags-title-case: description: Operation tags should use Title Case severity: warn given: "$.paths[*][*].tags[*]" then: function: pattern functionOptions: match: "^[A-Z][a-zA-Z0-9 ]*$" freertos-ota-targets-required: description: OTA update schema must require targets severity: warn given: "$.components.schemas.OtaUpdate.required" then: function: schema functionOptions: schema: type: array contains: const: targets freertos-ota-status-enum: description: OTA update status should define enum values severity: warn given: "$.components.schemas.OtaUpdate.properties.otaUpdateStatus" then: field: enum function: truthy freertos-sw-config-hardware-platform: description: Software configuration must document hardware platform severity: warn given: "$.components.schemas.SoftwareConfiguration.required" then: function: schema functionOptions: schema: type: array contains: const: hardwarePlatform freertos-create-prefix: description: POST creation operationIds should start with 'create' severity: warn given: "$.paths[*].post.operationId" then: function: pattern functionOptions: match: "^(create|list|tag|get|describe)" freertos-list-prefix: description: Collection GET operationIds should start with 'list' severity: warn given: "$.paths[*~'[^}]$'].get.operationId" then: function: pattern functionOptions: match: "^list" freertos-schema-properties: description: Object schemas should define properties severity: warn given: "$.components.schemas[?(@.type=='object')]" then: field: properties function: truthy freertos-request-body-json: description: POST/PUT request bodies should define application/json severity: warn given: "$.paths[*][post,put].requestBody.content" then: function: schema functionOptions: schema: type: object required: ["application/json"] freertos-ota-protocols-documented: description: OTA update create request should document protocols severity: info given: "$.components.schemas.CreateOtaUpdateRequest.properties" then: field: protocols function: truthy