OpenAPITools / OpenAPITools/openapi-generator
[REQ] [Dart] Config option to generate endpoint methods with named parameters for all parameters
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Is your feature request related to a problem? Please describe.
We're relying on a YAML file created by another team to generate our APIs and models, but this team sometimes has trouble keeping it consistent for unexplained technical reasons. Recently two request parameters of same type got swapped for an endpoint, and so did the (positional) parameters of the corresponding endpoint method after updating the API package. The evident problems that ensued got unnoticed until late
Describe the solution you'd like
This problem could definitely have been avoided if the endpoint method parameters were named, since the order parameters are provided doesn't matter in that case
This would manifest as a config option named (for instance) useNamedParameters
This doesn't seem too fancy a feature to me since the Dart philosophy (especially with Flutter) is to declare methods this way
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 tracing the Dart generator's endpoint-method entry point and its existing configuration handling. Check how generated methods currently receive parameters and how YAML options are passed through. Done means a configuration option such as useNamedParameters consistently produces Dart endpoint methods whose parameters can be supplied by name.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart
- Domain
- api, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100