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

[BUG][typescript-angular] allOf not working without additional properties #4770

Closed
5 tasks done
joke opened this issue Dec 11, 2019 · 2 comments · Fixed by #5182
Closed
5 tasks done

[BUG][typescript-angular] allOf not working without additional properties #4770

joke opened this issue Dec 11, 2019 · 2 comments · Fixed by #5182

Comments

@joke
Copy link

joke commented Dec 11, 2019

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
Description

The typescript generator generators does not include attributes without specifying additional properties:

  • The interface PetListEntry is empty and does not extend Pet
export interface PetNew { 
    name: string;
}

export interface Pet { 
    id: string;
    name: string;
}

export interface PetListEntry { 
}
openapi-generator version

4.2.2

OpenAPI declaration file content
openapi: 3.0.2
info:
  title: api
  version: 1.0.0
paths:
  /pets:
    get:
      summary: list all pets
      responses:
        200:
          description: An array of pets
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PetListEntry'
    post:
      summary: create new pet
      requestBody:
        description: Pet to be created
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PetNew'
      responses:
        201:
          description: Newly created pet
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Pet'
components:
  schemas:
    Pet:
      allOf:
        - type: object
          required:
            - id
          properties:
            id:
              type: string
        - $ref: '#/components/schemas/PetNew'
    PetListEntry:
      allOf:
        - $ref: '#/components/schemas/Pet'
    PetNew:
      type: object
      required:
        - name
      properties:
        name:
          type: string
Command line used for generation
$ openapi-generator-cli-4.2.2.jar generate -g typescript-angular -i api.yaml
Steps to reproduce
  • Generate the model files
  • Check model files
@auto-labeler
Copy link

auto-labeler bot commented Dec 11, 2019

👍 Thanks for opening this issue!
🏷 I have applied any labels matching special text in your issue.

The team will review the labels and make any necessary changes.

@digaus
Copy link

digaus commented Jan 6, 2020

Can confirm this... Fix would be nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants