Skip to content

Path serializer case issue #2863

@sweat0198

Description

@sweat0198

Description

I'm using this on my config file:

export default defineConfig({
	output: {
		path: 'src/lib/api',
		case: 'camelCase',
		format: 'prettier'
	},
        ...
});

I'm getting all functions, models as camelCase, that's perfect...
But on the defaultPathSerializer function, it looks for snake_case keys which is how it is written on the urlPath.
Is there a way to learn how is the output.case configured and convert the match key here also ?
Or can we have a custom pathSerializer like we have for query and body ?
Or is there any other point I missed ?

Reproducible example or configuration

So in my case here is the request function:

export const getCategories = <ThrowOnError extends boolean = true>(
	options: Options<GetCategoriesData, ThrowOnError>
) => {
	return (options.client ?? client).get<GetCategoriesResponses, unknown, ThrowOnError>({
		url: '/stores/{store_id}/categories',
		...options
	});
};

export type GetCategoriesData = {
	body?: never;
	path: {
		/**
		 * Store id
		 */
		storeId: unknown;
	};
	query?: never;
	url: '/stores/{store_id}/categories';
};

I have the path param as storeId but since the url has store_id it doesn't find the path param in the defaultPathSerializer function

OpenAPI specification (optional)

No response

System information (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🔥Something isn't workingfeature 🚀New feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions