swagger-api / swagger-api/swagger-codegen
Subclass of Decodable doesn't decode in Swift 4
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
Hello,
we have a Decodable class "Message" and subclasses of "Message", for example "Question". We always retrieve type Message which is then decoded, but would like to cast some "Messages" to "Questions", but have an issue since the decoding doesn't run for the subclasses.
Is there a way to decode the attributes of the subclass in the super class?
Swagger-codegen version
2.3
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 by locating the Swift model-generation templates or entry points that produce Decodable classes in Swagger-codegen 2.3, then reproduce the Message/Question inheritance case described in the issue. Determine whether generated subclass attributes are decoded when a Message is retrieved, and document or fix the behavior if the project supports it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100