Skip to content

Commit f46762c

Browse files
committed
Switched to JSON API hypermedia (only address calls for now)
1 parent 818058e commit f46762c

File tree

1 file changed

+92
-113
lines changed

1 file changed

+92
-113
lines changed

swagger.yml

Lines changed: 92 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ info:
1313
*Let op: deze link werkt nog niet omdat de API zelf nog gerealiseerd moet worden*
1414
1515
### Hypermedia
16-
Alle responses van deze API bevatten [HAL](http://stateless.co/hal_specification.html) *hypermedia links* om door de data te kunnen navigeren. Deze navigatie vind je in de `_links` objecten.
16+
Alle responses van deze API bevatten [JSON API](http://jsonapi.org/) *hypermedia links* om door de data te kunnen navigeren. Deze navigatie vind je in de `links` objecten.
1717
contact:
1818
name: Apiwise
1919
url: http://www.apiwise.nl
@@ -23,7 +23,7 @@ basePath: /v2
2323
schemes:
2424
- https
2525
produces:
26-
- application/json
26+
- application/vnd.api+json
2727
securityDefinitions:
2828
apiKey:
2929
type: apiKey
@@ -113,36 +113,31 @@ paths:
113113
description: OK
114114
schema:
115115
type: object
116+
required:
117+
- data
118+
- links
116119
properties:
117-
_embedded:
118-
type: object
119-
properties:
120-
addresses:
121-
type: array
122-
items:
123-
$ref: "#/definitions/Address"
124-
_links:
120+
data:
121+
type: array
122+
items:
123+
$ref: "#/definitions/Address"
124+
links:
125125
type: object
126+
required:
127+
- self
126128
properties:
129+
self:
130+
type: string
131+
example: https://api.postcodeapi.nu/v2/addresses?page=2
132+
description: Link naar volgende pagina
133+
prev:
134+
type: string
135+
example: https://api.postcodeapi.nu/v2/addresses?page=2
136+
description: Link naar volgende pagina
127137
next:
128-
type: object
129-
properties:
130-
href:
131-
type: string
132-
example: /addresses?page=2
133-
description: Link naar volgende pagina
134-
400:
135-
description: Bad request
136-
schema:
137-
type: object
138-
properties:
139-
error:
140-
type: object
141-
properties:
142-
code:
143-
type: number
144-
message:
145138
type: string
139+
example: https://api.postcodeapi.nu/v2/addresses?page=2
140+
description: Link naar volgende pagina
146141
/addresses/{id}:
147142
x-swagger-router-controller: address
148143
get:
@@ -167,13 +162,18 @@ paths:
167162
200:
168163
description: OK
169164
schema:
170-
$ref: "#/definitions/Address"
165+
type: object
166+
required:
167+
- data
168+
properties:
169+
data:
170+
$ref: "#/definitions/Address"
171171
/postcodes:
172172
get:
173173
tags: [postcode]
174174
summary: Alle postcodes
175175
description: Alle postcodes in Nederland, gepagineerd per 20 records
176-
operationId: findOneAddress
176+
operationId: findPostcodes
177177
parameters:
178178
- name: page
179179
in: query
@@ -259,6 +259,7 @@ paths:
259259
get:
260260
tags: [postcode]
261261
summary: Enkele postcode
262+
operationId: findOnePostcode
262263
parameters:
263264
- name: postcode
264265
in: path
@@ -509,103 +510,81 @@ definitions:
509510
Address:
510511
type: object
511512
required:
512-
- id
513513
- type
514-
- purpose
515-
- street
516-
- number
517-
- letter
518-
- addition
519-
- postcode
520-
- city
521-
- municipality
522-
- province
523-
- geo
514+
- id
515+
- attributes
524516
properties:
517+
type:
518+
type: string
519+
example: "addresses"
525520
id:
526521
type: string
527522
example: "268200000075156"
528523
description: Identifier van het adres, gelijk aan die van de BAG
529-
street:
530-
type: string
531-
example: Binderskampweg
532-
description: Straat
533-
number:
534-
type: integer
535-
example: 29
536-
description: Huisnummer
537-
letter:
538-
type: [ string, "null" ]
539-
example: U
540-
description: Letter
541-
addition:
542-
type: [ string, "null" ]
543-
example: "31"
544-
description: Huisnummer toevoeging
545-
postcode:
546-
type: [ string, "null" ]
547-
example: 6545CA
548-
description: Postcode in *P6* formaat
549-
city:
550-
$ref: "#/definitions/City"
551-
municipality:
552-
$ref: "#/definitions/Municipality"
553-
province:
554-
$ref: "#/definitions/Province"
555-
distance:
556-
type: [ number ]
557-
format: float
558-
example: 23.1
559-
description: Afstand (in km) tot WGS84 coordinaten als deze zijn opgegeven
560-
geo:
524+
attributes:
561525
type: object
526+
required:
527+
- street
528+
- number
529+
- letter
530+
- addition
531+
- postcode
532+
- geo
533+
- type
534+
- purpose
562535
properties:
563-
center:
536+
street:
537+
type: string
538+
example: Binderskampweg
539+
description: Straat
540+
number:
541+
type: integer
542+
example: 29
543+
description: Huisnummer
544+
letter:
545+
type: [ string, "null" ]
546+
example: U
547+
description: Letter
548+
addition:
549+
type: [ string, "null" ]
550+
example: "31"
551+
description: Huisnummer toevoeging
552+
postcode:
553+
type: [ string, "null" ]
554+
example: 6545CA
555+
description: Postcode in *P6* formaat
556+
distance:
557+
type: [ number ]
558+
format: float
559+
example: 23.1
560+
description: Afstand (in km) tot WGS84 coordinaten als deze zijn opgegeven
561+
geo:
564562
type: object
565563
properties:
566-
wgs84:
567-
$ref: "#/definitions/Wgs84Center"
568-
rd:
569-
$ref: "#/definitions/RdCenter"
570-
type:
571-
type: string
572-
example: Verblijfsobject
573-
description: Type gebouw
574-
purpose:
575-
type: [ string, "null" ]
576-
example: woonfunctie
577-
description: Gebruiksdoel
578-
_links:
564+
center:
565+
type: object
566+
properties:
567+
wgs84:
568+
$ref: "#/definitions/Wgs84Center"
569+
rd:
570+
$ref: "#/definitions/RdCenter"
571+
type:
572+
type: string
573+
example: Verblijfsobject
574+
description: Type gebouw
575+
purpose:
576+
type: [ string, "null" ]
577+
example: woonfunctie
578+
description: Gebruiksdoel
579+
links:
579580
type: object
581+
required:
582+
- self
580583
properties:
581584
self:
582-
type: object
583-
properties:
584-
href:
585-
type: string
586-
example: /addresses/268200000075156
587-
description: Link naar adres informatie
588-
# city:
589-
# type: object
590-
# properties:
591-
# href:
592-
# type: string
593-
# example: https://api.plaatsapi.nu/cities/3030
594-
# description: Link naar woonplaats informatie van Plaats API
595-
# municipality:
596-
# type: object
597-
# properties:
598-
# href:
599-
# type: string
600-
# example: https://api.plaatsapi.nu/municipalities/01268
601-
# description: Link naar gemeente informatie van Plaats API
602-
# province:
603-
# type: object
604-
# properties:
605-
# href:
606-
# type: string
607-
# example: https://api.plaatsapi.nu/provinces/1
608-
# description: Link naar provincie informatie van Plaats API
585+
type: string
586+
example: https://api.postcodeapi.nu/v2/addresses/268200000075156
587+
description: Link naar het adres
609588
Province:
610589
type: object
611590
properties:

0 commit comments

Comments
 (0)