swagger-api / swagger-api/swagger-codegen
[Typescript] Multiple interface inheritance broken
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
Issue was introduced from version 2.4.14 to 2.4.15.
2.4.14: Swagger 2.0 type refs were resolved correctly and members from multiple refs were pasted into the generated interface.
2.4.15: Refs are now translated as interface extensions but with multiple refs only one interface is extended
E.g.
UserPermissions:
type: object
allOf:
- $ref: "#/definitions/PermissionUser"
- $ref: "../definitions/authz.yml#/definitions/PermissionsWithChanges"
translates to
export interface UserPermissions extends PermissionUser {
}
Swagger-codegen version
2.4.15
Command line used for generation
docker run --rm -v ${PWD}:/local swaggerapi/swagger-codegen-cli:2.4.15 generate -i $BASE_URL/swagger.yml -l typescript-aurelia -o /local/swagger-typescript-client --additional-properties modelPropertyNaming=original,interface-only=true -DsupportingFiles -Dmodels
Steps to reproduce
Run swagger codegen for types with multiple refs
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 issue with the provided Docker command and a Swagger definition containing multiple allOf refs. Trace the typescript-aurelia generator's handling of those refs; done means the generated interface extends every referenced interface rather than only the first one, with a regression test covering the example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100