Closed lctncld closed 5 years ago
Hi, thanks for reaching us.
Device:
type: Phone | Notebook
represents union type. This means Device
is either Phone
or Notebook
.
So it should be either
public class Device extends Phone
or
public class Device extends Notebook
but I don't see the way to accomplish both with Java.
Regarding your solution - I don't feel attributes are expected here. POJO's attributes are always generated based on type's properties.
If you think we should discuss the topic more, please open an issue so the conversation can continue there.
Thanks.
Thanks, I think we can continue in https://github.com/phoenixnap/springmvc-raml-plugin/issues/289 since you've already asked the question there.
Currently union type interpreter generates code correctly only if union types don't extend other user-defined types.
For example let's look at the schema used for a unit test
If I change Phone and Notebook types to extend another custom type
Interpreter ignores Phone/Notebook types and Device POJO looks like this:
This PR contains a fix for this behavior, I believe expected result is similar to
Could you please review it and maybe propose a better solution?