Skip to content

Commit 7230338

Browse files
committed
docs: 📝 openapi contracts of the new created endpoints
1 parent 97d98a0 commit 7230338

3 files changed

Lines changed: 114 additions & 0 deletions

File tree

contracts/openapi.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ tags:
3131
description: Health checks, schema introspection, and system status
3232
- name: jobs
3333
description: Cross-cutting async job status polling
34+
- name: external-apis
35+
description: Integrations with external APIs (Weather, Zipcode)
3436

3537
paths:
3638
# ── Layer 1: Input ──────────────────────────────────────────────
@@ -96,3 +98,11 @@ paths:
9698
# ── Layer 8: Async Jobs ────────────────────────────────────────
9799
/api/v1/jobs/{job_id}:
98100
$ref: "path/jobs.yaml#/job_by_id"
101+
102+
# ── Layer 9: External APIs ─────────────────────────────────────
103+
/api/v1/weather/forecast:
104+
$ref: "path/weather.yaml#/forecast"
105+
/api/v1/zipcode/postal-code:
106+
$ref: "path/zipcode.yaml#/postal_code"
107+
/api/v1/zipcode/location:
108+
$ref: "path/zipcode.yaml#/location"

contracts/path/weather.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
forecast:
2+
get:
3+
summary: Fetch weather forecast
4+
description: Fetch weather data for the given location and fields.
5+
tags:
6+
- external-apis
7+
parameters:
8+
- name: latitude
9+
in: query
10+
required: true
11+
schema:
12+
type: number
13+
format: float
14+
- name: longitude
15+
in: query
16+
required: true
17+
schema:
18+
type: number
19+
format: float
20+
- name: start_date
21+
in: query
22+
required: true
23+
schema:
24+
type: string
25+
format: date
26+
- name: end_date
27+
in: query
28+
required: true
29+
schema:
30+
type: string
31+
format: date
32+
- name: fields
33+
in: query
34+
required: false
35+
schema:
36+
type: string
37+
description: Comma-separated list of hourly variables to request.
38+
responses:
39+
'200':
40+
description: Weather data retrieved successfully
41+
content:
42+
application/json:
43+
schema:
44+
type: object
45+
additionalProperties: true
46+
'500':
47+
description: Internal server error

contracts/path/zipcode.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
postal_code:
2+
get:
3+
summary: Resolve postal code
4+
description: Fetch data for the given postal code and country.
5+
tags:
6+
- external-apis
7+
parameters:
8+
- name: country
9+
in: query
10+
required: true
11+
schema:
12+
type: string
13+
- name: postal_code
14+
in: query
15+
required: true
16+
schema:
17+
type: string
18+
responses:
19+
'200':
20+
description: Postal code data retrieved successfully
21+
content:
22+
application/json:
23+
schema:
24+
type: object
25+
additionalProperties: true
26+
'500':
27+
description: Internal server error
28+
29+
location:
30+
get:
31+
summary: Resolve location
32+
description: Fetch data for the given city and country.
33+
tags:
34+
- external-apis
35+
parameters:
36+
- name: country
37+
in: query
38+
required: true
39+
schema:
40+
type: string
41+
- name: city
42+
in: query
43+
required: true
44+
schema:
45+
type: string
46+
responses:
47+
'200':
48+
description: Location data retrieved successfully
49+
content:
50+
application/json:
51+
schema:
52+
type: array
53+
items:
54+
type: object
55+
additionalProperties: true
56+
'500':
57+
description: Internal server error

0 commit comments

Comments
 (0)