-
Notifications
You must be signed in to change notification settings - Fork 19
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
NPE when using multilevel inheritance #41
Comments
DarrenC
pushed a commit
to DarrenC/swagger2puml
that referenced
this issue
Jun 14, 2019
This was referenced Jun 24, 2019
Hi @stroisi, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When processing a yaml with definitions that include multiple levels of inheritance an NPE is thrown.
Example model:
`
NPE Stacktrace:
`
It looks like when the getClassMembers(ComposedModel) method loops over the "AllOf" list of the target model to resolve the parent model's properties, that if the parent is itself the child of another type that it's getProperties() method returns null, causing the NPE when we try to put them into the child's Map of properties.
I'm attaching a patch with a proposed fix.
There is a secondary issue, also addressed in the patch, which is that even with the NPE fixed the code wasn't correctly resolving the full list of properties from the descendant types.
In the example above, the UML generated for "ChildObj1" looked like:
`
class ChildObj1 {
- prop3 :String
}`
With the patch applied we recurse to get properties from the descendants, and the output includes prop1 & prop2 from the parent & grandparent types:
`
class ChildObj1 {
- prop3 :String
- prop2:String
- prop1:String
}`
The text was updated successfully, but these errors were encountered: