Parameter names without camelCase transformation
My API uses snake case names. I want API calls in this form:
public objectList({
page,
filter_id,
filter_status,
}: {
page?: (string | null),
filter_id?: (number | null),
filter_status?: (ObjectStatusChoices | null),
}): CancelablePromise<CursorPaginated_ObjectListItem_> {
because filter attributes are defined as model:
export type ObjectFilter = {
filter_id?: (number | null);
filter_status?: (ObjectStatusChoices | null);
};
Later in code i am extracting filter functionality to separate functions using ObjectFilter model, but this is not possible because API parameters are modified to camelCase.
Possible solution
I would like to have new parameters, something like:
export enum CaseTransform {
CAMEL = 'camel',
NONE = 'none',
}
// ...
parameterNameTransform?: CaseTransform;
Problem, which remains is how to pass additional parameter to getOperationParameterName? There is no global options object and option - pass chain is too deep. Possible solution would be globally available options object. I don't know if this is acceptable.
+1 to this. Any plans on implementing this?
Yes @vaidik. We will remove parameter transformation altogether in https://github.com/hey-api/openapi-ts, it's just faster that way