-
Notifications
You must be signed in to change notification settings - Fork 24
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
Update sim-swap-notification-subscription.yaml #111
Conversation
Align with CloudEvents model for subscription
🦙 MegaLinter status: ✅ SUCCESS
See detailed report in MegaLinter reports |
Fix MegaLinter
Fixes MegaLinter
Fix MegaLinter issue
Fix MegaLinter
Fix MegaLinter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bigludo7 I have added some points.
Wdyt?
💯 thanks @maxl2287 for your review ! |
I added an issue for this behaviour / bug: |
Updated after https://github.com/maxl2287 review.
fix megaLinter issues
Fixed all points raised by @maxl2287 (I hope so) |
Updated following @gregory1g proposal
Added quote for phoneNumber in the examples.
LGTM 🎉 |
fixed DEACTIVE to INACTIVE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updating the name of the file to sim-swap-subscriptions.yaml
?
At least the plural -subscriptions
has to be at the end.
Removing -notifications-
would also include updating the whole file to remove Notifications
also for, e.g., tags
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bigludo7 I added some comments.
Please take a look 🐦
security: | ||
- openId: | ||
- sim-swap:subscriptions:create | ||
- sim-swap-subscriptions:org.camaraproject.sim-swap-subscriptions.v0.swapped:read |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For creating a subscription we should use here create
as an action.
security: | ||
- openId: | ||
- sim-swap:subscriptions:read | ||
- sim-swap-subscriptions:read |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sim-swap-subscriptions:org.camaraproject.sim-swap-subscriptions.v0.swapped:read
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hummm - I dont think so regarding the template yaml for the GET operation which is on the subscription itself and not the event.
summary: 'Retrieve a sim swap event subscription for a phone number' | ||
description: retrieve event subscription information for a given subscription. | ||
operationId: retrieveSubscription | ||
security: | ||
- openId: | ||
- sim-swap:subscriptions:read | ||
- sim-swap-subscriptions:read |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sim-swap-subscriptions:org.camaraproject.sim-swap-subscriptions.v0.swapped:read
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hummm - I dont think so regarding the template yaml for the GET operation which is on the subscription itself and not the event.
summary: 'Delete a sim swap event subscription' | ||
operationId: deleteSubscription | ||
description: delete a given event subscription. | ||
security: | ||
- openId: | ||
- sim-swap:subscriptions:delete | ||
- sim-swap-subscriptions:delete |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sim-swap-subscriptions:org.camaraproject.sim-swap-subscriptions.v0.swapped:delete
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hummm - I dont think so regarding the template yaml for the DELETE operation which is on the subscription itself and not the event.
@@ -239,33 +262,33 @@ paths: | |||
$ref: "#/components/responses/Generic503" | |||
delete: | |||
tags: | |||
- Sim swap notification subscription | |||
- Sim Swap Notification Subscription | |||
summary: 'Delete a sim swap event subscription' | |||
operationId: deleteSubscription | |||
description: delete a given event subscription. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
two whitespaces between a given
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated the tag
types: | ||
description: | | ||
Camara Event types eligible for subscription: | ||
- org.camaraproject.sim-swap-subscriptions.v0.swapped: receive a notification when a sim swap is performed on the line. | ||
type: array | ||
example: | ||
- "org.camaraproject.sim-swap-subscriptions.v0.swapped" | ||
items: | ||
type: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend adding here like for DeviceLocation and DeviceStatus the minItems and maxItems and set them to 1
types:
description: |
Camara Event types eligible to be delivered by this subscription.
Note: As of now we enforce to have only event type per subscription.
type: array
minItems: 1
maxItems: 1
items:
$ref: "#/components/schemas/SubscriptionEventType"
Also think about using here the enum
, even for the single one.
It enforces then to avoid requesting with unsupported event-types here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done !
types: | ||
description: | | ||
Camara Event types eligible for subscription: | ||
- org.camaraproject.sim-swap-subscriptions.v0.swapped: receive a notification when a sim swap is performed on the line. | ||
Note: for the Commonalities meta-release v0.4 we enforce to have only event type per subscription then for following meta-release use of array MUST be decided | ||
at API project level. | ||
type: array | ||
items: | ||
type: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same like for the request.
Extracting the types
into an own component and setting the min and maxItems
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done !
…-subscriptions.yaml Updated following Max review
You're right - done ! |
@maxl2287 I've considered all your comments. |
@maxl2287 @gregory1g @fernandopradocabrillo Gentle reminder for this one. As it is opened & discussed for long time are they still pending issue on your side preventing merging? |
LGTM thanks @bigludo7 👌🏻 |
Co-authored-by: Fernando Prado Cabrillo <fernando.pradocabrillo@telefonica.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for the work on the subscriptios @bigludo7 ! |
What type of PR is this?
Add one of the following kinds:
What this PR does / why we need it:
Modify sim-swap-notification-subscription.yaml accordingly to the new format defined in Commonalities.
This format is aligned with CloudEvents.
Which issue(s) this PR fixes:
Fixes #108
#113
Special notes for reviewers:
Changelog input
Additional documentation
This section can be blank.