Skip to content

Commit 1913703

Browse files
committed
Fixing spec issues
1 parent 70d92c6 commit 1913703

File tree

1 file changed

+81
-73
lines changed

1 file changed

+81
-73
lines changed

2.0/api/2.0.spec.yaml

Lines changed: 81 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
openapi: 3.1.0
1+
openapi: 3.0.0
22
info:
3-
title: OSCP API Specification
4-
description: OSCP API Specification
5-
version: 1.0.0
3+
title: OSCP 2.0 API Specification
4+
description: OSCP 2.0 API Specification
5+
version: 2.0.0
6+
7+
security:
8+
- bearerAuth: [ ]
69

710
paths:
811
/oscp/fp/2.0/register:
@@ -1183,18 +1186,24 @@ paths:
11831186
$ref: '#/components/schemas/ErrorBody'
11841187

11851188
components:
1189+
securitySchemes:
1190+
bearerAuth:
1191+
type: http
1192+
scheme: bearer
11861193

11871194
headers:
11881195
Authorization:
11891196
description: Authorization header
11901197
schema:
11911198
type: string
11921199
required: true
1200+
11931201
X-Request-ID:
11941202
description: Unique request ID of this message.
11951203
schema:
11961204
type: string
11971205
required: true
1206+
11981207
X-Correlation-ID:
11991208
description: Reference to a request ID that this message is a response to.
12001209
schema:
@@ -1226,19 +1235,19 @@ components:
12261235
properties:
12271236
version:
12281237
type: string
1229-
required: true
12301238
description: Version of the API
12311239
base_url:
12321240
type: string
1233-
required: true
12341241
description: Base URL of the API
1242+
required:
1243+
- version
1244+
- base_url
12351245

12361246
RequiredBehaviour:
12371247
type: object
12381248
properties:
12391249
heartbeat_interval:
12401250
type: integer
1241-
required: false
12421251
description: |
12431252
The interval (in seconds) in which the
12441253
sender of this response expects heartbeats to
@@ -1248,7 +1257,6 @@ components:
12481257
12491258
measurement_configuration:
12501259
type: array
1251-
required: false
12521260
description: |
12531261
For determining how measurements are
12541262
aggregated. Providing multiple configurations
@@ -1269,26 +1277,24 @@ components:
12691277
offline_mode_at:
12701278
type: string
12711279
format: date-time
1272-
required: false
12731280
description: |
12741281
A time in the future that indicates when, in case no more heartbeat
12751282
messages are received, it can be assumed the receiving party is
12761283
offline (unavailable). This time SHOULD be updated with every
12771284
heartbeat message.
12781285
12791286
Registration:
1280-
schema:
1281-
type: object
1282-
properties:
1283-
token:
1284-
type: string
1285-
required: true
1286-
version_url:
1287-
type: array
1288-
items:
1289-
schema:
1290-
$ref: '#/components/schemas/VersionURL'
1291-
required: true
1287+
type: object
1288+
properties:
1289+
token:
1290+
type: string
1291+
version_url:
1292+
type: array
1293+
items:
1294+
$ref: '#/components/schemas/VersionURL'
1295+
required:
1296+
- token
1297+
- version_url
12921298

12931299
CapacityForecastType:
12941300
type: string
@@ -1322,99 +1328,103 @@ components:
13221328
properties:
13231329
capacity:
13241330
type: string
1325-
required: true
13261331
phase:
13271332
$ref: '#/components/schemas/PhaseIndicator'
1328-
required: true
13291333
unit:
13301334
$ref: '#/components/schemas/ForecastedBlockUnit'
1331-
required: true
13321335
end_time:
13331336
type: string
13341337
format: date-time
1335-
required: true
13361338
start_time:
13371339
type: string
13381340
format: date-time
1339-
required: true
1341+
required:
1342+
- capacity
1343+
- phase
1344+
- unit
1345+
- end_time
1346+
- start_time
13401347

