From 50fd90d5f830c4d83ba020a0fe3a0cd2e25596ce Mon Sep 17 00:00:00 2001 From: rartych Date: Fri, 24 Jul 2026 00:12:07 +0200 Subject: [PATCH 1/3] Restore local Config schema and fix subscription example/schema drift - Restore Config schema to its fully-local form (subscriptionDetail, subscriptionExpireTime, subscriptionMaxEvents) instead of extending the shared CAMARA_event_common.yaml Config via allOf, per r3.3. Drop the initialEvent property that only existed via the shared schema and was not part of the local r3.3 Config. - Remove the now-invalid initialEvent: true from the Subscription schema's inline example, and fix that same example's subscriptionDetail.device.phoneNumber nesting to the flat subscriptionDetail.phoneNumber shape defined by CreateSubscriptionDetail, consistent with every other example in the file. - Simplify EventSubscriptionStarted/Updated/Ended to directly the shared SubscriptionStarted/Updated/Ended schemas from CAMARA_event_common.yaml, removing the local device/DeviceResponse field injection. That injection deviated from the canonical Commonalities event-subscription template (sample-service-subscriptions.yaml), which references these Commonalities-owned lifecycle payload schemas directly with no local device field. --- .../sim-swap-subscriptions.yaml | 53 +++++++++---------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/code/API_definitions/sim-swap-subscriptions.yaml b/code/API_definitions/sim-swap-subscriptions.yaml index 5cc1c9f..2a32c3e 100644 --- a/code/API_definitions/sim-swap-subscriptions.yaml +++ b/code/API_definitions/sim-swap-subscriptions.yaml @@ -359,13 +359,27 @@ components: $ref: "../common/CAMARA_common.yaml#/components/schemas/PhoneNumber" Config: - description: Config schema allowing for device to be specified as part of subscription detail - allOf: - - $ref: "../common/CAMARA_event_common.yaml#/components/schemas/Config" - - type: object - properties: - subscriptionDetail: - $ref: "#/components/schemas/CreateSubscriptionDetail" + description: | + Implementation-specific configuration parameters needed by the subscription manager for acquiring events. + In CAMARA we have predefined attributes like `subscriptionExpireTime` or `subscriptionMaxEvents` to limit subscription lifetime. + Event type attributes must be defined in `subscriptionDetail` + type: object + required: + - subscriptionDetail + properties: + subscriptionDetail: + $ref: "#/components/schemas/CreateSubscriptionDetail" + subscriptionExpireTime: + type: string + format: date-time + example: 2025-01-17T13:18:23.682Z + description: The subscription expiration time (in date-time format) requested by the API consumer. It must follow [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) and must have time zone. + subscriptionMaxEvents: + type: integer + description: | + Identifies the maximum number of event reports to be generated (>=1) requested by the API consumer - Once this number is reached, the subscription ends. + minimum: 1 + example: 5 ApiEventType: type: string @@ -467,11 +481,9 @@ components: - "org.camaraproject.sim-swap-subscriptions.v0.swapped" config: subscriptionDetail: - device: - phoneNumber: "+123456789" + phoneNumber: "+123456789" subscriptionExpireTime: "2024-07-17T13:18:23.682Z" subscriptionMaxEvents: 5 - initialEvent: true startsAt: "2024-07-03T21:12:02.871Z" expiresAt: "2024-07-03T21:12:02.871Z" status: ACTIVE @@ -599,12 +611,7 @@ components: - type: object properties: data: - allOf: - - type: object - properties: - device: - $ref: "../common/CAMARA_common.yaml#/components/schemas/DeviceResponse" - - $ref: "../common/CAMARA_event_common.yaml#/components/schemas/SubscriptionStarted" + $ref: "../common/CAMARA_event_common.yaml#/components/schemas/SubscriptionStarted" EventSubscriptionUpdated: description: event structure for event subscription updated @@ -613,12 +620,7 @@ components: - type: object properties: data: - allOf: - - type: object - properties: - device: - $ref: "../common/CAMARA_common.yaml#/components/schemas/DeviceResponse" - - $ref: "../common/CAMARA_event_common.yaml#/components/schemas/SubscriptionUpdated" + $ref: "../common/CAMARA_event_common.yaml#/components/schemas/SubscriptionUpdated" EventSubscriptionEnded: description: event structure for event subscription ended @@ -627,12 +629,7 @@ components: - type: object properties: data: - allOf: - - type: object - properties: - device: - $ref: "../common/CAMARA_common.yaml#/components/schemas/DeviceResponse" - - $ref: "../common/CAMARA_event_common.yaml#/components/schemas/SubscriptionEnded" + $ref: "../common/CAMARA_event_common.yaml#/components/schemas/SubscriptionEnded" Sink: description: The address to which events shall be delivered using the selected protocol. From 6473c012a71c43558b9377ba1fd73606140844a7 Mon Sep 17 00:00:00 2001 From: rartych Date: Fri, 24 Jul 2026 14:11:30 +0200 Subject: [PATCH 2/3] Fix SUBSCRIPTION_ENDS example: remove invalid phoneNumber from SubscriptionEnded payload The SUBSCRIPTION_ENDS example's notification data included a phoneNumber field, but the SubscriptionEnded schema (from CAMARA_event_common.yaml) has never defined that property. SubscriptionEnded only contains: - terminationReason (required) - subscriptionId (required) - terminationDescription (optional) Removed the extraneous phoneNumber line so the example now conforms to the shared schema. --- code/API_definitions/sim-swap-subscriptions.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/code/API_definitions/sim-swap-subscriptions.yaml b/code/API_definitions/sim-swap-subscriptions.yaml index 2a32c3e..8093ee2 100644 --- a/code/API_definitions/sim-swap-subscriptions.yaml +++ b/code/API_definitions/sim-swap-subscriptions.yaml @@ -680,7 +680,6 @@ components: specversion: "1.0" datacontenttype: application/json data: - phoneNumber: "+123456789" terminationReason: SUBSCRIPTION_EXPIRED subscriptionId: 2ghy-55gg-7iup-yuo9 terminationDescription: subscription expire time reached From a5c86948fa45ff3f9537f6bfd3a91f2b73987f24 Mon Sep 17 00:00:00 2001 From: Rafal Artych <121048129+rartych@users.noreply.github.com> Date: Fri, 24 Jul 2026 15:18:08 +0200 Subject: [PATCH 3/3] Limits added to config --- code/API_definitions/sim-swap-subscriptions.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/code/API_definitions/sim-swap-subscriptions.yaml b/code/API_definitions/sim-swap-subscriptions.yaml index 8093ee2..0895774 100644 --- a/code/API_definitions/sim-swap-subscriptions.yaml +++ b/code/API_definitions/sim-swap-subscriptions.yaml @@ -372,13 +372,15 @@ components: subscriptionExpireTime: type: string format: date-time - example: 2025-01-17T13:18:23.682Z + maxLength: 64 + example: 2023-01-17T13:18:23.682Z description: The subscription expiration time (in date-time format) requested by the API consumer. It must follow [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) and must have time zone. subscriptionMaxEvents: type: integer - description: | - Identifies the maximum number of event reports to be generated (>=1) requested by the API consumer - Once this number is reached, the subscription ends. + format: int32 + description: Identifies the maximum number of event reports to be generated (>=1) requested by the API consumer - Once this number is reached, the subscription ends. minimum: 1 + maximum: 1000000 example: 5 ApiEventType: