From 25a7db1564776ce4e054e7d1207cc9d80ce229bb Mon Sep 17 00:00:00 2001 From: Patrice Conil Date: Fri, 30 Jun 2023 16:19:20 +0200 Subject: [PATCH 1/6] fix(openapi): Add inheritance beetween Event and QosStatusChangedEvent Fix ability to send QosStatusChangedEvent from client side (Telco) to the server side of /notifications (QoS API Consumer) for those who use strongly typed Languages BREAKING CHANGE: Remove EventNotification to embed Event as notification payload --- code/API_definitions/qod-api.yaml | 122 ++++++++++++++---------------- 1 file changed, 55 insertions(+), 67 deletions(-) diff --git a/code/API_definitions/qod-api.yaml b/code/API_definitions/qod-api.yaml index 0c330c5b82..a37fc41c36 100644 --- a/code/API_definitions/qod-api.yaml +++ b/code/API_definitions/qod-api.yaml @@ -113,7 +113,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/EventNotification" + $ref: "#/components/schemas/Event" responses: "204": description: Successful notification @@ -400,34 +400,34 @@ components: SessionInfo: description: Session related information. + type: object allOf: - $ref: "#/components/schemas/CreateSession" - - type: object - properties: - sessionId: - $ref: "#/components/schemas/SessionId" - startedAt: - type: integer - example: 1639479600 - description: Timestamp of session start in seconds since Unix epoch - format: int64 - expiresAt: - type: integer - example: 1639566000 - description: Timestamp of session expiration if the session was not deleted, in seconds since Unix epoch - format: int64 - qosStatus: - $ref: "#/components/schemas/QosStatus" - messages: - type: array - items: - $ref: "#/components/schemas/Message" - required: - - sessionId - - duration - - startedAt - - expiresAt - - qosStatus + properties: + sessionId: + $ref: "#/components/schemas/SessionId" + startedAt: + type: integer + example: 1639479600 + description: Timestamp of session start in seconds since Unix epoch + format: int64 + expiresAt: + type: integer + example: 1639566000 + description: Timestamp of session expiration if the session was not deleted, in seconds since Unix epoch + format: int64 + qosStatus: + $ref: "#/components/schemas/QosStatus" + messages: + type: array + items: + $ref: "#/components/schemas/Message" + required: + - sessionId + - duration + - startedAt + - expiresAt + - qosStatus CreateSession: description: Attributes required to create a session @@ -699,7 +699,7 @@ components: allOf: - $ref: "#/components/schemas/TimeUnitEnum" - example: Minutes - + TimeUnitEnum: type: string enum: @@ -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: @@ -767,39 +768,26 @@ 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: + type: object allOf: - - $ref: "#/components/schemas/EventBase" - - type: object - properties: - eventDetail: - type: object - description: Event details depending on the event type - required: - - sessionId - - qosStatus - properties: - sessionId: - $ref: "#/components/schemas/SessionId" - qosStatus: - $ref: "#/components/schemas/EventQosStatus" - statusInfo: - $ref: "#/components/schemas/StatusInfo" + - $ref: "#/components/schemas/Event" + properties: + eventDetail: + type: object + description: Event details depending on the event type required: - - eventDetail + - sessionId + - qosStatus + properties: + sessionId: + $ref: "#/components/schemas/SessionId" + qosStatus: + $ref: "#/components/schemas/EventQosStatus" + statusInfo: + $ref: "#/components/schemas/StatusInfo" + required: + - eventDetail StatusInfo: description: | From 679ffbfb507fb79fdc21ea5a6408d0998afd4045 Mon Sep 17 00:00:00 2001 From: Patrice Conil Date: Mon, 3 Jul 2023 11:15:23 +0200 Subject: [PATCH 2/6] fix(openapi): Align allOf syntax with openapi spec samples --- code/API_definitions/qod-api.yaml | 84 +++++++++++++++---------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/code/API_definitions/qod-api.yaml b/code/API_definitions/qod-api.yaml index a37fc41c36..973f1c3239 100644 --- a/code/API_definitions/qod-api.yaml +++ b/code/API_definitions/qod-api.yaml @@ -400,34 +400,34 @@ components: SessionInfo: description: Session related information. - type: object allOf: - $ref: "#/components/schemas/CreateSession" - properties: - sessionId: - $ref: "#/components/schemas/SessionId" - startedAt: - type: integer - example: 1639479600 - description: Timestamp of session start in seconds since Unix epoch - format: int64 - expiresAt: - type: integer - example: 1639566000 - description: Timestamp of session expiration if the session was not deleted, in seconds since Unix epoch - format: int64 - qosStatus: - $ref: "#/components/schemas/QosStatus" - messages: - type: array - items: - $ref: "#/components/schemas/Message" - required: - - sessionId - - duration - - startedAt - - expiresAt - - qosStatus + - type: object + properties: + sessionId: + $ref: "#/components/schemas/SessionId" + startedAt: + type: integer + example: 1639479600 + description: Timestamp of session start in seconds since Unix epoch + format: int64 + expiresAt: + type: integer + example: 1639566000 + description: Timestamp of session expiration if the session was not deleted, in seconds since Unix epoch + format: int64 + qosStatus: + $ref: "#/components/schemas/QosStatus" + messages: + type: array + items: + $ref: "#/components/schemas/Message" + required: + - sessionId + - duration + - startedAt + - expiresAt + - qosStatus CreateSession: description: Attributes required to create a session @@ -769,25 +769,25 @@ components: description: Date time when the event occurred QosStatusChangedEvent: - type: object allOf: - $ref: "#/components/schemas/Event" - properties: - eventDetail: - type: object - description: Event details depending on the event type - required: - - sessionId - - qosStatus + - type: object properties: - sessionId: - $ref: "#/components/schemas/SessionId" - qosStatus: - $ref: "#/components/schemas/EventQosStatus" - statusInfo: - $ref: "#/components/schemas/StatusInfo" - required: - - eventDetail + eventDetail: + type: object + description: Event details depending on the event type + required: + - sessionId + - qosStatus + properties: + sessionId: + $ref: "#/components/schemas/SessionId" + qosStatus: + $ref: "#/components/schemas/EventQosStatus" + statusInfo: + $ref: "#/components/schemas/StatusInfo" + required: + - eventDetail StatusInfo: description: | From b43a85addabb37fa16801cba0b5c2566f7dbccc9 Mon Sep 17 00:00:00 2001 From: Patrice Conil Date: Wed, 12 Jul 2023 11:33:03 +0200 Subject: [PATCH 3/6] fix(openapi): Add QOS_STATUS_CHANGED as Event sample , and remove typo on NETWORK_TERMINATED --- code/API_definitions/qod-api.yaml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/code/API_definitions/qod-api.yaml b/code/API_definitions/qod-api.yaml index 973f1c3239..b3206eae8c 100644 --- a/code/API_definitions/qod-api.yaml +++ b/code/API_definitions/qod-api.yaml @@ -749,6 +749,17 @@ components: propertyName: eventType mapping: QOS_STATUS_CHANGED: "#/components/schemas/QosStatusChangedEvent" + example: + { + "eventId": "5698d710-9b1b-4695-a958-7b228f08128c", + "eventType": "QOS_STATUS_CHANGED", + "eventTime": "2023-05-30T10:18:28Z", + "eventDetail": { + "sessionId": "7698d710-98b7-4695-a958-7b228f08128c", + "qosStatus": "UNAVAILABLE", + "statusInfo": "DURATION_EXPIRED" + } + } EventId: type: string @@ -797,7 +808,7 @@ components: type: string enum: - DURATION_EXPIRED - - NETWORK_TERMINATED¡ + - NETWORK_TERMINATED Device: description: | From bbe5812db50f1b6bd0fa3f6b58bade2213a1fd70 Mon Sep 17 00:00:00 2001 From: Patrice Conil Date: Mon, 17 Jul 2023 09:06:57 +0200 Subject: [PATCH 4/6] fix(openapi): Re-introduce EventNotification to be compliant with current guidelines --- code/API_definitions/qod-api.yaml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/code/API_definitions/qod-api.yaml b/code/API_definitions/qod-api.yaml index b3206eae8c..5cb78c031f 100644 --- a/code/API_definitions/qod-api.yaml +++ b/code/API_definitions/qod-api.yaml @@ -113,7 +113,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Event" + $ref: "#/components/schemas/EventNotification" responses: "204": description: Successful notification @@ -732,6 +732,18 @@ components: - Gbps - Tbps + EventNotification: + type: object + required: + - event + properties: + event: + $ref: "#/components/schemas/Event" + subscriptionId: + type: string + description: 'The ID of explicit subscription or none in case of implicit subscription' + example: '7698d710-98b7-4695-a958-7b228f08128c' + Event: description: The event being notified type: object @@ -739,7 +751,7 @@ components: - eventType - eventTime properties: - eventid: + eventId: $ref: "#/components/schemas/EventId" eventType: $ref: "#/components/schemas/EventType" From 96c6b0925b53705200562d314d7c8226c7fe9638 Mon Sep 17 00:00:00 2001 From: Patrice Conil Date: Mon, 17 Jul 2023 11:48:25 +0200 Subject: [PATCH 5/6] fix(openapi): Rename subscriptionId into eventSubscriptionId --- code/API_definitions/qod-api.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/API_definitions/qod-api.yaml b/code/API_definitions/qod-api.yaml index 5cb78c031f..17eed447d6 100644 --- a/code/API_definitions/qod-api.yaml +++ b/code/API_definitions/qod-api.yaml @@ -739,7 +739,7 @@ components: properties: event: $ref: "#/components/schemas/Event" - subscriptionId: + eventSubscriptionId: type: string description: 'The ID of explicit subscription or none in case of implicit subscription' example: '7698d710-98b7-4695-a958-7b228f08128c' From f729fb6b3f7a8ae17ee2555d69c3bdda254e4f01 Mon Sep 17 00:00:00 2001 From: Patrice Conil Date: Thu, 20 Jul 2023 10:33:53 +0200 Subject: [PATCH 6/6] fix(openapi): Add EventNotification sample in callback --- code/API_definitions/qod-api.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/code/API_definitions/qod-api.yaml b/code/API_definitions/qod-api.yaml index 17eed447d6..a9af3901e8 100644 --- a/code/API_definitions/qod-api.yaml +++ b/code/API_definitions/qod-api.yaml @@ -742,7 +742,17 @@ components: eventSubscriptionId: type: string description: 'The ID of explicit subscription or none in case of implicit subscription' - example: '7698d710-98b7-4695-a958-7b228f08128c' + example: + { + "eventId": "5698d710-9b1b-4695-a958-7b228f08128c", + "eventType": "QOS_STATUS_CHANGED", + "eventTime": "2023-05-30T10:18:28Z", + "eventDetail": { + "sessionId": "7698d710-98b7-4695-a958-7b228f08128c", + "qosStatus": "UNAVAILABLE", + "statusInfo": "DURATION_EXPIRED" + } + } Event: description: The event being notified