[REQ] [dart-dio] Support for case insensitive parameter substitution in paths
Created by: andreasmpet
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.