[Java] Fixes schema class type booleans for composed schemas#10334
Conversation
There was a problem hiding this comment.
why are getters one line, but setters 3 lines?
There was a problem hiding this comment.
Just copying and pasting. Do you have a preference on how it should be done?
There was a problem hiding this comment.
Do you have a preference on how it should be done?
Consistent :)
|
Closing and re-opening to kick off bitrise again |
0fb2e93 to
6fd950f
Compare
|
csharp-netcore error is unrelated |
| has_teeth=True, | ||
| class_name="whale", | ||
| ) # Mammal | Input mammal | ||
| mammal = Mammal(None) # Mammal | Input mammal |
There was a problem hiding this comment.
Looks like a regression here, no?
There was a problem hiding this comment.
not exactly. Because mammal is type any type (no type defined in the mammal schema), None is a valid selection based upon the schema being anyType. That payload would fail whale or zebra validation so this is highlighting how our python tooling needs to be smarter in how it handles composed anyType schema examples.
Fixes java schema class type booleans for composed schemas
When a composed schema is defined with a type constraint, our tooling is not detecting that constraint and setting the boolean type properties in the class instance correctly.
This PR adds code which fixes that issue.
instance.setTypeProperties(schema)now sets those properties for object, array, number, integer, anyType, null, and stringwhich are the non-format types
Updates:
PR checklist
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.For Windows users, please run the script in Git BASH.
master(5.3.0),6.0.x