13411348
GroupCapacityForecast:
1342-
schema:
1343-
type: object
1344-
properties:
1345-
group_id:
1346-
type: string
1347-
required: true
1348-
forecasted_blocks:
1349-
type: array
1350-
required: true
1351-
items:
1352-
$ref: '#/components/schemas/ForecastedBlock'
1353-
type:
1354-
$ref: '#/components/schemas/CapacityForecastType'
1355-
required: true
1349+
type: object
1350+
properties:
1351+
group_id:
1352+
type: string
1353+
forecasted_blocks:
1354+
type: array
1355+
items:
1356+
$ref: '#/components/schemas/ForecastedBlock'
1357+
type:
1358+
$ref: '#/components/schemas/CapacityForecastType'
1359+
required:
1360+
- group_id
1361+
- forecasted_blocks
1362+
- type
13561363

13571364
GroupComplianceError:
13581365
type: object
13591366
properties:
13601367
message:
13611368
type: string
1362-
required: true
13631369
forecasted_blocks:
13641370
type: array
1365-
required: false
13661371
items:
13671372
$ref: '#/components/schemas/ForecastedBlock'
1373+
required:
1374+
- message
13681375

13691376
UpdateGroupMeasurements:
13701377
type: object
13711378
properties:
13721379
group_id:
13731380
type: string
1374-
required: true
13751381
measurements:
13761382
type: array
1377-
required: true
13781383
items:
13791384
$ref: '#/components/schemas/EnergyMeasurement'
1385+
required:
1386+
- group_id
1387+
- measurements
13801388

13811389
UpdateAssetMeasurements:
1382-
group_id:
1383-
type: string
1384-
required: true
1385-
measurements:
1386-
type: array
1387-
required: true
1388-
items:
1389-
$ref: '#/components/schemas/AssetMeasurement'
1390+
type: object
1391+
properties:
1392+
group_id:
1393+
type: string
1394+
measurements:
1395+
type: array
1396+
items:
1397+
$ref: '#/components/schemas/AssetMeasurement'
1398+
required:
1399+
- group_id
1400+
- measurements
13901401

13911402
EnergyMeasurement:
13921403
type: object
13931404
properties:
13941405
value:
13951406
type: number
13961407
format: double
1397-
required: true
13981408
phase:
13991409
$ref: '#/components/schemas/PhaseIndicator'
1400-
required: true
14011410
unit:
14021411
$ref: '#/components/schemas/EnergyMeasurementUnit'
1403-
required: true
14041412
energy_type:
14051413
$ref: '#/components/schemas/EnergyType'
1406-
required: false
14071414
direction:
14081415
$ref: '#/components/schemas/EnergyFlowDirection'
1409-
required: true
14101416
measure_time:
14111417
type: string
14121418
format: date-time
1413-
required: true
14141419
initial_measure_time:
14151420
type: string
14161421
format: date-time
1417-
required: false
1422+
required:
1423+
- value
1424+
- phase
1425+
- unit
1426+
- direction
1427+
- measure_time
14181428

14191429
EnergyFlowDirection:
14201430
type: string
@@ -1437,23 +1447,20 @@ components:
14371447
- 'KWH'
14381448

14391449
AssetMeasurement:
1450+
type: object
14401451
properties:
14411452
asset_id:
14421453
type: string
1443-
required: true
14441454
asset_category:
14451455
type: string
1446-
required: true
14471456
energy_measurement:
1448-
type: object
1449-
schema:
1450-
$ref: '#/components/schemas/EnergyMeasurement'
1451-
required: false
1457+
$ref: '#/components/schemas/EnergyMeasurement'
14521458
instantaneous_measurement:
1453-
type: object
1454-
schema:
1455-
$ref: '#/components/schemas/InstantaneousMeasurement'
1456-
required: false
1459+
$ref: '#/components/schemas/InstantaneousMeasurement'
1460+
required:
1461+
- asset_id
1462+
- asset_category
1463+
14571464
AssetCategory:
14581465
type: string
14591466
enum:
@@ -1468,17 +1475,18 @@ components:
14681475
value:
14691476
type: number
14701477
format: double
1471-
required: true
14721478
phase:
14731479
$ref: '#/components/schemas/PhaseIndicator'
1474-
required: true
14751480
unit:
14761481
$ref: '#/components/schemas/InstantaneousMeasurementUnit'
1477-
required: true
14781482
measure_time:
14791483
type: string
14801484
format: date-time
1481-
required: true
1485+
required:
1486+
- value
1487+
- phase
1488+
- unit
1489+
- measure_time
14821490

14831491
InstantaneousMeasurementUnit:
14841492
type: string

0 commit comments

Comments
 (0)