···140140});
141141```
142142143143+## Build URL
144144+145145+::: warning
146146+To use this feature, you must opt in to the [experimental parser](/openapi-ts/configuration#parser).
147147+:::
148148+149149+If you need to access the compiled URL, you can use the `buildUrl()` method. It's loosely typed by default to accept almost any value; in practice, you will want to pass a type hint.
150150+151151+```ts
152152+type FooData = {
153153+ path: {
154154+ fooId: number;
155155+ };
156156+ query?: {
157157+ bar?: string;
158158+ };
159159+ url: '/foo/{fooId}';
160160+};
161161+162162+const url = client.buildUrl<FooData>({
163163+ path: {
164164+ fooId: 1,
165165+ },
166166+ query: {
167167+ bar: 'baz',
168168+ },
169169+ url: '/foo/{fooId}',
170170+});
171171+console.log(url); // prints '/foo/1?bar=baz'
172172+```
173173+143174## Bundling
144175145176Sometimes, you may not want to declare client packages as a dependency. This scenario is common if you're using Hey API to generate output that is repackaged and published for other consumers under your own brand. For such cases, our clients support bundling through the `client.bundle` configuration option.
···66 CreateAxiosDefaults,
77} from 'axios';
8899-import type { BodySerializer } from './utils';
99+import type {
1010+ BodySerializer,
1111+ QuerySerializer,
1212+ QuerySerializerOptions,
1313+} from './utils';
10141115type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
1216···6872 | 'put'
6973 | 'trace';
7074 /**
7575+ * A function for serializing request query parameters. By default, arrays
7676+ * will be exploded in form style, objects will be exploded in deepObject
7777+ * style, and reserved characters are percent-encoded.
7878+ *
7979+ * This method will have no effect if the native `paramsSerializer()` Axios
8080+ * API function is used.
8181+ *
8282+ * {@link https://swagger.io/docs/specification/serialization/#query View examples}
8383+ */
8484+ querySerializer?: QuerySerializer | QuerySerializerOptions;
8585+ /**
7186 * A function for transforming response data before it's returned to the
7287 * caller function. This is an ideal place to post-process server data,
7388 * e.g. convert date ISO strings into native Date objects.
···141156) => RequestResult<Data, TError, ThrowOnError>;
142157143158export interface Client {
159159+ /**
160160+ * Returns the final request URL. This method works only with experimental parser.
161161+ */
162162+ buildUrl: <
163163+ Data extends {
164164+ body?: unknown;
165165+ path?: Record<string, unknown>;
166166+ query?: Record<string, unknown>;
167167+ url: string;
168168+ },
169169+ >(
170170+ options: Pick<Data, 'url'> & Omit<Options<Data>, 'axios'>,
171171+ ) => string;
144172 delete: MethodFn;
145173 get: MethodFn;
146174 getConfig: () => Config;
···66 CreateAxiosDefaults,
77} from 'axios';
8899-import type { BodySerializer } from './utils';
99+import type {
1010+ BodySerializer,
1111+ QuerySerializer,
1212+ QuerySerializerOptions,
1313+} from './utils';
10141115type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
1216···6872 | 'put'
6973 | 'trace';
7074 /**
7575+ * A function for serializing request query parameters. By default, arrays
7676+ * will be exploded in form style, objects will be exploded in deepObject
7777+ * style, and reserved characters are percent-encoded.
7878+ *
7979+ * This method will have no effect if the native `paramsSerializer()` Axios
8080+ * API function is used.
8181+ *
8282+ * {@link https://swagger.io/docs/specification/serialization/#query View examples}
8383+ */
8484+ querySerializer?: QuerySerializer | QuerySerializerOptions;
8585+ /**
7186 * A function for transforming response data before it's returned to the
7287 * caller function. This is an ideal place to post-process server data,
7388 * e.g. convert date ISO strings into native Date objects.
···141156) => RequestResult<Data, TError, ThrowOnError>;
142157143158export interface Client {
159159+ /**
160160+ * Returns the final request URL. This method works only with experimental parser.
161161+ */
162162+ buildUrl: <
163163+ Data extends {
164164+ body?: unknown;
165165+ path?: Record<string, unknown>;
166166+ query?: Record<string, unknown>;
167167+ url: string;
168168+ },
169169+ >(
170170+ options: Pick<Data, 'url'> & Omit<Options<Data>, 'axios'>,
171171+ ) => string;
144172 delete: MethodFn;
145173 get: MethodFn;
146174 getConfig: () => Config;
···66 CreateAxiosDefaults,
77} from 'axios';
8899-import type { BodySerializer } from './utils';
99+import type {
1010+ BodySerializer,
1111+ QuerySerializer,
1212+ QuerySerializerOptions,
1313+} from './utils';
10141115type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
1216···6872 | 'put'
6973 | 'trace';
7074 /**
7575+ * A function for serializing request query parameters. By default, arrays
7676+ * will be exploded in form style, objects will be exploded in deepObject
7777+ * style, and reserved characters are percent-encoded.
7878+ *
7979+ * This method will have no effect if the native `paramsSerializer()` Axios
8080+ * API function is used.
8181+ *
8282+ * {@link https://swagger.io/docs/specification/serialization/#query View examples}
8383+ */
8484+ querySerializer?: QuerySerializer | QuerySerializerOptions;
8585+ /**
7186 * A function for transforming response data before it's returned to the
7287 * caller function. This is an ideal place to post-process server data,
7388 * e.g. convert date ISO strings into native Date objects.
···141156) => RequestResult<Data, TError, ThrowOnError>;
142157143158export interface Client {
159159+ /**
160160+ * Returns the final request URL. This method works only with experimental parser.
161161+ */
162162+ buildUrl: <
163163+ Data extends {
164164+ body?: unknown;
165165+ path?: Record<string, unknown>;
166166+ query?: Record<string, unknown>;
167167+ url: string;
168168+ },
169169+ >(
170170+ options: Pick<Data, 'url'> & Omit<Options<Data>, 'axios'>,
171171+ ) => string;
144172 delete: MethodFn;
145173 get: MethodFn;
146174 getConfig: () => Config;