From b51138ab8afe25e69eff985f6b9f148c614a5d72 Mon Sep 17 00:00:00 2001 From: Jose Luis Urien Date: Tue, 28 Jul 2026 14:46:43 +0200 Subject: [PATCH] fix(geofencing-subscriptions): resolve S-015 and S-211 validation warnings Rename local CloudEvent schema to GeofencingNotificationEvent and NotificationEventType to GeofencingEventType, eliminating the bundler name collision that caused the S-015 PascalCase warning (CloudEvent-2). Remove seven unused passthrough schema re-exports (XCorrelator, Latitude, Longitude, Source, DateTime, AccessTokenCredential, PrivateKeyJWTCredential) to resolve the S-211 unused-component warnings. Update the schema reference in geofencing-subscriptions.feature to match the renamed GeofencingNotificationEvent envelope. S-313 hints and G-004 are dismissed and documented in issue #416. --- .../geofencing-subscriptions.yaml | 38 +++++-------------- .../geofencing-subscriptions.feature | 2 +- 2 files changed, 10 insertions(+), 30 deletions(-) diff --git a/code/API_definitions/geofencing-subscriptions.yaml b/code/API_definitions/geofencing-subscriptions.yaml index 0e234c64..fc5021a4 100644 --- a/code/API_definitions/geofencing-subscriptions.yaml +++ b/code/API_definitions/geofencing-subscriptions.yaml @@ -187,7 +187,7 @@ paths: content: application/cloudevents+json: schema: - $ref: "#/components/schemas/CloudEvent" + $ref: "#/components/schemas/GeofencingNotificationEvent" examples: CIRCLE_AREA_ENTERED: $ref: "#/components/examples/CIRCLE_AREA_ENTERED" @@ -374,8 +374,6 @@ components: schema: $ref: '../common/CAMARA_common.yaml#/components/schemas/XCorrelator' schemas: - XCorrelator: - $ref: '../common/CAMARA_common.yaml#/components/schemas/XCorrelator' ErrorInfo: $ref: '../common/CAMARA_common.yaml#/components/schemas/ErrorInfo' @@ -509,7 +507,7 @@ components: - org.camaraproject.geofencing-subscriptions.v0.area-entered - org.camaraproject.geofencing-subscriptions.v0.area-left - NotificationEventType: + GeofencingEventType: type: string description: | area-entered - Event triggered when the device enters the given area @@ -681,20 +679,14 @@ components: Point: $ref: '../common/CAMARA_common.yaml#/components/schemas/Point' - Latitude: - $ref: '../common/CAMARA_common.yaml#/components/schemas/Latitude' - - Longitude: - $ref: '../common/CAMARA_common.yaml#/components/schemas/Longitude' - - CloudEvent: + GeofencingNotificationEvent: description: The notification callback. allOf: - $ref: '../common/CAMARA_event_common.yaml#/components/schemas/CloudEvent' - type: object properties: type: - $ref: "#/components/schemas/NotificationEventType" + $ref: "#/components/schemas/GeofencingEventType" discriminator: propertyName: "type" mapping: @@ -704,24 +696,12 @@ components: org.camaraproject.geofencing-subscriptions.v0.subscription-updated: "#/components/schemas/EventSubscriptionUpdated" org.camaraproject.geofencing-subscriptions.v0.subscription-ended: "#/components/schemas/EventSubscriptionEnded" - Source: - $ref: '../common/CAMARA_event_common.yaml#/components/schemas/Source' - - DateTime: - $ref: '../common/CAMARA_common.yaml#/components/schemas/DateTime' - SubscriptionId: $ref: '../common/CAMARA_event_common.yaml#/components/schemas/SubscriptionId' SinkCredential: $ref: '../common/CAMARA_event_common.yaml#/components/schemas/SinkCredential' - AccessTokenCredential: - $ref: '../common/CAMARA_event_common.yaml#/components/schemas/AccessTokenCredential' - - PrivateKeyJWTCredential: - $ref: '../common/CAMARA_event_common.yaml#/components/schemas/PrivateKeyJWTCredential' - HTTPSettings: $ref: '../common/CAMARA_event_common.yaml#/components/schemas/HTTPSettings' @@ -734,7 +714,7 @@ components: EventAreaLeft: description: Event structure for event when the device leaves the area. allOf: - - $ref: "#/components/schemas/CloudEvent" + - $ref: "#/components/schemas/GeofencingNotificationEvent" - type: object properties: data: @@ -743,7 +723,7 @@ components: EventAreaEntered: description: Event structure for event when the device enters the area. allOf: - - $ref: "#/components/schemas/CloudEvent" + - $ref: "#/components/schemas/GeofencingNotificationEvent" - type: object properties: data: @@ -752,7 +732,7 @@ components: EventSubscriptionStarted: description: Event structure for event subscription started allOf: - - $ref: "#/components/schemas/CloudEvent" + - $ref: "#/components/schemas/GeofencingNotificationEvent" - type: object properties: data: @@ -782,7 +762,7 @@ components: EventSubscriptionUpdated: description: Event structure for event subscription updated allOf: - - $ref: "#/components/schemas/CloudEvent" + - $ref: "#/components/schemas/GeofencingNotificationEvent" - type: object properties: data: @@ -812,7 +792,7 @@ components: EventSubscriptionEnded: description: Event structure for event subscription ends. allOf: - - $ref: "#/components/schemas/CloudEvent" + - $ref: "#/components/schemas/GeofencingNotificationEvent" - type: object properties: data: diff --git a/code/Test_definitions/geofencing-subscriptions.feature b/code/Test_definitions/geofencing-subscriptions.feature index 98fe3aaa..3a8671be 100644 --- a/code/Test_definitions/geofencing-subscriptions.feature +++ b/code/Test_definitions/geofencing-subscriptions.feature @@ -155,7 +155,7 @@ Feature: Camara Geofencing Subscriptions API, vwip - Operations on subscriptions When the request "createGeofencingSubscription" is sent Then the response code is 201 or 202 And an event notification of the subscribed type is received on callback-url - And notification body complies with the OAS schema at "#/components/schemas/CloudEvent" + And notification body complies with the OAS schema at "#/components/schemas/GeofencingNotificationEvent" @geofencing_subscriptions_receive_notification_when_subscription_is_updated Scenario: Receive notification for subscription-updated event