OpenAPITools / OpenAPITools/openapi-generator

[REQ] [dart-dio] Support for case insensitive parameter substitution in paths

Open
#14,707 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
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.

Sometimes, the spec I get from the backend team has inconsistencies in naming, where a parameter in the path has different casing than in the parameter definition.

Describe the solution you'd like

An --additional-properties caseInsensitiveParameters=true flag allowing me to have case insensitive replacement of parameters in url paths.

Which would spit out something like this:
final _path = r'/api/v1/Employees/{CompanyId}/Transfer/{InvoiceGroupId}'.replaceAll(RegExp('{' r'companyId' '}', caseSensitive: false), companyId.toString()).replaceAll(RegExp('{' r'invoiceGroupId' '}', caseSensitive: false), invoiceGroupId.toString());

Instead of this (current output):

final _path = r'/api/v1/Employees/{CompanyId}/Transfer/{InvoiceGroupId}'.replaceAll('{' r'companyId' '}', companyId.toString()).replaceAll('{' r'invoiceGroupId' '}', invoiceGroupId.toString());

Describe alternatives you've considered

Asking the backend team to be perfect and never do naming mistakes. Alas, it's not possible to safeguard for all future mistakes.

I realise that there are other risks involved when disregarding casing, like two parameters ending up being named the same , but I think the risk of that is far lower than someone getting the casing wrong.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the dart-dio generator's handling of additional properties and path-parameter substitution; the issue names no files or tests. Confirm how the new flag should affect generated paths, including casing collisions, and validate that enabled output uses case-insensitive replacement while default output remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.