-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswagger.yaml
191 lines (191 loc) · 5.03 KB
/
swagger.yaml
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
openapi: 3.1.0
info:
title: EV Backend
description: Backend of the EV written in Go.
version: 1.0.0
servers:
- url: http://ev.localhost
- url: http://localhost:8080
tags:
- name: Discovery
description: Endpoints related to discover relevant information.
- name: Authorization
description: Endpoints related to the OAuth Authorization Flow.
paths:
/emsps:
get:
tags:
- Discovery
summary: Gets supported eMSPs
description: Returns an array of supported eMSP infos.
operationId: getEmsps
responses:
"200":
description: List of eMSPs
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Emsp'
x-content-type: application/json
"500":
description: Internal server error
/cpr:
post:
tags:
- Authorization
summary: Receives Contract Provisioning Request which initializes the authorization flow
description: Transfers the desired eMSP and authorization parameters.
operationId: requestContractProvisioning
requestBody:
$ref: '#/components/requestBodies/ContractProvisioningRequest'
responses:
"201":
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/ContractProvisioningResponse'
"400":
description: Bad request
"404":
description: eMSP ID not found
"500":
description: Internal server error
# /confirm:
# post:
# tags:
# - Authorization
# summary: Finishes the authorization
# description: Transfers the Authorization Code to the EV which finishes the authorization process.
# operationId: confirmAuthorization
# requestBody:
# $ref: '#/components/requestBodies/ConfirmationRequest'
# responses:
# "200":
# description: OK
# "404":
# description: Unknown state
# "500":
# description: Internal server error
components:
schemas:
Emsp:
type: object
properties:
id:
$ref: '#/components/schemas/EmspId'
name:
type: string
example: Example eMSP
base_url:
type: string
format: uri
example: https://authorization-server.example.com/
image:
type: string
format: uri
example: assets/example.svg
required:
- id
- name
- base_url
EmspId:
type: string
example: sample_emsp
ContractProvisioningRequest:
type: object
properties:
emsp_id:
$ref: '#/components/schemas/EmspId'
authorization_detail:
$ref: '#/components/schemas/AuthorizationDetail'
required:
- emsp_id
- authorization_detail
AuthorizationDetail:
type: object
properties:
type:
type: string
example: "pnc_contract_request"
charging_period:
$ref: '#/components/schemas/ChargingPeriod'
maximum_amount:
$ref: '#/components/schemas/CurrencyAmount'
maximum_transaction_amount:
$ref: '#/components/schemas/CurrencyAmount'
required:
- type
- charging_period
- maximum_amount
- maximum_transaction_amount
ChargingPeriod:
type: object
properties:
start:
type: string
format: date-time
example: 2023-09-07T14:00:00Z
end:
type: string
format: date-time
example: 2023-10-07T15:00:00Z
required:
- start
- end
CurrencyAmount:
type: object
properties:
amount:
type: string
format: decimal
example: "123.50"
currency:
$ref: '#/components/schemas/Currencies'
required:
- amount
- currency
Currencies:
type: string
enum:
- EUR
- USD
example: EUR
ContractProvisioningResponse:
type: object
properties:
user_code:
$ref: '#/components/schemas/UserCode'
verification_uri:
$ref: '#/components/schemas/VerificationUri'
required:
- user_code
- verification_uri
UserCode:
type: string
example: A1B2C3
VerificationUri:
type: string
format: url
example: https://authorization-server.example.com/verify
# ConfirmationRequest:
# type: object
# properties:
# auth_code:
# type: string
# example: LRS7CLedX3ws5fiJO4KenKe
# required:
# - auth_code
requestBodies:
ContractProvisioningRequest:
content:
application/json:
schema:
$ref: '#/components/schemas/ContractProvisioningRequest'
ConfirmationRequest:
content:
application/json:
schema:
$ref: '#/components/schemas/ConfirmationRequest'