Skip to content

Commit dabe9e7

Browse files
Merge pull request #10 from naftis/locations-endpoint
feat: well-known locations endpoint
2 parents 5209041 + e004704 commit dabe9e7

File tree

8 files changed

+579
-3
lines changed

8 files changed

+579
-3
lines changed

build/build_apis.cmd

+11-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,20 @@
22
# Assumes the command is run from the root folder i.e ./standards
33
# For each new category, please make sure to add a reference link in this file for easy auto generation of yamls.
44
5+
# build auth APIs
56
swagger-cli -f 2 -t yaml bundle ./src/authz/authz_core_api_v1.0.0.yaml -o ./release/yaml/authz_core_api_v1.0.0.yaml
6-
swagger-cli -f 2 -t yaml bundle ./src/registry/registry_core_api_v1.0.0.yaml -o ./release/yaml/registry_core_api_v1.0.0.yaml
7-
swagger-cli -f 2 -t yaml bundle ./src/jwks/jwks_core_api_v1.0.0.yaml -o ./release/yaml/jwks_core_api_v1.0.0.yaml
8-
97
redocly build-docs ./release/yaml/authz_core_api_v1.0.0.yaml -o ./release/html/authz_core_api_v1.0.0.html
8+
9+
# build registry core APIs
10+
swagger-cli -f 2 -t yaml bundle ./src/registry/registry_core_api_v1.0.0.yaml -o ./release/yaml/registry_core_api_v1.0.0.yaml
1011
redocly build-docs ./release/yaml/registry_core_api_v1.0.0.yaml -o ./release/html/registry_core_api_v1.0.0.html
12+
13+
# build locations APIs
14+
swagger-cli -f 2 -t yaml bundle ./src/locations/locations_core_api_v1.0.0.yaml -o ./release/yaml/locations_core_api_v1.0.0.yaml
15+
redocly build-docs ./release/yaml/locations_core_api_v1.0.0.yaml -o ./release/html/locations_core_api_v1.0.0.html
16+
17+
# build jwks APIs
18+
swagger-cli -f 2 -t yaml bundle ./src/jwks/jwks_core_api_v1.0.0.yaml -o ./release/yaml/jwks_core_api_v1.0.0.yaml
1119
redocly build-docs ./release/yaml/jwks_core_api_v1.0.0.yaml -o ./release/html/jwks_core_api_v1.0.0.html
1220

1321
# IBR registry build steps

release/html/locations_core_api_v1.0.0.html

