mirror of
https://github.com/adidas/api-guidelines.git
synced 2025-10-25 15:19:19 +00:00
Add placeholders for spectral rules
This commit is contained in:
47
spectral.yml
Normal file
47
spectral.yml
Normal file
@@ -0,0 +1,47 @@
|
||||
extends: [[spectral:oas2, off]]
|
||||
rules:
|
||||
fields-camelCase:
|
||||
description: All YAML and JSON fields must follow fields-camelCase
|
||||
given: $.paths[*]
|
||||
then:
|
||||
function:
|
||||
fields-alphanumeric:
|
||||
description: Field names MUST be ASCII alphanumeric characters or `_` or `$`
|
||||
fields-collections-plural:
|
||||
description: Collection/array fields MUST have names in plural
|
||||
protocol-https:
|
||||
description: All requests go through `https` protocol
|
||||
response-2xx-obligatory:
|
||||
description: Every API operation MUST have at least one `2xx` response
|
||||
request-GET-no-body:
|
||||
description: A `GET` request MUST NOT accept a `body` parameter
|
||||
response-success-hal:
|
||||
description: All success responses MUST be of media type `application/hal+json`
|
||||
response-error-problem:
|
||||
description: All error responses MUST be of media type `application/problem+json`
|
||||
request-support-json:
|
||||
description: Every request SHOULD support `application/json` media type
|
||||
mediatype-hal-correctness:
|
||||
description: Mediatype `application/hal+json` follows https://supermodel.io/adidas/api/HAL `JSON-Schema`
|
||||
mediatype-problem-title:
|
||||
description: All `application/problem+json` messages MUST include `title` field
|
||||
mediatype-problem-detail:
|
||||
description: All `application/problem+json` messages MUST include `detail` field
|
||||
mediatype-problem-type:
|
||||
description: All `application/problem+json` messages SHOULD include `type` field
|
||||
fields-date-iso8601:
|
||||
description: Date and time MUST follow [`ISO 8601` standard](https://www.iso.org/iso-8601-date-and-time-format.html)
|
||||
fields-language-iso639:
|
||||
description: Language codes MUST follow [`ISO 639` standard](https://www.iso.org/iso-639-language-codes.html)
|
||||
fields-country-iso3166:
|
||||
description: Country codes MUST follow [`ISO 3166 alpha-2` standard](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
|
||||
fields-currency-iso4217:
|
||||
description: Currency codes MUST follow [`ISO 4217` standard](https://en.wikipedia.org/wiki/ISO_4217)
|
||||
response-303-async-link-header:
|
||||
description: A successful and finished async api request returns `303` response code and sends the target resource location in the `Link` header
|
||||
uri-template-cannot-dash:
|
||||
description: The `URI` template ([RFC 6570](https://tools.ietf.org/html/rfc6570)) cannot contain a `-` character
|
||||
headers-hyphenated-pascal-case:
|
||||
description: All `HTTP` headers MUST use `Hyphenated-Pascal-Case` notation
|
||||
heders-no-x-headers:
|
||||
description: All `HTTP` headers SHOULD NOT include `X-` headers (https://tools.ietf.org/html/rfc6648). All non-standard headers are named without the `X-` prefix.
|
||||
Reference in New Issue
Block a user