Merge pull request #21 from adidas/ruleset

Add ruleset extracted from the guidelines
This commit is contained in:
Andrzej
2019-08-20 23:24:25 +02:00
committed by GitHub

23
ruleset.md Normal file
View File

@@ -0,0 +1,23 @@
# Adidas API Guidelines Ruleset
- all JSON fields MUST follow `camelCase`
- field names MUST be ASCII alphanumeric characters or `_` or `$`
- collection/array fields MUST have names in plural
- all requests go through `https` protocol
- every API operation MUST have at least one `2xx` response
- `GET` request MUST NOT accept a `body` parameter
- all success responses MUST be of media type `application/hal+json`
- all error responses MUST be of media type `application/problem+json`
- every request SHOULD support `application/json` media type
- `application/hal+json` follows https://supermodel.io/adidas/api/HAL `JSON-Schema`
- `application/problem+json` messages MUST include `title` and `detail` fields
- `application/problem+json` messages SHOULD include `type` field
- date and time MUST follow `ISO 8601` standard: https://www.iso.org/iso-8601-date-and-time-format.html
- language codes MUST follow `ISO 639` standard: https://www.iso.org/iso-639-language-codes.html
- country codes MUST follow `ISO 3166 alpha-2` standard: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
- currency codes MUST follow `ISO 4217` standard: https://en.wikipedia.org/wiki/ISO_4217
- `202` response code is used after creating an asynchronous process request
- a successful and finished async api request returns `303` response code and sends the target resource location in the `Link` header
- `URI` template ([RFC 6570](https://tools.ietf.org/html/rfc6570)) cannot contain a `-` character
- `HTTP` headers MUST use `Hyphenated-Pascal-Case` notation
- `HTTP` headers SHOULD NOT include `X-` headers (https://tools.ietf.org/html/rfc6648). All non-standard headers are named without the `X-` prefix.