OpenAPITools / OpenAPITools/openapi-generator
[BUG] [Dart] Serializers generation fails when additionalProperties = true for nested classes
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Description
I'm generator dart code for a Flutter project.
Let's say I have a class A, which has a few fields as well as "additionalProperties: true" in the openapi yaml file.
Now I have class B, and one of its fields is an instance of A.
If this class B is present in an endpoint's request object, it will create a bug in the "_deserializeProperties" where we get: A value of type 'ClassB' can't be assigned to a variable of type 'ClassBBuilder?'.
openapi-generator version
MacOS, version 7.12.0
Dart version 3.9.0
Generation Details
Generation threw no errors or warning and completed as expected.
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 reproducing the issue with an OpenAPI YAML schema containing nested classes where class A has additionalProperties: true and class B is used in an endpoint request object. Inspect the generated Dart serializer's _deserializeProperties and the reported ClassB/ClassBBuilder mismatch. Done means generation succeeds and the generated request serialization no longer produces that type error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, flutter, openapi
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100