Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(openapi): Add inheritance beetween Event and QosStatusChangedEvent #177

40 changes: 14 additions & 26 deletions code/API_definitions/qod-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ paths:
content:
application/json:
schema:
$ref: "#/components/schemas/EventNotification"
$ref: "#/components/schemas/Event"
responses:
"204":
description: Successful notification
Expand Down Expand Up @@ -699,7 +699,7 @@ components:
allOf:
- $ref: "#/components/schemas/TimeUnitEnum"
- example: Minutes

TimeUnitEnum:
type: string
enum:
Expand Down Expand Up @@ -732,18 +732,19 @@ components:
- Gbps
- Tbps

EventNotification:
Event:
description: The event being notified
type: object
required:
- event
- eventType
- eventTime
properties:
event:
$ref: "#/components/schemas/Event"

Event:
description: The event being notified
anyOf:
- $ref: "#/components/schemas/QosStatusChangedEvent"
eventid:
$ref: "#/components/schemas/EventId"
eventType:
$ref: "#/components/schemas/EventType"
eventTime:
$ref: "#/components/schemas/EventTime"
discriminator:
propertyName: eventType
mapping:
Expand All @@ -767,22 +768,9 @@ components:
example: 2023-05-30T10:18:28Z
description: Date time when the event occurred

EventBase:
type: object
required:
- eventType
- eventTime
properties:
eventid:
$ref: "#/components/schemas/EventId"
eventType:
$ref: "#/components/schemas/EventType"
eventTime:
$ref: "#/components/schemas/EventTime"

QosStatusChangedEvent:
allOf:
- $ref: "#/components/schemas/EventBase"
- $ref: "#/components/schemas/Event"
- type: object
properties:
eventDetail:
Expand All @@ -799,7 +787,7 @@ components:
statusInfo:
$ref: "#/components/schemas/StatusInfo"
required:
- eventDetail
- eventDetail

StatusInfo:
description: |
Expand Down