-
Notifications
You must be signed in to change notification settings - Fork 60
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
fix(openapi): Add inheritance beetween Event and QosStatusChangedEvent #177
fix(openapi): Add inheritance beetween Event and QosStatusChangedEvent #177
Conversation
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
This new proposal to model inheritance may work but I have concerns about not being totally aligned with the OAS specification, which states that:
You are now moving the item that defined the child event out of the array. Even if this JSON-schema is valid and may work for code generation, it is not what it is shown in all examples in the specs, which follow the approach to model the child properties within the https://swagger.io/docs/specification/data-models/inheritance-and-polymorphism/
I think it is safer to follow the examples in the spec as much as possible, as others may claim that their tools don't work well with this simplification. |
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.
As commented in camaraproject/WorkingGroups#255 (review), It is OK to model the event following inheritance instead of polymorphism but we should stick as much as possible to the examples in the spec
Comes back to common usage of allOf following suggestions of @jlurien |
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
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
@akoshunyadi @eric-murray can you have a final look before I merge? |
Small point, but the Swagger editor does not create a valid example for the notification request body, so I'd suggest to put an example of type But otherwise it looks fine and I'll add my approval. |
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, but then the guideline should be updated, which contains that additional layer of eventNotification
…o on NETWORK_TERMINATED
@eric-murray, |
An important point we should clarify before we merge:
The guideline defines @patrice-conil What's the rational for this change? |
@hdamker, BR, |
I think the reason to have an
In QoD we have implicit notifcations`, and as Patrick comments it adds an additional level. The decision should come from Commonalities. We may decide to move all attributes of If we have to take a quick decision here, I think we should stick to Commonalities, or keep it open until a new resolution is taken there, which may take some time. |
@jlurien @patrice-conil My view is that if we wait for a commonality decision now, we would delay the release for several weeks. I would go with the current structure in commonalities and the proposal above from @jlurien. But that's just my view. Beyond that I expect changes of the notification/subscription structure as soon there will be common OAS for notification endpoint on listener side(see camaraproject/Commonalities#8). We need to adapt in upcoming release. |
Please take a look at camaraproject/Commonalities#8 (comment) and provide your feedback in commonalities |
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
@jlurien @eric-murray @akoshunyadi @bigludo7 Just waiting for one other approval of the latest changes before I merge. |
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
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
Happy to approve to progress this, but at some point we should add an explicit example for the |
Example added thanks to @eric-murray |
What type of PR is this?
What this PR does / why we need it:
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.
As QosStatusChangedEvent extends Event we can now send it as payload
Which issue(s) this PR fixes:
Fixes #174
Special notes for reviewers:
BREAKING CHANGE: Remove EventNotification to embed Event as notification payload(reverted, see bbe5812)This specification replaces multiple inheritance schemes with single inheritance. This way the generator will stop to generate anonymous XXXAllOf.java classes which are not useful at all.
That says ClassA inherit from ClassB and anonymous inlined object containing property prop1 is replaced by:
That means: ClassA extends ClassB and contains property prop1.
Changelog input
Additional documentation