For the sake of others – Arkady and I talked about the issue on IRC. 

The solution for inheritance is to use the `discriminator` in the models.

As it is described in the attached YAML, it’s ‘only’ composition.

 

 

From: <swagger-swaggersocket@googlegroups.com> on behalf of Arkady Trestman 
<trest...@gmail.com>
Reply-To: "swagger-swaggersocket@googlegroups.com" 
<swagger-swaggersocket@googlegroups.com>
Date: Friday, 10 March 2017 at 17:13
To: Swagger <swagger-swaggersocket@googlegroups.com>
Subject: is inheritance broken in swagger-codegen-cli 2.2.1/2.2.2 for java 
spring

 

I have the following yaml specification  

 

Cat:

    allOf:

      - $ref: '#/definitions/Animal'

      - type: object

        properties:

          declawed:

            type: boolean

Animal:

    type: object

    properties:

      color:

        type: string

        default: 'red'

 

which is not resulting in java code generated as 

 

public class Cat extends Animal { ... }

 

Please advise,

Arkady.

-- 
You received this message because you are subscribed to the Google Groups 
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to