swagger-api / swagger-api/swagger-codegen
Deserialization failed due to change of property name
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
The issue is originally reported via https://github.com/swagger-api/swagger-codegen/issues/4805#issuecomment-280615622
For typescript-angular2:
"Request": {
"device_type": {
"type": "string"
},
}
},
generates:
export interface Request {
deviceType?: string;
}
The deserialization does not work as there's no mapping between deviceType and device_type (original attribute name in JSON)
Swagger-codegen version
latest master and 2.3.0
cc @Ondra09, @ataraxus, @Tifu
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-angular2 generator output described in the issue, comparing the generated deviceType property with the device_type JSON name. Trace the generated deserialization path and verify that the original JSON property maps correctly; done means deserialization populates deviceType from device_type.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100