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
Clarify behaviour of setter/builder methods with list / map parameter #284
Comments
I agree @jmini. Implementations should copy the contents of the list/map, not use the actual instance. |
jmini
added a commit
to jmini/microprofile-open-api
that referenced
this issue
Oct 13, 2018
See eclipse#284 Signed-off-by: Jeremie Bresson <dev@jmini.fr>
PR for |
This was referenced Oct 23, 2018
PR for |
Both PRs are merged. Closing this. |
Azquelt
pushed a commit
to Azquelt/microprofile-open-api
that referenced
this issue
Mar 17, 2022
Fixed release token.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When a list or a map instance is passed to as setter method (or a builder) the implementation should create a copy of the items.
Examples:
In my opinion this should work.
In my opinion the second addition in the map should not modify the map in the OpenAPI instance.
For both cases, this might be a decision that is taken at implementation level (I am open for discussion).
My propositions:
For 1.1:
Relax the TCK in oder to allow implementation to do some copy of map/list internally. Right now some code position in
ModelConstructionTest
are assuming to get the same instance.The check should check for equality instead, because the list/map content must be the same but the list/map instance can be an other one.
NB: I have prepared the change, but I made it on top of #283, so lets go with this first.
For 2.0:
Depending on the consensus, the TCK should enforce the implementation to do a copy of the map in the list/map setters.
I think it would be better so, but this is subject to debate.
I can accept this to be only a constraint that I add for my own implementations.
The text was updated successfully, but these errors were encountered: