-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Open
Labels
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)?
- Have you tested with the latest master to confirm the issue still exists?
- Have you searched for related issues/PRs?
- What's the actual output vs expected output?
- [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
additionalProperties for components from schema are completely ignored and missed in the output
openapi-generator version
6.3.0
OpenAPI declaration file content or URL
In #/components/schemas
"PizzaDto": {
"type": "object",
"required": [
"id",
"name",
"ingredients"
],
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"name": {
"type": "string"
},
"ingredients": {
"type": "array",
"items": {
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "string"
}
}
}
}
},
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
}Generation Details
The schema above with default options produces
export class PizzaDto extends null<String, Array> {
'id': string;
'name': string;
'ingredients': Array<PizzaDtoIngredientsInner>;
}Please note that strange extends null and missed additional props
The expected output should be smth like this
export class PizzaDto {
'id': string;
'name': string;
'ingredients': Array<PizzaDtoIngredientsInner>;
[key: string]: string[] | any
}Steps to reproduce
- Run generation with the provided schema
- Check the model in
pizzaDto.ts
Related issues/PRs
The correct generation was introduced in this PR #4698 but it's broken now.
Suggest a fix
Check the previous implementation of borrow it from typescript-angular (it does it correctly)