···208208}
209209210210html.dark .authors-list li > a,
211211-html.dark .sponsors-list li > a {
211211+html.dark .sponsors-list li {
212212 background-color: var(--vp-button-brand-bg);
213213}
214214
+19
docs/openapi-ts/configuration.md
···94949595You can learn more on the [Output](/openapi-ts/output) page.
96969797+## Validating
9898+9999+To validate your input, set `input.validate_EXPERIMENTAL` to `true`.
100100+101101+::: warning
102102+The validator feature is very limited. You can help improve it by submitting more [use cases](https://github.com/hey-api/openapi-ts/issues/1970#issuecomment-2933189789).
103103+:::
104104+105105+```js
106106+export default {
107107+ input: {
108108+ path: 'https://get.heyapi.dev/hey-api/backend',
109109+ validate_EXPERIMENTAL: true, // [!code ++]
110110+ },
111111+ output: 'src/client',
112112+ plugins: ['@hey-api/client-fetch'],
113113+};
114114+```
115115+97116## Formatting
9811799118To format your output folder contents, set `output.format` to a valid formatter.
+23
docs/openapi-ts/migrating.md
···27272828This config option is deprecated and will be removed.
29293030+## v0.71.0
3131+3232+### Renamed `sdk.serviceNameBuilder` option
3333+3434+This option has been renamed to `sdk.classNameBuilder` to better represent its functionality. Additionally, it's no longer set by default. To preserve the previous behavior, update your configuration.
3535+3636+```js
3737+import { defaultPlugins } from '@hey-api/openapi-ts';
3838+3939+export default {
4040+ input: 'https://get.heyapi.dev/hey-api/backend',
4141+ output: 'src/client',
4242+ plugins: [
4343+ ...defaultPlugins,
4444+ {
4545+ classNameBuilder: '{{name}}Service', // [!code ++]
4646+ name: '@hey-api/sdk',
4747+ serviceNameBuilder: '{{name}}Service', // [!code --]
4848+ },
4949+ ],
5050+};
5151+```
5252+3053## v0.68.0
31543255### Upgraded input filters
···11+// This file is auto-generated by @hey-api/openapi-ts
22+33+import type { ClientOptions } from './types.gen';
44+import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch';
55+66+/**
77+ * The `createClientConfig()` function will be called on client initialization
88+ * and the returned object will become the client's initial configuration.
99+ *
1010+ * You may want to initialize your client this way instead of calling
1111+ * `setConfig()`. This is useful for example if you're using Next.js
1212+ * to ensure your client always has the correct values.
1313+ */
1414+export type CreateClientConfig<T extends DefaultClientOptions = ClientOptions> = (override?: Config<DefaultClientOptions & T>) => Config<Required<DefaultClientOptions> & T>;
1515+1616+export const client = createClient(createConfig<ClientOptions>({
1717+ baseUrl: 'http://localhost:3000/base'
1818+}));
···11+// This file is auto-generated by @hey-api/openapi-ts
22+33+import type { ClientOptions } from './types.gen';
44+import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch';
55+66+/**
77+ * The `createClientConfig()` function will be called on client initialization
88+ * and the returned object will become the client's initial configuration.
99+ *
1010+ * You may want to initialize your client this way instead of calling
1111+ * `setConfig()`. This is useful for example if you're using Next.js
1212+ * to ensure your client always has the correct values.
1313+ */
1414+export type CreateClientConfig<T extends DefaultClientOptions = ClientOptions> = (override?: Config<DefaultClientOptions & T>) => Config<Required<DefaultClientOptions> & T>;
1515+1616+export const client = createClient(createConfig<ClientOptions>({
1717+ baseUrl: 'http://localhost:3000/base'
1818+}));
···11+// This file is auto-generated by @hey-api/openapi-ts
22+33+import type { ClientOptions } from './types.gen';
44+import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch';
55+66+/**
77+ * The `createClientConfig()` function will be called on client initialization
88+ * and the returned object will become the client's initial configuration.
99+ *
1010+ * You may want to initialize your client this way instead of calling
1111+ * `setConfig()`. This is useful for example if you're using Next.js
1212+ * to ensure your client always has the correct values.
1313+ */
1414+export type CreateClientConfig<T extends DefaultClientOptions = ClientOptions> = (override?: Config<DefaultClientOptions & T>) => Config<Required<DefaultClientOptions> & T>;
1515+1616+export const client = createClient(createConfig<ClientOptions>({
1717+ baseUrl: 'http://localhost:3000/base'
1818+}));
···44import type { BaseHttpRequest } from './core/BaseHttpRequest';
55import { type ParentModelWithDatesResponse, type ModelWithDatesResponse, type ModelWithDatesArrayResponse, type ArrayOfDatesResponse, type DateResponse, type MultipleResponsesResponse, ParentModelWithDatesResponseTransformer, ModelWithDatesResponseTransformer, ModelWithDatesArrayResponseTransformer } from './types.gen';
6677-export class DefaultService {
77+export class Default {
88 constructor(public readonly httpRequest: BaseHttpRequest) { }
991010 /**
···7777 url: '/api/multiple-responses'
7878 });
7979 }
8080-8180}
···55import { request as __request } from './core/request';
66import type { CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData } from './types.gen';
7788-export class DefaultsService {
88+export class Defaults {
99 /**
1010 * @param parameterString This is a simple string with default value
1111 * @param parameterNumber This is a simple number with default value
···8181 }
8282 });
8383 }
8484-8584}
···55import { request as __request } from './core/request';
66import type { CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData } from './types.gen';
7788-export class DefaultsService {
88+export class Defaults {
99 /**
1010 * @param data The data for the request.
1111 * @param data.parameterString This is a simple string with default value
···8080 }
8181 });
8282 }
8383-8483}
···8899export interface Config extends Plugin.Name<'@hey-api/sdk'> {
1010 /**
1111- * Group operation methods into classes? When enabled, you can
1212- * select which classes to export with `sdk.include` and/or
1313- * transform their names with `sdk.serviceNameBuilder`.
1111+ * Group operation methods into classes? When enabled, you can select which
1212+ * classes to export with `sdk.include` and/or transform their names with
1313+ * `sdk.classNameBuilder`.
1414 *
1515 * Note that by enabling this option, your SDKs will **NOT**
1616 * support {@link https://developer.mozilla.org/docs/Glossary/Tree_shaking tree-shaking}.
···2828 */
2929 auth?: boolean;
3030 /**
3131+ * Customize the generated class names. The name variable is obtained from
3232+ * your OpenAPI specification tags or `instance` value.
3333+ *
3434+ * This option has no effect if `sdk.asClass` is `false`.
3535+ */
3636+ classNameBuilder?: string | ((name: string) => string);
3737+ /**
3138 * Use an internal client instance to send HTTP requests? This is useful if
3239 * you don't want to manually pass the client to each SDK function.
3340 *
···5360 */
5461 include?: string;
5562 /**
6363+ * Set `instance` to create an instantiable SDK. Using `true` will use the
6464+ * default instance name; in practice, you want to define your own by passing
6565+ * a string value.
6666+ *
6767+ * @default false
6868+ */
6969+ instance?: string | boolean;
7070+ /**
5671 * Customise the name of methods within the service. By default, {@link IR.OperationObject.id} or {@link Operation.name} is used.
5772 */
5873 methodNameBuilder?: (operation: IR.OperationObject | Operation) => string;
···7792 * @default 'fields'
7893 */
7994 responseStyle?: 'data' | 'fields';
8080- /**
8181- * Customize the generated service class names. The name variable is
8282- * obtained from your OpenAPI specification tags.
8383- *
8484- * This option has no effect if `sdk.asClass` is `false`.
8585- *
8686- * @default '{{name}}Service'
8787- */
8888- serviceNameBuilder?: string | ((name: string) => string);
8995 /**
9096 * Transform response data before returning. This is useful if you want to
9197 * convert for example ISO strings into Date objects. However, transformation
···11import type { ImportExportItemObject } from '../../../compiler/utils';
22import type { IR } from '../../../ir/types';
33import { getClientPlugin } from '../../@hey-api/client-core/utils';
44-import { operationOptionsType } from '../../@hey-api/sdk/plugin';
44+import { operationOptionsType } from '../../@hey-api/sdk/operation';
55import { importIdentifier } from '../../@hey-api/typescript/ref';
66import type { PluginInstance } from './types';
77