-
Notifications
You must be signed in to change notification settings - Fork 245
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
feat: Remove duplicate information in the initiate negotiation api request #3549
feat: Remove duplicate information in the initiate negotiation api request #3549
Conversation
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #3549 +/- ##
===========================================
- Coverage 72.45% 18.16% -54.30%
===========================================
Files 871 877 +6
Lines 17423 17566 +143
Branches 993 995 +2
===========================================
- Hits 12624 3190 -9434
- Misses 4382 14289 +9907
+ Partials 417 87 -330
☔ View full report in Codecov by Sentry. |
79ecb8d
to
5ec20a1
Compare
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 think there are two ways of doing this.
The way you followed brings in a Dto class, that we decided to remove some weeks ago.
Plus, a new Dto requires a two steps transformation (json -> dto -> model) that we don't really want.
I see that in this case they are needed because there is no way to define different validators and transformers for the same entity based on the controller they are used.
A new api version should be motivated for substantial changes, and I think the changes here are really little and they can be handled in the same version, as we did in the past in other APIs following this approach:
- deprecate the properties on the schema
- broaden the validator to accept the deprecated field as optional
- in the transformer, check if the deprecated properties are used, in that case, print a
warning
log
to get a grasp, we did the same thing when we renamed providerUrl
to counterPartyAddress
in the CatalogRequest
, please look at JsonObjectToCatalogRequestTransformer
.
After a short discussion with @wolf4ood we decided to go for a new Dto that's why I have implemented it like this. Unfortunately I was not aware about such a decision probably Enrico neither. But indeed introducing a new api version for such a small change would cause inconvenience. I will close this PR and implement the second way you described. |
My two cents, it's fine to supports different fields on the same Object, We did the same with Asset AP, by changing the shape cause the v3 :) |
I'd propose compromise then: how do you see to add the Dto for the deprecated endpoint and have the new one without it? In that case the Dto will be removed when the deprecation will expire |
For me it's fine also to have it in a deprecation way, as long as it will be deprecated soon 😂 But i guess at this point as you wrote we could remove also the In that case I'm fine with supporting only the |
If dto comes into consideration what would help to not frequently change the core model whenever an api schema changes, why then not keep it like implemented here and remove it when it gets deprecated instead of changing it now and remove it afterward 😂 |
because when someone takes care of removing deprecated stuff they just want to delete stuff that's marked as deprecated without having to do stuff that requires specific knowledge.
I agree with that, also the So, having an optional |
👍 |
This pull request is stale because it has been open for 7 days with no activity. |
What this PR changes/adds
Removes the duplicate information in the initiate negotiation api request
Why it does that
The offerId and the policy/@id have the same value, because they're representing the same information, so there's no point in offerId, as the policy is mandatory anyway.
Further notes
This introduces new api version of negotiation to avoid any braking changes
Linked Issue(s)
Closes #3395
Please be sure to take a look at the contributing guidelines and our etiquette for pull requests.