Skip to content

Commit c9bbda8

Browse files
committed
fix(OpenAPI): Update spec
- Update redocly - Disambiguate Scottish Postcode
1 parent 4be9989 commit c9bbda8

8 files changed

Lines changed: 2537 additions & 1033 deletions

File tree

.redocly.yaml

Lines changed: 24 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,24 @@
1-
apiDefinitions:
2-
# a set of named keys and values of entrypoints to OpenAPI 3 definitions.
3-
# example
4-
idealpostcodes: ./openapi/openapi.yaml
5-
6-
registry:
7-
# the API registry options
8-
9-
# future products may be configured by extending this file
10-
11-
12-
lint:
13-
extends:
14-
- recommended
15-
rules:
16-
no-unused-components: warning
17-
referenceDocs:
18-
htmlTemplate: ./openapi/index.html
19-
theme:
20-
sidebar:
21-
textColor: '#d5dae6'
22-
activeBgColor: '#07489e'
23-
backgroundColor: '#05326d'
24-
activeTextColor: '#FFFFFF'
25-
typography:
26-
code:
27-
fontFamily: 'Fira Code, monospace'
28-
fontSize: '13px'
29-
backgroundColor: "rgba(38, 50, 56, 0.05)"
30-
color: "#e53935"
31-
headings:
32-
fontFamily: 'Lato, sans-serif'
33-
fontFamily: 'Lato, sans-serif'
34-
colors:
35-
primary:
36-
main: "#32329f"
37-
# generateCodeSamples:
38-
# languages: # Array of language config objects; indicates in which languages to generate code samples.
39-
# - lang: curl # Can be one of the following supported languages: "curl", "Node.js", "JavaScript".
40-
# - lang: "Node.js"
41-
# - lang: "JavaScript"
1+
apis:
2+
idealpostcodes:
3+
root: ./openapi/openapi.yaml
4+
theme:
5+
openapi:
6+
htmlTemplate: ./openapi/index.html
7+
theme:
8+
sidebar:
9+
textColor: "#d5dae6"
10+
activeBgColor: "#07489e"
11+
backgroundColor: "#05326d"
12+
activeTextColor: "#FFFFFF"
13+
typography:
14+
code:
15+
fontFamily: "Fira Code, monospace"
16+
fontSize: "13px"
17+
backgroundColor: "rgba(38, 50, 56, 0.05)"
18+
color: "#e53935"
19+
headings:
20+
fontFamily: "Lato, sans-serif"
21+
fontFamily: "Lato, sans-serif"
22+
colors:
23+
primary:
24+
main: "#32329f"

openapi/components/responses/ScottishPostcodes.yaml renamed to openapi/components/responses/ScottishPostcodesResponse.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ properties:
1313
type: array
1414
items:
1515
oneOf:
16-
- $ref: '../schemas/ScottishPostcodes.yaml'
17-
description: 'Data for a given postcode'
16+
- $ref: "../schemas/ScottishPostcodes.yaml"
17+
description: "Data for a given postcode"

openapi/openapi.yaml

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ info:
66
url: "https://opensource.org/licenses/MIT"
77
title: API Reference - Postcodes.io
88
termsOfService: "https://postcodes.io/about"
9-
description:
10-
$ref: './description.md'
9+
description:
10+
$ref: "./description.md"
1111
contact:
1212
email: support@ideal-postcodes.co.uk
1313
name: Support
1414
url: https://ideal-postcodes.co.uk/support
1515
externalDocs:
1616
description: More on our APIs, libraries with guides and examples
17-
url: 'https://docs.ideal-postcodes.co.uk/postcodesio'
17+
url: "https://docs.ideal-postcodes.co.uk/postcodesio"
1818
servers:
1919
- url: "https://api.postcodes.io"
2020
description: "API Server"
@@ -33,34 +33,34 @@ tags:
3333
x-tagGroups:
3434
- name: API
3535
tags:
36-
- Postcode Lookup
37-
- Postcode Query
38-
- Nearest Postcode
39-
- Random Postcode
40-
- Terminated Postcodes
41-
- Scottish Postcodes
42-
- Outward Code Lookup
43-
- Place Search
44-
- Place Query
45-
- Random Place
36+
- Postcode Lookup
37+
- Postcode Query
38+
- Nearest Postcode
39+
- Random Postcode
40+
- Terminated Postcodes
41+
- Scottish Postcodes
42+
- Outward Code Lookup
43+
- Place Search
44+
- Place Query
45+
- Random Place
4646
paths:
47-
'/postcodes/{postcode}':
48-
$ref: 'paths/postcodes@{postcode}.yaml'
49-
'/postcodes':
50-
$ref: 'paths/postcodes.yaml'
51-
'/postcodes/{postcode}/nearest':
52-
$ref: 'paths/postcodes@{postcode}@nearest.yaml'
53-
'/random/postcodes':
54-
$ref: 'paths/random@postcodes.yaml'
55-
'/terminated_postcodes/{postcode}':
56-
$ref: 'paths/terminated_postcodes@{postcode}.yaml'
57-
'/scotland/postcodes/{postcode}':
58-
$ref: 'paths/scotland@postcodes@{postcode}.yaml'
59-
'/outcodes/{outcode}':
60-
$ref: 'paths/outcodes@{outcode}.yaml'
61-
'/places/{code}':
62-
$ref: 'paths/places@{code}.yaml'
63-
'/places':
64-
$ref: 'paths/places.yaml'
65-
'/random/places':
66-
$ref: 'paths/random@places.yaml'
47+
"/postcodes/{postcode}":
48+
$ref: "paths/postcodes@{postcode}.yaml"
49+
"/postcodes":
50+
$ref: "paths/postcodes.yaml"
51+
"/postcodes/{postcode}/nearest":
52+
$ref: "paths/postcodes@{postcode}@nearest.yaml"
53+
"/random/postcodes":
54+
$ref: "paths/random@postcodes.yaml"
55+
"/terminated_postcodes/{postcode}":
56+
$ref: "paths/terminated_postcodes@{postcode}.yaml"
57+
"/scotland/postcodes/{postcode}":
58+
$ref: "paths/scotland@postcodes@{postcode}.yaml"
59+
"/outcodes/{outcode}":
60+
$ref: "paths/outcodes@{outcode}.yaml"
61+
"/places/{code}":
62+
$ref: "paths/places@{code}.yaml"
63+
"/places":
64+
$ref: "paths/places.yaml"
65+
"/random/places":
66+
$ref: "paths/random@places.yaml"

openapi/paths/scotland@postcodes@{postcode}.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ get:
1515
schema:
1616
type: string
1717
responses:
18-
'200':
18+
"200":
1919
description: Success
2020
content:
2121
application/json:
2222
schema:
23-
$ref: '../components/responses/ScottishPostcodes.yaml'
23+
$ref: "../components/responses/ScottishPostcodesResponse.yaml"
2424
x-codeSamples:
25-
- lang: 'http'
26-
label: 'URL'
27-
source: |
28-
https://api.postcodes.io/scotland/postcodes/IV27JB
29-
- lang: 'cURL'
30-
label: 'CLI'
31-
source: |
32-
curl -G -k \
33-
--url 'https://api.postcodes.io/scotland/postcodes/IV27JB'
25+
- lang: "http"
26+
label: "URL"
27+
source: |
28+
https://api.postcodes.io/scotland/postcodes/IV27JB
29+
- lang: "cURL"
30+
label: "CLI"
31+
source: |
32+
curl -G -k \
33+
--url 'https://api.postcodes.io/scotland/postcodes/IV27JB'

0 commit comments

Comments
 (0)