OpenAPITools / OpenAPITools/openapi-generator
Map<String, String> generation failed
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
We are using your tool and having problems parsing a Map<String, String> into dart. It seems it is some kind of string formatting error where > and < are not correctly translated. We assumed the bug could be around here:
Maybe it has something to do with the mustache definition here (https://mustache.github.io/mustache.5.html):
Template:
- {{name}}
- {{age}}
- {{company}}
- {{{company}}}
Hash:
{
"name": "Chris",
"company": "GitHub"
}
Output: - Chris
- <b>GitHub</b>
- GitHub
How we found it after api generation was this:
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 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/serializers.mustache at the referenced line, then inspect the generated Dart serialization for a Map<String, String>. Compare the template's escaping behavior with the Mustache documentation and reproduce the reported output. Done means generated Dart preserves the angle brackets and parses the map correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100