Skip to content

Commit d10e8a9

Browse files
Merge pull request #42 from adidas/changes/API-165
application/problem+json added as possible media type in successful responses
2 parents d34423f + ea37ea9 commit d10e8a9

24 files changed

+626
-668
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,5 @@ dist
105105

106106
# SSHFS
107107
._*
108+
109+
.DS_Store

.spectral.yml

+20-4
Original file line numberDiff line numberDiff line change
@@ -244,24 +244,40 @@ rules:
244244
match: "/^https:/"
245245

246246
adidas-oas3-response-success-hal:
247-
description: "All success responses MUST be of media type `application/hal+json`"
247+
description: "All success responses MUST be of media type `application/hal+json` "
248248
severity: error
249-
given: $.paths..responses[?( @property >= 200 && @property < 300 && @property != 204)].content[*]~
249+
given: $.paths..responses[?( @property >= 201 && @property < 300 && @property != 204)].content[*]~
250250
recommended: true
251251
# type: "style"
252252
formats:
253253
- oas3
254-
message: "Response documents MUST be of application/hal+json media type: {{error}}"
254+
message: "Response documents MUST be of application/hal+json media types: {{error}}"
255+
then:
256+
function: enumeration
257+
functionOptions:
258+
values:
259+
- application/hal+json
260+
261+
# sync and async patterns that can return hal OR problem+json
262+
adidas-oas3-response-success-OK:
263+
description: "All success responses MUST be of media type `application/hal+json` or `application/problem+json`"
264+
severity: error
265+
given: $.paths..responses[?( @property == 200 )].content[*]~
266+
recommended: true
267+
formats:
268+
- oas3
269+
message: "Response documents MUST be of application/hal+json or application/problem+json media types: {{error}}"
255270
then:
256271
function: enumeration
257272
functionOptions:
258273
values:
259274
- application/hal+json
275+
- application/problem+json
260276

261277
adidas-oas3-response-success-hal-body: # schemes and/or produces
262278
description: "All success responses MUST follow `application/hal+json` schema"
263279
severity: error
264-
given: $.paths..responses[?( @property >= 200 && @property < 300 && @property != 204)].content[?(@property === "application/hal+json")]
280+
given: $.paths..responses[?( @property == 200 && @property < 300 && @property != 204)].content[?(@property === "application/hal+json")]
265281
recommended: true
266282
type: "style"
267283
formats:

README.md

+8-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Guidelines for the API design and development at adidas
44

55
# adidas API Guidelines
66

7-
![adidas logo](https://adidas-group.gitbooks.io/api-guidelines/content/assets/adidas-logo.svg)
7+
![adidas logo](adidaslogo.jpg)
88

99
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
1010

@@ -23,7 +23,7 @@ The API Guidelines are split into two main parts:
2323
* [General Guidelines](general-guidelines/general-guidelines.md)
2424
* API type-specific Guidelines
2525
* [REST APIs Guidelines](rest-api-guidelines/rest.md)
26-
* [Kafka Guidelines](kafka-guidelines/kafka.md)
26+
* [Asynchronous APIs Guidelines](asynchronous-api-guidelines/asyncapi.md)
2727

2828
The general guidelines section discusses the core principles relevant to any kind of API. The API type-specific section further defines the guidelines specific to a given architectural style or API technique \(such as REST, Kafka or GraphQL APIs\).
2929

@@ -61,14 +61,18 @@ For further documentation on Spectral refer to their [documentation](https://sto
6161
6262
### Questions & Comments
6363
64-
_Please contact_ [_Zdenek.Nemec@externals.adidas-group.com_](mailto:Zdenek.Nemec@externals.adidas-group.com), [[email protected]_](mailto:[email protected]) or [_samir.amzani@adidas.com_](mailto:samir.amzani@adidas.com) _in case of questions._
64+
_Please contact_ [_samir.amzani@adidas.com_](mailto:samir.amzani@adidas.com) or [_jesusjavier.dediego@adidas.com_](mailto:jesusjavier.dediego@adidas.com) _in case of questions._
6565
6666
## Intended Use Cases
6767
6868
This project is intended to provide the guidelines for design & development of APIs at adidas.
6969
7070
adidas is not responsible for the usage of this software for different purposes that the ones described in the use cases.
7171
72+
## Last Review
73+
74+
February 2021
75+
7276
## License and Software Information
7377
7478
© adidas AG
@@ -83,5 +87,5 @@ For further information open the [adidas terms and conditions](https://github.co
8387
8488
### License
8589
86-
[MIT](https://github.com/adidas-group/api-guidelines/tree/657bc6fd49f1499f10c30ab18420f4bdb7cd841b/LICENSE/README.md)
90+
[MIT](https://github.com/adidas/api-guidelines/blob/master/LICENSE)
8791

SUMMARY.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@
3939
* [Common Data Types](rest-api-guidelines/application/common-data-types.md)
4040
* [Execution](rest-api-guidelines/execution/README.md)
4141
* [Pagination](rest-api-guidelines/execution/pagination.md)
42-
* [Asynchronous Tasks](rest-api-guidelines/execution/asynchronous-tasks.md)
42+
* [Long Running Tasks](rest-api-guidelines/execution/long-running-tasks/README.md)
43+
* [Polling](rest-api-guidelines/execution/long-running-tasks/polling.md)
44+
* [Callback](rest-api-guidelines/execution/long-running-tasks/callback.md)
45+
* [Files Upload](rest-api-guidelines/execution/long-running-tasks/files-upload.md)
4346
* [Batch Operations](rest-api-guidelines/execution/batch-operations.md)
4447
* [Search Requests](rest-api-guidelines/execution/search-requests.md)
4548
* [Query Requests with Large Inputs](rest-api-guidelines/execution/query-requests-with-large-inputs.md)
@@ -61,7 +64,7 @@
6164
* [Loose Coupling](rest-api-guidelines/clients/loose-coupling.md)
6265
* [Further References](rest-api-guidelines/miscellaneous.md)
6366

64-
## Kafka Guidelines
67+
## Asynchronous API Guidelines
6568

66-
* [Introduction](kafka-guidelines/kafka.md)
69+
* [Introduction](asynchronous-api-guidelines/asyncapi.md)
6770

adidaslogo.jpg

12.4 KB
Loading
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Introduction
2+
3+
## adidas Asynchronous APIs Guidelines
4+
5+
6+

0 commit comments

Comments
 (0)