-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcarrier_identifier__v1.yml
112 lines (111 loc) · 3.38 KB
/
carrier_identifier__v1.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
openapi: 3.0.0
info:
version: "1"
title: "CarrierIdentifier"
description: "Service for identifying carriers by tracking numbers."
servers:
- url: http://carriers/openapi/CarrierIdentifier/v1
- url: http://host.docker.internal:8080/openapi/CarrierIdentifier/v1
- url: http://localhost:8080/openapi/CarrierIdentifier/v1
tags:
- name: TrackingNumbers
paths:
"/trackingNumbers/{id}":
get:
summary: Retrieve carrier name by tracking number
description: "Fetches the name of the carrier associated with a given tracking number."
tags:
- TrackingNumbers
parameters:
- in: path
name: id
required: true
example: "1Z093V6R0306587923"
schema:
type: string
description: "The tracking number used to identify the carrier."
responses:
'200':
description: "Successful response with the carrier's name."
content:
application/json:
schema:
$ref: '#/components/schemas/TrackingNumberResult'
'500':
description: "An error occurred while processing the request."
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
components:
schemas:
TrackingNumberResult:
allOf:
- $ref: '#/components/schemas/SuccessResponse'
type: object
description: "Response containing the carrier's name if the tracking number is valid."
properties:
data:
$ref: '#/components/schemas/TrackingNumber'
TrackingNumber:
type: object
description: "Schema representing the carrier information associated with the tracking number."
required:
- id
- carriers
properties:
id:
type: string
description: "Tracking Number ID"
example: "1Z093V6R0306587923"
carriers:
type: array
items:
type: string
example: UPS
description: >
"List of carriers matched with the provided tracking number.
Enum: FedEx, USPS, UPS, OnTrac"
ErrorResponse:
type: object
description: "Response schema for errors encountered during the request."
properties:
messages:
type: array
items:
$ref: "#/components/schemas/Message"
description: "A list of error messages with levels and descriptions."
Message:
type: object
properties:
level:
type: string
enum:
- emergency
- alert
- critical
- error
- warning
- notice
- info
type:
type: string
enum:
- UNDEFINED
- LOGGER_MESSAGE
description: >
"You can expose this enum for all your errors.
UNDEFINED - Any undefined message type.
LOGGER_MESSAGE - Similar to undefined."
text:
type: string
description: "Message that describes what went wrong."
SuccessResponse:
allOf:
- $ref: '#/components/schemas/ErrorResponse'
type: object
description: "A base response schema with both error and success information."
properties:
data:
type: object
description: "Data returned in a successful response."