Issue with swagger-codegen generated models

Issue:

Java domain classes generated using swagger-codegen don't extend their base classes.

Solution:

http://swagger.io/specification/ - please see "Composition and Inheritance (Polymorphism)" part.

Here's an example of required changes to thomson-reuters-world-check-one-api.v1.yaml file in order to fix NewCase model - which extends UpdateCase model - generation (please note that NewCase isn't the only model with the issue):

  #
# Definitions for Case domain
# ===========================
#


UpdateCase:
type: object
discriminator: updateCaseType # <---- new
description: |
Defines Case data that can be sent when updating a Case.

# ... omitting some code here

# ...
# UpdateCase definition continued:

required:
- name
- updateCaseType # <---- new
- providerTypes
properties:

...

P.S.: I'm not a Swagger expert, so there might be a reason why you have missing discriminator property, but changes above helped me to generate correct java classes.

Best Answer

  • Hi @ruslann,

    Thank you for contributing to the World-Check One Developer's Portal Q&A !!

    Your feedback and experience is very helpful to all who read the Q&A forum.

    I've submitted a ticket to our development team and will post any response if necessary or confirm the change to the YAML

    Thanks again,

    Brian