Refactor configuration schema in CAMARA_event_common.yaml - #670
Conversation
Renamed Config to ConfigBase and updated its description. Removed CreateSubscriptionDetail schema definition.
Added API-specific Config schema with subscriptionDetail.
Added details on the config schema split and how to define the Config schema in API projects.
Updated references to Config and SubscriptionId schemas to use local definitions instead of external files.
hdamker
left a comment
There was a problem hiding this comment.
Hi Rafal, an early review of the PR. It implements #659 correctly, repo-wide I found no remaining references to the old Config or the removed CreateSubscriptionDetail stub, and the composed wire format is unchanged. Inline suggestions below for the description gaps and two nits.
One point that doesn't fit a suggestion: some API repos already $ref the old Config anchor directly (e.g. DeviceRoamingStatus, SimSwap), and repos using the current allOf workaround inherit required: [subscriptionDetail] from the common file — after this change they must declare it themselves, otherwise subscriptionDetail silently becomes optional. Worth naming the rename and that migration step in the changelog input / release notes.
Co-authored-by: Herbert Damker <herbert.damker@telekom.de>
…move blank line in CAMARA_event_common.yaml Removed unnecessary blank line in CAMARA_event_common.yaml
Corrected minor typos and improved clarity in the description of the ConfigBase schema.
Co-authored-by: Pedro Díez García <pedro.diezgarcia@telefonica.com>
Reformat the API projects configuration schema description for better readability.
Updated the description of the 'config' field to clarify that the 'initialEvent' attribute may be omitted.
PedroDiez
left a comment
There was a problem hiding this comment.
Minor editorial
LGTM so far
…uide.md Co-authored-by: Pedro Díez García <pedro.diezgarcia@telefonica.com>
|
I have moved |
3cab77b
What type of PR is this?
What this PR does / why we need it:
Applied the
Config→ConfigBaserefactor across the Commonalities repo:artifacts/common/CAMARA_event_common.yaml— RenamedConfigtoConfigBase, removed the requiredsubscriptionDetailproperty and its internal$ref, removed the now-unusedCreateSubscriptionDetailstub.artifacts/api-templates/sample-service-subscriptions.yaml— Added a locally-definedConfigschema that extendsConfigBaseviaallOfand adds the requiredsubscriptionDetail(typed against a newly added localCreateSubscriptionDetailstub). Updated the twoconfig:property refs (inSubscriptionRequestandSubscription) to point to the local#/components/schemas/Configinstead of the common file.documentation/CAMARA-API-Event-Subscription-and-Notification-Guide.md— Added a note under theconfigattributes table explaining theConfigBase/Configsplit and showing theallOfpattern API projects must follow, with a pointer to the updated template.Moved
initialEventout of the Commonalities-ownedConfigBaseinto the API-project-ownedConfigschema (alongsidesubscriptionDetail).ConfigBasenow only defines the two truly common attributes,subscriptionExpireTimeandsubscriptionMaxEvents.initialEventis documented as a predefined, optional attribute that each API project MAY include in its ownConfigschema, or omit if sending a notification at subscription creation time does not make sense for its event type(s).Migration required for consuming API repos:
ConfiginCAMARA_event_common.yamlis renamed toConfigBase. Any API repo that currently does$ref: "../common/CAMARA_event_common.yaml#/components/schemas/Config"must update that$refto.../schemas/ConfigBase, and explicitly addrequired: [subscriptionDetail]in their own localallOfextension — this PR removessubscriptionDetail(and itsrequiredentry) from the common schema, so it is no longer inherited automatically. Repos that skip therequiredstep will havesubscriptionDetailsilently become optional.Which issue(s) this PR fixes:
Fixes #659
Does this PR introduce a breaking change?
Special notes for reviewers:
initialEventwas originally kept inConfigBasealongsidesubscriptionExpireTime/subscriptionMaxEvents, forcing every API project to inherit it viaallOfeven when it made no sense for their event type(s) (e.g. no meaningful "current state" to check at subscription time). SinceConfigis already the per-API extension point forsubscriptionDetail,initialEventfollows the same pattern: it is a Commonalities-predefined attribute (same name/type), but declared - and therefore includable or omittable - in each API project's ownConfigschema with customised description if needed.Changelog input
Additional documentation