Skip to content
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

Inheritance is not processed correctly for generated Interfaces #237

Closed
Andy2003 opened this issue Nov 15, 2018 · 2 comments
Closed

Inheritance is not processed correctly for generated Interfaces #237

Andy2003 opened this issue Nov 15, 2018 · 2 comments
Milestone

Comments

@Andy2003
Copy link

For the following API

openapi: 3.0.0
info:
  version: '1.0'
  title: Testinheritance
paths:
  /cat:
    post:
      requestBody:
        content:
          '*/*':
            schema:
              $ref: '#/components/schemas/Cat'
      responses:
        200:
          description: OK
components:
  schemas:
    Pet:
      type: object
      discriminator:
        propertyName: dtype
      properties:
        name:
          type: string
    Cat:
      type: object
      allOf:
        - $ref: '#/components/schemas/Pet'

This code is generated:

Spring:

ResponseEntity<Void> catPost(@ApiParam(value = ""  )  @Valid @RequestBody Object body);

Java:

public com.squareup.okhttp.Call catPostCall(Object body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException

Typescript-Angular:

public catPost(body?: any, observe?: 'body', reportProgress?: boolean): Observable<any>;

The body param is of type Object instead of Cat

@sohrab-
Copy link

sohrab- commented Dec 17, 2018

I am seeing this too in both v2 and v3. Interestingly, it determines the schema just fine if used in the response body.

@HugoMario
Copy link
Contributor

fixed with #628

@HugoMario HugoMario added this to the v3.0.19 milestone Apr 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants