-
Notifications
You must be signed in to change notification settings - Fork 82
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 methods that return list / map #240
Comments
We agreed in today's hangout that these maps and lists should be immutable. This issue will drive the doc updates - and TCK additions. |
See also discussion of this question in #235 for But there is even an other cases to consider: the maps that is returned by: If those maps are also immutable, then I think that you will need to have operation for mutation. Because something like this will no longer be possible: components.getSchemas().put("Car", carSchema); You need to do:
Then some methods to remove elements of each maps are missing. |
good point @jmini - I agree that as part of this work we should ensure that each map has an equivalent |
Good point. There is some work that we can do in So it's both |
I think we have the same vision, but to sort out the issues. Le me rephrase what I mean.
This is part of #248. This issue is about making everything immutable. But as long as you have still When #248 is solved (the 2.0 version of the solution) we will have |
Yup, +1. In |
For lists, with Example Current:
Modification with
Modification with
I found 15 getters methods that returns a list and that needs to be modified: OpenAPI :
Operation :
PathItem :
Schema :
ServerVariable :
|
I have opened PR #273 to add the |
To continue to work on this on the Should I write a test that ensures that If the implementations uses Any advice? |
Implementation for eclipse/microprofile-open-api#240 Microprofile on commit: jmini/microprofile-open-api@33b0214
hey @jmini - the core idea is that the Map returned does not affect the internal map of the model. With that in mind, the main check from the TCK would be that |
I have opened PR #279 to add the removeXxxx(String) methods. |
Related to this clarification topic, I have opened #284 to discuss the setter case. |
See eclipse#240 Signed-off-by: Jeremie Bresson <dev@jmini.fr>
For |
yup, thanks @jmini! |
A few methods return a list or map of children and are meant to be read-only. The issue is that we don't specify that in the javadocs, so it's up to interpretation of the vendors - we should clarify these scenarios to avoid inconsistent behaviour.
The text was updated successfully, but these errors were encountered: