swagger-api / swagger-api/swagger-codegen
[typescript-angular] Invalid interface generation for additionalProperties
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
Generating a typescript-angular client from the following schema results in an invalid interface:
Schema:
GenericMap:
type: object
additionalProperties: true
Expected result:
export interface GenericMap {
[key: string]: any;
}
Actual result:
export interface GenericMap extends null<String, any> {
[key: string]: any;
}
Swagger-codegen version
3.0.8
Related issues/PRs
#4839 #6361 https://github.com/swagger-api/swagger-parser/issues/401
Suggest a fix/enhancement
(Please feel free to close this issue, if it is a duplicate of the aforementioned.)
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
Start with the typescript-angular generation path and reproduce the issue using the supplied GenericMap schema with additionalProperties: true. Compare the generated interface with the expected output, and review related issues #4839, #6361, and swagger-parser issue #401; done means the generated interface no longer extends null<String, any>.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, openapi, typescript
- Domain
- developer-experience, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100