-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Closed
Description
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
PetListEntryis empty and does not extendPet
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: stringCommand line used for generation
$ openapi-generator-cli-4.2.2.jar generate -g typescript-angular -i api.yamlSteps to reproduce
- Generate the model files
- Check model files
digaus and amakhrov