+321
Large diffs are not rendered by default.
+132
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
openapi: 3.0.3
2+
info:
3+
title: Interoperability APIs - Locations
4+
x-logo:
5+
url: 'https://spdci.github.io/api-documentation/draft/dci-logo.png'
6+
backgroundColor: '#FFFFFF'
7+
altText: Digital Convergence Initiative
8+
description: Provide the location structure tree of the CRVS system
9+
version: 1.0.0
10+
contact:
11+
name: DCI Social Protection
12+
13+
license:
14+
name: DCI Social Protection License
15+
url: 'https://github.com/spdci/standards/blob/draft/LICENSE.md'
16+
servers:
17+
- url: 'https://sandbox.spdci.org/namespace/v1.0.0'
18+
description: Sandbox Server
19+
paths:
20+
/.well-known/locations.json:
21+
get:
22+
summary: 'Locations : /.well-known/locations.json'
23+
description: This endpoint can be used to build a location tree of the CRVS system or to find a specific location details
24+
operationId: get_locations_json
25+
responses:
26+
'200':
27+
description: Locations response
28+
content:
29+
application/json:
30+
schema:
31+
description: LocationHierarchy
32+
type: object
33+
properties:
34+
'@context':
35+
type: object
36+
description: JSON-LD Schema Context
37+
properties:
38+
'@context':
39+
type: string
40+
const: 'http://spdci.org/'
41+
xsd:
42+
type: string
43+
const: 'http://www.w3.org/2001/XMLSchema#'
44+
schema:
45+
type: string
46+
const: 'http://schema.org/'
47+
required:
48+
- '@context'
49+
- xsd
50+
- schema
51+
'@type':
52+
type: string
53+
const: LocationHierarchy
54+
lastUpdated:
55+
example: '2023-10-17T11:26:02.512+00:00'
56+
description: |
57+
1. All dates and timestamps are represented in [ISO 8601](https://www.iso.org/standard/40874.html) format including timezone - e.g 2022-12-04T17:20:07-04:00.
58+
type: string
59+
format: date-time
60+
locations:
61+
type: array
62+
description: An array of all Places in the system with names and parent id's
63+
items:
64+
description: Place
65+
type: object
66+
properties:
67+
'@type':
68+
type: string
69+
const: Place
70+
identifier:
71+
type: array
72+
items:
73+
description: PropertyValue
74+
type: object
75+
properties:
76+
'@type':
77+
type: string
78+
const: PropertyValue
79+
name:
80+
type: string
81+
description: The identifier name
82+
example: crvs-location
83+
identifier:
84+
type: string
85+
description: The identifier itself
86+
example: 12345678-1234-1234-1234-123456789abc
87+
description: The identifiers of the place
88+
name:
89+
type: string
90+
description: The human-readable name of the place
91+
example: Karnataka
92+
additionalType:
93+
type: string
94+
description: Additional type of the place
95+
example: 'crvs:HEALTH_FACILITY'
96+
containedInPlace:
97+
description: 'Identifier of the parent location, set it to null if it is the root location'
98+
type:
99+
- 'null'
100+
- string
101+
required:
102+
- id
103+
- name
104+
- containedInPlace
105+
required:
106+
- '@context'
107+
- '@type'
108+
'404':
109+
$ref: '#/components/responses/HttpErrorResponse'
110+
'500':
111+
$ref: '#/components/responses/HttpErrorResponse'
112+
deprecated: false
113+
components:
114+
responses:
115+
HttpErrorResponse:
116+
description: HTTP layer error details
117+
content:
118+
application/json:
119+
schema:
120+
type: object
121+
description: 'HTTP transport layer error codes. Used by components like gateways, LB responding with HTTP status codes 1xx, 2xx, 3xx, 4xx and 5xx'
122+
properties:
123+
errors:
124+
items:
125+
type: object
126+
properties:
127+
code:
128+
type: string
129+
description: error code
130+
message:
131+
type: string
132+
description: error message

src/common/schema/@context.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
type: object
2+
description: JSON-LD Schema Context
3+
properties:
4+
"@context":
5+
type: string
6+
const: http://spdci.org/
7+
xsd:
8+
type: string
9+
const: http://www.w3.org/2001/XMLSchema#
10+
schema:
11+
type: string
12+
const: http://schema.org/
13+
required:
14+
- "@context"
15+
- xsd
16+
- schema
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
openapi: 3.0.3
2+
info:
3+
title: Interoperability APIs - Locations
4+
x-logo:
5+
url: "https://spdci.github.io/api-documentation/draft/dci-logo.png"
6+
backgroundColor: "#FFFFFF"
7+
altText: "Digital Convergence Initiative"
8+
description: Provide the location structure tree of the CRVS system
9+
version: 1.0.0
10+
contact:
11+
name: DCI Social Protection
12+
13+
license:
14+
name: DCI Social Protection License
15+
url: https://github.com/spdci/standards/blob/draft/LICENSE.md
16+
servers:
17+
- url: "https://sandbox.spdci.org/namespace/v1.0.0"
18+
description: Sandbox Server
19+
paths:
20+
/.well-known/locations.json:
21+
get:
22+
summary: "Locations : /.well-known/locations.json"
23+
description: "This endpoint can be used to build a location tree of the CRVS system or to find a specific location details"
24+
operationId: get_locations_json
25+
responses:
26+
"200":
27+
description: "Locations response"
28+
content:
29+
application/json:
30+
schema:
31+
$ref: schema/core/LocationHierarchy.yaml
32+
"404":
33+
$ref: "#/components/responses/HttpErrorResponse"
34+
"500":
35+
$ref: "#/components/responses/HttpErrorResponse"
36+
deprecated: false
37+
components:
38+
responses:
39+
HttpErrorResponse:
40+
$ref: "../common/response/HttpErrorResponse.yaml"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
description: LocationHierarchy
2+
type: object
3+
properties:
4+
"@context":
5+
$ref: "../../../common/schema/@context.yaml"
6+
"@type":
7+
type: string
8+
const: LocationHierarchy
9+
lastUpdated:
10+
$ref: "../../../common/schema/DateTime.yaml"
11+
example: "2023-10-17T11:26:02.512+00:00"
12+
locations:
13+
type: array
14+
description: "An array of all Places in the system with names and parent id's"
15+
items:
16+
$ref: "./Place.yaml"
17+
required:
18+
- "@context"
19+
- "@type"

src/locations/schema/core/Place.yaml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
description: Place
2+
type: object
3+
properties:
4+
"@type":
5+
type: string
6+
const: "Place"
7+
identifier:
8+
type: array
9+
items:
10+
$ref: "./PropertyValue.yaml"
11+
description: The identifiers of the place
12+
name:
13+
type: string
14+
description: The human-readable name of the place
15+
example: Karnataka
16+
additionalType:
17+
type: string
18+
description: Additional type of the place
19+
example: "crvs:HEALTH_FACILITY"
20+
containedInPlace:
21+
description: Identifier of the parent location, set it to null if it is the root location
22+
type: ["null", string]
23+
required:
24+
- id
25+
- name
26+
- containedInPlace
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
description: PropertyValue
2+
type: object
3+
properties:
4+
"@type":
5+
type: string
6+
const: "PropertyValue"
7+
name:
8+
type: string
9+
description: The identifier name
10+
example: "crvs-location"
11+
identifier:
12+
type: string
13+
description: The identifier itself
14+
example: "12345678-1234-1234-1234-123456789abc"

0 commit comments

Comments
 (0)