OpenAPITools / OpenAPITools/openapi-generator
allOf ignored when the property is used on its own
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Description
https://github.com/OpenAPITools/openapi-generator/pull/3771 (v4.1.2) breaks code generation (TypeScript) when a model only defines a single allOf/$ref and no other properties.
Example
MyModel:
description: a model
allOf:
- $ref: '#/components/schemas/MyOtherModel'
Generated output
import { SomeImportPropertyType } from './propModel'; // this is correct
/**
* MyModel
*/
export interface MyModel {
// properties from {MyOtherModel} are missing
}
export namespace MyModel {
}
@wing328 I assume this is what you meant could happen by your comment https://github.com/OpenAPITools/openapi-generator/pull/3771#discussion_r318663859
openapi-generator version
latest
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the TypeScript generation case from the issue using a schema with a single allOf/$ref, then compare the relevant generation path with the change discussed in PR 3771. Done means the generated MyModel includes the properties inherited from MyOtherModel while preserving the shown import and interface structure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, typescript
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100