Tomasz Ducin
25th January 2016, Warsaw
senior software consultant @ Cybercom Poland
blah, blah, blah...
contract agreement - no changes forcing
+ existing reference
+ single source of truth
- no strict syntax and content
- manual checks, no automation
- useless for CI
/songs
get
post
/{songId}
get
/file-content
get
post
/artists
get
post
/{artistId}
get
/albums
get
/albums
get
post
/{albumId}
get
/songs
get
/songs:
description: Collection of available songs in Jukebox
get:
description: Get a list of songs based on the song title.
queryParameters:
songTitle:
description: "The title of the song to search (...)"
required: true
minLength: 3
type: string
example: "Get L"
[...]
[...]
responses:
200:
body:
application/json:
example: |
"songs": [
{
"songId": "550e8400-e29b-41d4-a716-446655440000",
"songTitle": "Get Lucky"
},
{
"songId": "550e8400-e29b-41d4-a716-446655440111",
"songTitle": "Loose yourself to dance"
},
{
"songId": "550e8400-e29b-41d4-a716-446655440222",
"songTitle": "Gio sorgio by Moroder"
}
]
API Blueprint
Swagger
RAML:
RESTful API Modelling Language
[...]
responses:
200:
body:
application/json:
schema: |
{
"type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
"id": "http://jsonschema.net",
"required": true,
"properties": {
"songTitle": {
"type": "string",
"required": true
},
"albumId": {
"type": "string",
"required": true,
"minLength": 36,
"maxLength": 36
}
}
}
https://www.youtube.com/watch?v=VvliaO3uej8
Confitura 2015
Marcin Grzejszczak - Trzymaj się reguł - Consumer-Driven Contracts
vs
imbues providers with insight into their consumer obligations , and focuses service evolution around the delivery of the key business functionality demanded by consumers .
- Martin Fowler ( here)