diff --git a/.changeset/seven-walls-return.md b/.changeset/seven-walls-return.md
new file mode 100644
index 0000000000..12d1ff39b5
--- /dev/null
+++ b/.changeset/seven-walls-return.md
@@ -0,0 +1,9 @@
+---
+'@hey-api/openapi-ts': minor
+---
+
+feat: remove legacy clients and plugins
+
+### Removed legacy clients
+
+This release removes support for legacy clients and plugins. Please migrate to the new clients if you haven't done so yet. If you're unable to do so due to a missing feature, let us know on [GitHub](https://github.com/hey-api/openapi-ts/issues).
diff --git a/dev/openapi-ts.config.ts b/dev/openapi-ts.config.ts
index b9023d7d8b..c919e1ed02 100644
--- a/dev/openapi-ts.config.ts
+++ b/dev/openapi-ts.config.ts
@@ -36,15 +36,15 @@ export default defineConfig(() => {
// },
path: path.resolve(
getSpecsPath(),
- '3.0.x',
- // '3.1.x',
+ // '3.0.x',
+ '3.1.x',
// 'circular.yaml',
// 'dutchie.json',
// 'invalid',
// 'openai.yaml',
// 'full.yaml',
- // 'opencode.yaml',
- 'sdk-circular-bug.yaml',
+ 'opencode.yaml',
+ // 'sdk-circular-bug.yaml',
// 'sdk-instance.yaml',
// 'string-with-format.yaml',
// 'transformers.json',
@@ -265,14 +265,14 @@ export default defineConfig(() => {
instance: true,
name: '@hey-api/sdk',
// operationId: false,
- // paramsStructure: 'flat',
+ paramsStructure: 'flat',
// responseStyle: 'data',
// signature: 'auto',
// signature: 'client',
// signature: 'object',
// transformer: '@hey-api/transformers',
- transformer: true,
- validator: true,
+ // transformer: true,
+ // validator: true,
// validator: {
// request: 'zod',
// response: 'zod',
@@ -294,7 +294,7 @@ export default defineConfig(() => {
{
// bigInt: true,
// dates: true,
- name: '@hey-api/transformers',
+ // name: '@hey-api/transformers',
},
{
// name: 'fastify',
diff --git a/dev/package.json b/dev/package.json
index 7ba5560898..83230c8a4c 100644
--- a/dev/package.json
+++ b/dev/package.json
@@ -7,20 +7,7 @@
"node": ">=20.19.0"
},
"devDependencies": {
- "@angular-devkit/build-angular": "19.2.19",
- "@angular/animations": "19.2.15",
- "@angular/cli": "19.2.19",
- "@angular/common": "19.2.15",
- "@angular/compiler": "19.2.15",
- "@angular/compiler-cli": "19.2.15",
- "@angular/core": "19.2.15",
- "@angular/forms": "19.2.15",
- "@angular/platform-browser": "19.2.15",
- "@angular/platform-browser-dynamic": "19.2.15",
- "@angular/router": "19.2.15",
- "@config/vite-base": "workspace:*",
"@hey-api/codegen-core": "workspace:*",
- "@hey-api/custom-client": "workspace:*",
"@hey-api/openapi-ts": "workspace:*",
"@pinia/colada": "0.17.7",
"@tanstack/angular-query-experimental": "5.73.3",
@@ -28,24 +15,9 @@
"@tanstack/solid-query": "5.73.3",
"@tanstack/svelte-query": "5.73.3",
"@tanstack/vue-query": "5.73.3",
- "@types/cross-spawn": "6.0.6",
- "ajv": "8.17.1",
"arktype": "2.1.25",
- "axios": "1.8.2",
- "cross-spawn": "7.0.6",
- "eslint": "9.17.0",
- "fastify": "5.2.0",
- "glob": "11.0.3",
- "node-fetch": "3.3.2",
- "nuxt": "3.14.1592",
- "ofetch": "1.4.1",
- "prettier": "3.4.2",
- "rxjs": "7.8.2",
- "ts-node": "10.9.2",
- "tslib": "2.8.1",
"typescript": "5.9.3",
"valibot": "1.1.0",
- "vue": "3.5.13",
"zod": "4.1.12"
}
}
diff --git a/docs/.vitepress/config/en.ts b/docs/.vitepress/config/en.ts
index 6916f06dd7..ddaa0630de 100644
--- a/docs/.vitepress/config/en.ts
+++ b/docs/.vitepress/config/en.ts
@@ -119,10 +119,6 @@ export default defineConfig({
link: '/openapi-ts/clients/ky',
text: 'Ky soon',
},
- {
- link: '/openapi-ts/clients/legacy',
- text: 'Legacy',
- },
],
link: '/openapi-ts/clients',
text: 'Clients',
diff --git a/docs/index.md b/docs/index.md
index 6c45f2884f..9513b13c11 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -3,7 +3,7 @@ layout: home
hero:
name: One OpenAPI spec.
Infinite outputs.
- tagline: Codegen for JavaScript/TypeScript projects. Trusted over 3,000,000 times each month to generate reliable API clients and SDKs.
+ tagline: Code generator for TypeScript projects. Trusted by companies like Google, Amazon, and PayPal to generate API clients, SDKs, validators, and more.
actions:
- link: /openapi-ts/get-started
text: Get Started
diff --git a/docs/openapi-ts/clients.md b/docs/openapi-ts/clients.md
index 93ba076fbe..c484efa6ed 100644
--- a/docs/openapi-ts/clients.md
+++ b/docs/openapi-ts/clients.md
@@ -34,7 +34,6 @@ Hey API natively supports the following clients.
- [Effect](/openapi-ts/clients/effect) Soon
- [Got](/openapi-ts/clients/got) Soon
- [Ky](/openapi-ts/clients/ky) Soon
-- [Legacy](/openapi-ts/clients/legacy)
Don't see your client? [Build your own](/openapi-ts/clients/custom) or let us know your interest by [opening an issue](https://github.com/hey-api/openapi-ts/issues).
diff --git a/docs/openapi-ts/clients/legacy.md b/docs/openapi-ts/clients/legacy.md
deleted file mode 100644
index db7abeefe0..0000000000
--- a/docs/openapi-ts/clients/legacy.md
+++ /dev/null
@@ -1,136 +0,0 @@
----
-title: Legacy clients
-description: Legacy clients for Hey API.
----
-
-
-
-# Legacy Clients
-
-::: warning
-This feature is deprecated and no longer maintained. Please migrate to one of the client packages.
-:::
-
-Before client packages, clients were generated using `@hey-api/openapi-ts`. In fact, `@hey-api/openapi-ts` still supports generating legacy clients. You can generate them with the `client` config option.
-
-::: code-group
-
-```js [fetch]
-export default {
- input: 'hey-api/backend', // sign up at app.heyapi.dev
- output: 'src/client',
- plugins: ['legacy/fetch'], // [!code ++]
-};
-```
-
-```js [axios]
-export default {
- input: 'hey-api/backend', // sign up at app.heyapi.dev
- output: 'src/client',
- plugins: ['legacy/axios'], // [!code ++]
-};
-```
-
-```js [angular]
-export default {
- input: 'hey-api/backend', // sign up at app.heyapi.dev
- output: 'src/client',
- plugins: ['legacy/angular'], // [!code ++]
-};
-```
-
-```js [node]
-export default {
- input: 'hey-api/backend', // sign up at app.heyapi.dev
- output: 'src/client',
- plugins: ['legacy/node'], // [!code ++]
-};
-```
-
-```js [xhr]
-export default {
- input: 'hey-api/backend', // sign up at app.heyapi.dev
- output: 'src/client',
- plugins: ['legacy/xhr'], // [!code ++]
-};
-```
-
-:::
-
-## Available Clients
-
-- [angular](https://angular.io) (using [RxJS](https://rxjs.dev))
-- [axios](https://axios-http.com)
-- [fetch](https://developer.mozilla.org/docs/Web/API/Fetch_API)
-- [node](https://nodejs.org) (using [node-fetch](https://www.npmjs.com/package/node-fetch))
-- [xhr](https://developer.mozilla.org/docs/Web/API/XMLHttpRequest)
-
-## Caveats
-
-Please be aware that legacy clients are missing some key features:
-
-- no type-safe errors 🚫
-- no access to the original request and response 🚫
-- hard to configure individual requests 👎
-- inconsistent interceptors and response APIs 👎
-
-::: tip
-You might not need a `node` client. Fetch API is [experimental](https://nodejs.org/docs/latest-v18.x/api/globals.html#fetch) in Node.js v18 and [stable](https://nodejs.org/docs/latest-v21.x/api/globals.html#fetch) in Node.js v21. We recommend upgrading to the latest Node.js version.
-:::
-
-## Interceptors
-
-Interceptors (middleware) can be used to modify requests before they're sent or responses before they're returned to your application.
-
-Below is an example request interceptor
-
-::: code-group
-
-```js [use]
-OpenAPI.interceptors.request.use((request) => {
- doSomethingWithRequest(request);
- return request; // <-- must return request
-});
-```
-
-```js [eject]
-OpenAPI.interceptors.request.eject((request) => {
- doSomethingWithRequest(request);
- return request; // <-- must return request
-});
-```
-
-:::
-
-and an example response interceptor
-
-::: code-group
-
-```js [use]
-OpenAPI.interceptors.response.use(async (response) => {
- await doSomethingWithResponse(response); // async
- return response; // <-- must return response
-});
-```
-
-```js [eject]
-OpenAPI.interceptors.response.eject(async (response) => {
- await doSomethingWithResponse(response); // async
- return response; // <-- must return response
-});
-```
-
-:::
-
-::: tip
-To eject, you must provide the same function that was passed to `use()`.
-:::
-
-::: warning
-Angular client does not currently support request interceptors.
-:::
-
-
-
diff --git a/docs/openapi-ts/get-started.md b/docs/openapi-ts/get-started.md
index 0492fc8ecc..5b08b16a65 100644
--- a/docs/openapi-ts/get-started.md
+++ b/docs/openapi-ts/get-started.md
@@ -9,7 +9,10 @@ import { embedProject } from '../embed'
# Get Started
-[@hey-api/openapi-ts](https://github.com/hey-api/openapi-ts) is an OpenAPI to TypeScript codegen trusted over 3,000,000 times each month to generate reliable API clients and SDKs. The code is [MIT-licensed](/openapi-ts/license) and free to use. Discover available features below or view our [roadmap](https://github.com/orgs/hey-api/discussions/1495) to learn what's coming next.
+[@hey-api/openapi-ts](https://github.com/hey-api/openapi-ts) is an [open source](/openapi-ts/license) OpenAPI to TypeScript code generator trusted by companies like Google, Amazon, and PayPal to generate API clients, SDKs, validators, and more. We also build complementary tools and [services](https://app.heyapi.dev/) that help teams design, manage, and distribute APIs more effectively.
+
+> “OpenAPI codegen that just works.”
+> — Guillermo Rauch
### Demo
diff --git a/docs/openapi-ts/migrating.md b/docs/openapi-ts/migrating.md
index 1a51a2c211..ec68be0063 100644
--- a/docs/openapi-ts/migrating.md
+++ b/docs/openapi-ts/migrating.md
@@ -7,6 +7,12 @@ description: Migrating to @hey-api/openapi-ts.
While we try to avoid breaking changes, sometimes it's unavoidable in order to offer you the latest features. This page lists changes that require updates to your code. If you run into a problem with migration, please [open an issue](https://github.com/hey-api/openapi-ts/issues).
+## v0.87.0
+
+### Removed legacy clients
+
+This release removes support for legacy clients and plugins. Please migrate to the new clients if you haven't done so yet. If you're unable to do so due to a missing feature, let us know on [GitHub](https://github.com/hey-api/openapi-ts/issues).
+
## v0.86.0
### Removed Node 18 support
diff --git a/eslint.config.js b/eslint.config.js
index 712bfb461f..f8bd50bcff 100644
--- a/eslint.config.js
+++ b/eslint.config.js
@@ -66,8 +66,6 @@ export default tseslint.config(
'temp/',
'dev/.gen/',
'examples/openapi-ts-openai/src/client/**/*.ts',
- 'packages/openapi-ts/src/legacy/handlebars/compiled/**/*.js',
- 'packages/openapi-ts/src/legacy/handlebars/templates/**/*.hbs',
'**/test/generated/',
'**/__snapshots__/',
'**/.next/',
diff --git a/packages/codegen-core/README.md b/packages/codegen-core/README.md
index b222dc12dd..35063c6721 100644
--- a/packages/codegen-core/README.md
+++ b/packages/codegen-core/README.md
@@ -15,17 +15,13 @@
Issues
•
Contribute
- •
- Join Core Team
## Dashboard
-Hey API is an ecosystem of products helping you build better APIs. Superpower your codegen and APIs with Hey API Platform.
-
-[Sign In](https://app.heyapi.dev) to Hey API Platform.
+Access your projects and OpenAPI specifications in the [Hey API Platform](https://app.heyapi.dev/).
## Contributing
diff --git a/packages/nuxt/README.md b/packages/nuxt/README.md
index 09ccac62f5..8f96883602 100644
--- a/packages/nuxt/README.md
+++ b/packages/nuxt/README.md
@@ -20,9 +20,7 @@
## Dashboard
-Hey API is an ecosystem of products helping you build better APIs. Superpower your codegen and APIs with Hey API Platform.
-
-[Sign In](https://app.heyapi.dev) to Hey API Platform.
+Access your projects and OpenAPI specifications in the [Hey API Platform](https://app.heyapi.dev/).
## Contributing
diff --git a/packages/openapi-ts-tests/main/package.json b/packages/openapi-ts-tests/main/package.json
index 9e4f4afbc6..924e5113af 100644
--- a/packages/openapi-ts-tests/main/package.json
+++ b/packages/openapi-ts-tests/main/package.json
@@ -43,7 +43,6 @@
"cross-spawn": "7.0.6",
"eslint": "9.17.0",
"fastify": "5.2.0",
- "glob": "11.0.3",
"node-fetch": "3.3.2",
"nuxt": "3.14.1592",
"ofetch": "1.4.1",
diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v2/core/ApiError.ts.snap b/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v2/core/ApiError.ts.snap
deleted file mode 100644
index 36675d288a..0000000000
--- a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v2/core/ApiError.ts.snap
+++ /dev/null
@@ -1,21 +0,0 @@
-import type { ApiRequestOptions } from './ApiRequestOptions';
-import type { ApiResult } from './ApiResult';
-
-export class ApiError extends Error {
- public readonly url: string;
- public readonly status: number;
- public readonly statusText: string;
- public readonly body: unknown;
- public readonly request: ApiRequestOptions;
-
- constructor(request: ApiRequestOptions, response: ApiResult, message: string) {
- super(message);
-
- this.name = 'ApiError';
- this.url = response.url;
- this.status = response.status;
- this.statusText = response.statusText;
- this.body = response.body;
- this.request = request;
- }
-}
\ No newline at end of file
diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v2/core/ApiRequestOptions.ts.snap b/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v2/core/ApiRequestOptions.ts.snap
deleted file mode 100644
index 939a0aa4c8..0000000000
--- a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v2/core/ApiRequestOptions.ts.snap
+++ /dev/null
@@ -1,21 +0,0 @@
-export type ApiRequestOptions = {
- readonly body?: any;
- readonly cookies?: Record;
- readonly errors?: Record;
- readonly formData?: Record | any[] | Blob | File;
- readonly headers?: Record;
- readonly mediaType?: string;
- readonly method:
- | 'DELETE'
- | 'GET'
- | 'HEAD'
- | 'OPTIONS'
- | 'PATCH'
- | 'POST'
- | 'PUT';
- readonly path?: Record;
- readonly query?: Record;
- readonly responseHeader?: string;
- readonly responseTransformer?: (data: unknown) => Promise;
- readonly url: string;
-};
\ No newline at end of file
diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v2/core/ApiResult.ts.snap b/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v2/core/ApiResult.ts.snap
deleted file mode 100644
index 4c58e39138..0000000000
--- a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v2/core/ApiResult.ts.snap
+++ /dev/null
@@ -1,7 +0,0 @@
-export type ApiResult = {
- readonly body: TData;
- readonly ok: boolean;
- readonly status: number;
- readonly statusText: string;
- readonly url: string;
-};
\ No newline at end of file
diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v2/core/CancelablePromise.ts.snap b/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v2/core/CancelablePromise.ts.snap
deleted file mode 100644
index d95c755e0a..0000000000
--- a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v2/core/CancelablePromise.ts.snap
+++ /dev/null
@@ -1,126 +0,0 @@
-export class CancelError extends Error {
- constructor(message: string) {
- super(message);
- this.name = 'CancelError';
- }
-
- public get isCancelled(): boolean {
- return true;
- }
-}
-
-export interface OnCancel {
- readonly isResolved: boolean;
- readonly isRejected: boolean;
- readonly isCancelled: boolean;
-
- (cancelHandler: () => void): void;
-}
-
-export class CancelablePromise implements Promise {
- private _isResolved: boolean;
- private _isRejected: boolean;
- private _isCancelled: boolean;
- readonly cancelHandlers: (() => void)[];
- readonly promise: Promise;
- private _resolve?: (value: T | PromiseLike) => void;
- private _reject?: (reason?: unknown) => void;
-
- constructor(
- executor: (
- resolve: (value: T | PromiseLike) => void,
- reject: (reason?: unknown) => void,
- onCancel: OnCancel
- ) => void
- ) {
- this._isResolved = false;
- this._isRejected = false;
- this._isCancelled = false;
- this.cancelHandlers = [];
- this.promise = new Promise((resolve, reject) => {
- this._resolve = resolve;
- this._reject = reject;
-
- const onResolve = (value: T | PromiseLike): void => {
- if (this._isResolved || this._isRejected || this._isCancelled) {
- return;
- }
- this._isResolved = true;
- if (this._resolve) this._resolve(value);
- };
-
- const onReject = (reason?: unknown): void => {
- if (this._isResolved || this._isRejected || this._isCancelled) {
- return;
- }
- this._isRejected = true;
- if (this._reject) this._reject(reason);
- };
-
- const onCancel = (cancelHandler: () => void): void => {
- if (this._isResolved || this._isRejected || this._isCancelled) {
- return;
- }
- this.cancelHandlers.push(cancelHandler);
- };
-
- Object.defineProperty(onCancel, 'isResolved', {
- get: (): boolean => this._isResolved,
- });
-
- Object.defineProperty(onCancel, 'isRejected', {
- get: (): boolean => this._isRejected,
- });
-
- Object.defineProperty(onCancel, 'isCancelled', {
- get: (): boolean => this._isCancelled,
- });
-
- return executor(onResolve, onReject, onCancel as OnCancel);
- });
- }
-
- get [Symbol.toStringTag](): string {
- return "Cancellable Promise";
- }
-
- public then(
- onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null,
- onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null
- ): Promise {
- return this.promise.then(onFulfilled, onRejected);
- }
-
- public catch(
- onRejected?: ((reason: unknown) => TResult | PromiseLike) | null
- ): Promise {
- return this.promise.catch(onRejected);
- }
-
- public finally(onFinally?: (() => void) | null): Promise {
- return this.promise.finally(onFinally);
- }
-
- public cancel(): void {
- if (this._isResolved || this._isRejected || this._isCancelled) {
- return;
- }
- this._isCancelled = true;
- if (this.cancelHandlers.length) {
- try {
- for (const cancelHandler of this.cancelHandlers) {
- cancelHandler();
- }
- } catch (error) {
- console.warn('Cancellation threw an error', error);
- return;
- }
- }
- this.cancelHandlers.length = 0;
- if (this._reject) this._reject(new CancelError('Request aborted'));
- }
-
- public get isCancelled(): boolean {
- return this._isCancelled;
- }
-}
\ No newline at end of file
diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v2/core/OpenAPI.ts.snap b/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v2/core/OpenAPI.ts.snap
deleted file mode 100644
index 144e257447..0000000000
--- a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v2/core/OpenAPI.ts.snap
+++ /dev/null
@@ -1,56 +0,0 @@
-import type { ApiRequestOptions } from './ApiRequestOptions';
-
-type Headers = Record;
-type Middleware = (value: T) => T | Promise;
-type Resolver = (options: ApiRequestOptions) => Promise;
-
-export class Interceptors {
- _fns: Middleware[];
-
- constructor() {
- this._fns = [];
- }
-
- eject(fn: Middleware): void {
- const index = this._fns.indexOf(fn);
- if (index !== -1) {
- this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)];
- }
- }
-
- use(fn: Middleware): void {
- this._fns = [...this._fns, fn];
- }
-}
-
-export type OpenAPIConfig = {
- BASE: string;
- CREDENTIALS: 'include' | 'omit' | 'same-origin';
- ENCODE_PATH?: ((path: string) => string) | undefined;
- HEADERS?: Headers | Resolver | undefined;
- PASSWORD?: string | Resolver | undefined;
- TOKEN?: string | Resolver | undefined;
- USERNAME?: string | Resolver | undefined;
- VERSION: string;
- WITH_CREDENTIALS: boolean;
- interceptors: {
- request: Interceptors;
- response: Interceptors;
- };
-};
-
-export const OpenAPI: OpenAPIConfig = {
- BASE: 'http://localhost:3000/base',
- CREDENTIALS: 'include',
- ENCODE_PATH: undefined,
- HEADERS: undefined,
- PASSWORD: undefined,
- TOKEN: undefined,
- USERNAME: undefined,
- VERSION: '1.0',
- WITH_CREDENTIALS: false,
- interceptors: {
- request: new Interceptors(),
- response: new Interceptors(),
- },
-};
\ No newline at end of file
diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v2/core/request.ts.snap b/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v2/core/request.ts.snap
deleted file mode 100644
index 5458a2899d..0000000000
--- a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v2/core/request.ts.snap
+++ /dev/null
@@ -1,350 +0,0 @@
-import { ApiError } from './ApiError';
-import type { ApiRequestOptions } from './ApiRequestOptions';
-import type { ApiResult } from './ApiResult';
-import { CancelablePromise } from './CancelablePromise';
-import type { OnCancel } from './CancelablePromise';
-import type { OpenAPIConfig } from './OpenAPI';
-
-export const isString = (value: unknown): value is string => {
- return typeof value === 'string';
-};
-
-export const isStringWithValue = (value: unknown): value is string => {
- return isString(value) && value !== '';
-};
-
-export const isBlob = (value: any): value is Blob => {
- return value instanceof Blob;
-};
-
-export const isFormData = (value: unknown): value is FormData => {
- return value instanceof FormData;
-};
-
-export const base64 = (str: string): string => {
- try {
- return btoa(str);
- } catch (err) {
- // @ts-ignore
- return Buffer.from(str).toString('base64');
- }
-};
-
-export const getQueryString = (params: Record): string => {
- const qs: string[] = [];
-
- const append = (key: string, value: unknown) => {
- qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
- };
-
- const encodePair = (key: string, value: unknown) => {
- if (value === undefined || value === null) {
- return;
- }
-
- if (value instanceof Date) {
- append(key, value.toISOString());
- } else if (Array.isArray(value)) {
- value.forEach(v => encodePair(key, v));
- } else if (typeof value === 'object') {
- Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v));
- } else {
- append(key, value);
- }
- };
-
- Object.entries(params).forEach(([key, value]) => encodePair(key, value));
-
- return qs.length ? `?${qs.join('&')}` : '';
-};
-
-const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => {
- const encoder = config.ENCODE_PATH || encodeURI;
-
- const path = options.url
- .replace('{api-version}', config.VERSION)
- .replace(/{(.*?)}/g, (substring: string, group: string) => {
- if (options.path?.hasOwnProperty(group)) {
- return encoder(String(options.path[group]));
- }
- return substring;
- });
-
- const url = config.BASE + path;
- return options.query ? url + getQueryString(options.query) : url;
-};
-
-export const getFormData = (options: ApiRequestOptions): FormData | undefined => {
- if (options.formData) {
- const formData = new FormData();
-
- const process = (key: string, value: unknown) => {
- if (isString(value) || isBlob(value)) {
- formData.append(key, value);
- } else {
- formData.append(key, JSON.stringify(value));
- }
- };
-
- Object.entries(options.formData)
- .filter(([, value]) => value !== undefined && value !== null)
- .forEach(([key, value]) => {
- if (Array.isArray(value)) {
- value.forEach(v => process(key, v));
- } else {
- process(key, value);
- }
- });
-
- return formData;
- }
- return undefined;
-};
-
-type Resolver = (options: ApiRequestOptions) => Promise;
-
-export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => {
- if (typeof resolver === 'function') {
- return (resolver as Resolver)(options);
- }
- return resolver;
-};
-
-export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise => {
- const [token, username, password, additionalHeaders] = await Promise.all([
- // @ts-ignore
- resolve(options, config.TOKEN),
- // @ts-ignore
- resolve(options, config.USERNAME),
- // @ts-ignore
- resolve(options, config.PASSWORD),
- // @ts-ignore
- resolve(options, config.HEADERS),
- ]);
-
- const headers = Object.entries({
- Accept: 'application/json',
- ...additionalHeaders,
- ...options.headers,
- })
- .filter(([, value]) => value !== undefined && value !== null)
- .reduce((headers, [key, value]) => ({
- ...headers,
- [key]: String(value),
- }), {} as Record);
-
- if (isStringWithValue(token)) {
- headers['Authorization'] = `Bearer ${token}`;
- }
-
- if (isStringWithValue(username) && isStringWithValue(password)) {
- const credentials = base64(`${username}:${password}`);
- headers['Authorization'] = `Basic ${credentials}`;
- }
-
- if (options.body !== undefined) {
- if (options.mediaType) {
- headers['Content-Type'] = options.mediaType;
- } else if (isBlob(options.body)) {
- headers['Content-Type'] = options.body.type || 'application/octet-stream';
- } else if (isString(options.body)) {
- headers['Content-Type'] = 'text/plain';
- } else if (!isFormData(options.body)) {
- headers['Content-Type'] = 'application/json';
- }
- }
-
- return new Headers(headers);
-};
-
-export const getRequestBody = (options: ApiRequestOptions): unknown => {
- if (options.body !== undefined) {
- if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) {
- return JSON.stringify(options.body);
- } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) {
- return options.body;
- } else {
- return JSON.stringify(options.body);
- }
- }
- return undefined;
-};
-
-export const sendRequest = async (
- config: OpenAPIConfig,
- options: ApiRequestOptions,
- url: string,
- body: any,
- formData: FormData | undefined,
- headers: Headers,
- onCancel: OnCancel
-): Promise => {
- const controller = new AbortController();
-
- let request: RequestInit = {
- headers,
- body: body ?? formData,
- method: options.method,
- signal: controller.signal,
- };
-
- if (config.WITH_CREDENTIALS) {
- request.credentials = config.CREDENTIALS;
- }
-
- for (const fn of config.interceptors.request._fns) {
- request = await fn(request);
- }
-
- onCancel(() => controller.abort());
-
- return await fetch(url, request);
-};
-
-export const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => {
- if (responseHeader) {
- const content = response.headers.get(responseHeader);
- if (isString(content)) {
- return content;
- }
- }
- return undefined;
-};
-
-export const getResponseBody = async (response: Response): Promise => {
- if (response.status !== 204) {
- try {
- const contentType = response.headers.get('Content-Type');
- if (contentType) {
- const binaryTypes = ['application/octet-stream', 'application/pdf', 'application/zip', 'audio/', 'image/', 'video/'];
- if (contentType.includes('application/json') || contentType.includes('+json')) {
- return await response.json();
- } else if (binaryTypes.some(type => contentType.includes(type))) {
- return await response.blob();
- } else if (contentType.includes('multipart/form-data')) {
- return await response.formData();
- } else if (contentType.includes('text/')) {
- return await response.text();
- }
- }
- } catch (error) {
- console.error(error);
- }
- }
- return undefined;
-};
-
-export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => {
- const errors: Record = {
- 400: 'Bad Request',
- 401: 'Unauthorized',
- 402: 'Payment Required',
- 403: 'Forbidden',
- 404: 'Not Found',
- 405: 'Method Not Allowed',
- 406: 'Not Acceptable',
- 407: 'Proxy Authentication Required',
- 408: 'Request Timeout',
- 409: 'Conflict',
- 410: 'Gone',
- 411: 'Length Required',
- 412: 'Precondition Failed',
- 413: 'Payload Too Large',
- 414: 'URI Too Long',
- 415: 'Unsupported Media Type',
- 416: 'Range Not Satisfiable',
- 417: 'Expectation Failed',
- 418: 'Im a teapot',
- 421: 'Misdirected Request',
- 422: 'Unprocessable Content',
- 423: 'Locked',
- 424: 'Failed Dependency',
- 425: 'Too Early',
- 426: 'Upgrade Required',
- 428: 'Precondition Required',
- 429: 'Too Many Requests',
- 431: 'Request Header Fields Too Large',
- 451: 'Unavailable For Legal Reasons',
- 500: 'Internal Server Error',
- 501: 'Not Implemented',
- 502: 'Bad Gateway',
- 503: 'Service Unavailable',
- 504: 'Gateway Timeout',
- 505: 'HTTP Version Not Supported',
- 506: 'Variant Also Negotiates',
- 507: 'Insufficient Storage',
- 508: 'Loop Detected',
- 510: 'Not Extended',
- 511: 'Network Authentication Required',
- ...options.errors,
- }
-
- const error = errors[result.status];
- if (error) {
- throw new ApiError(options, result, error);
- }
-
- if (!result.ok) {
- const errorStatus = result.status ?? 'unknown';
- const errorStatusText = result.statusText ?? 'unknown';
- const errorBody = (() => {
- try {
- return JSON.stringify(result.body, null, 2);
- } catch (e) {
- return undefined;
- }
- })();
-
- throw new ApiError(options, result,
- `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}`
- );
- }
-};
-
-/**
- * Request method
- * @param config The OpenAPI configuration object
- * @param options The request options from the service
- * @returns CancelablePromise
- * @throws ApiError
- */
-export const request = (config: OpenAPIConfig, options: ApiRequestOptions): CancelablePromise => {
- return new CancelablePromise(async (resolve, reject, onCancel) => {
- try {
- const url = getUrl(config, options);
- const formData = getFormData(options);
- const body = getRequestBody(options);
- const headers = await getHeaders(config, options);
-
- if (!onCancel.isCancelled) {
- let response = await sendRequest(config, options, url, body, formData, headers, onCancel);
-
- for (const fn of config.interceptors.response._fns) {
- response = await fn(response);
- }
-
- const responseBody = await getResponseBody(response);
- const responseHeader = getResponseHeader(response, options.responseHeader);
-
- let transformedBody = responseBody;
- if (options.responseTransformer && response.ok) {
- transformedBody = await options.responseTransformer(responseBody)
- }
-
- const result: ApiResult = {
- url,
- ok: response.ok,
- status: response.status,
- statusText: response.statusText,
- body: responseHeader ?? transformedBody,
- };
-
- catchErrorCodes(options, result);
-
- resolve(result.body);
- }
- } catch (error) {
- reject(error);
- }
- });
-};
\ No newline at end of file
diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v2/index.ts.snap b/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v2/index.ts.snap
deleted file mode 100644
index 50a1dd734c..0000000000
--- a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v2/index.ts.snap
+++ /dev/null
@@ -1,6 +0,0 @@
-// This file is auto-generated by @hey-api/openapi-ts
-export { ApiError } from './core/ApiError';
-export { CancelablePromise, CancelError } from './core/CancelablePromise';
-export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI';
-export * from './sdk.gen';
-export * from './types.gen';
\ No newline at end of file
diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v2/schemas.gen.ts.snap b/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v2/schemas.gen.ts.snap
deleted file mode 100644
index 8d4a5df9d7..0000000000
--- a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v2/schemas.gen.ts.snap
+++ /dev/null
@@ -1,669 +0,0 @@
-// This file is auto-generated by @hey-api/openapi-ts
-
-export const CommentWithBreaksSchema = {
- description: `Testing multiline comments in string: First line
-Second line
-
-Fourth line`,
- type: 'integer'
-} as const;
-
-export const CommentWithBackticksSchema = {
- description: 'Testing backticks in string: `backticks` and ```multiple backticks``` should work',
- type: 'integer'
-} as const;
-
-export const CommentWithBackticksAndQuotesSchema = {
- description: `Testing backticks and quotes in string: \`backticks\`, 'quotes', "double quotes" and \`\`\`multiple backticks\`\`\` should work`,
- type: 'integer'
-} as const;
-
-export const CommentWithSlashesSchema = {
- description: 'Testing slashes in string: \\backwards\\\\\\ and /forwards/// should work',
- type: 'integer'
-} as const;
-
-export const CommentWithExpressionPlaceholdersSchema = {
- description: 'Testing expression placeholders in string: ${expression} should work',
- type: 'integer'
-} as const;
-
-export const CommentWithQuotesSchema = {
- description: `Testing quotes in string: 'single quote''' and "double quotes""" should work`,
- type: 'integer'
-} as const;
-
-export const CommentWithReservedCharactersSchema = {
- description: 'Testing reserved characters in string: /* inline */ and /** inline **/ should work',
- type: 'integer'
-} as const;
-
-export const SimpleIntegerSchema = {
- description: 'This is a simple number',
- type: 'integer'
-} as const;
-
-export const SimpleBooleanSchema = {
- description: 'This is a simple boolean',
- type: 'boolean'
-} as const;
-
-export const SimpleStringSchema = {
- description: 'This is a simple string',
- type: 'string'
-} as const;
-
-export const NonAsciiStringæøåÆØÅöôêÊ字符串Schema = {
- description: 'A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串)',
- type: 'string'
-} as const;
-
-export const SimpleFileSchema = {
- description: 'This is a simple file',
- type: 'file'
-} as const;
-
-export const SimpleReferenceSchema = {
- description: 'This is a simple reference',
- '$ref': '#/definitions/ModelWithString'
-} as const;
-
-export const SimpleStringWithPatternSchema = {
- description: 'This is a simple string',
- type: 'string',
- maxLength: 64,
- pattern: '^[a-zA-Z0-9_]*$'
-} as const;
-
-export const EnumWithStringsSchema = {
- description: 'This is a simple enum with strings',
- enum: ['Success', 'Warning', 'Error', "'Single Quote'", '"Double Quotes"', 'Non-ascii: øæåôöØÆÅÔÖ字符串']
-} as const;
-
-export const EnumWithNumbersSchema = {
- description: 'This is a simple enum with numbers',
- enum: [1, 2, 3, 1.1, 1.2, 1.3, 100, 200, 300, -100, -200, -300, -1.1, -1.2, -1.3]
-} as const;
-
-export const EnumFromDescriptionSchema = {
- description: 'Success=1,Warning=2,Error=3',
- type: 'number'
-} as const;
-
-export const EnumWithExtensionsSchema = {
- description: 'This is a simple enum with numbers',
- enum: [200, 400, 500],
- 'x-enum-varnames': ['CUSTOM_SUCCESS', 'CUSTOM_WARNING', 'CUSTOM_ERROR'],
- 'x-enum-descriptions': ['Used when the status of something is successful', 'Used when the status of something has a warning', 'Used when the status of something has an error']
-} as const;
-
-export const ArrayWithNumbersSchema = {
- description: 'This is a simple array with numbers',
- type: 'array',
- items: {
- type: 'integer'
- }
-} as const;
-
-export const ArrayWithBooleansSchema = {
- description: 'This is a simple array with booleans',
- type: 'array',
- items: {
- type: 'boolean'
- }
-} as const;
-
-export const ArrayWithStringsSchema = {
- description: 'This is a simple array with strings',
- type: 'array',
- items: {
- type: 'string'
- }
-} as const;
-
-export const ArrayWithReferencesSchema = {
- description: 'This is a simple array with references',
- type: 'array',
- items: {
- '$ref': '#/definitions/ModelWithString'
- }
-} as const;
-
-export const ArrayWithArraySchema = {
- description: 'This is a simple array containing an array',
- type: 'array',
- items: {
- type: 'array',
- items: {
- '$ref': '#/definitions/ModelWithString'
- }
- }
-} as const;
-
-export const ArrayWithPropertiesSchema = {
- description: 'This is a simple array with properties',
- type: 'array',
- items: {
- type: 'object',
- properties: {
- foo: {
- type: 'string'
- },
- bar: {
- type: 'string'
- }
- }
- }
-} as const;
-
-export const DictionaryWithStringSchema = {
- description: 'This is a string dictionary',
- type: 'object',
- additionalProperties: {
- type: 'string'
- }
-} as const;
-
-export const DictionaryWithReferenceSchema = {
- description: 'This is a string reference',
- type: 'object',
- additionalProperties: {
- '$ref': '#/definitions/ModelWithString'
- }
-} as const;
-
-export const DictionaryWithArraySchema = {
- description: 'This is a complex dictionary',
- type: 'object',
- additionalProperties: {
- type: 'array',
- items: {
- '$ref': '#/definitions/ModelWithString'
- }
- }
-} as const;
-
-export const DictionaryWithDictionarySchema = {
- description: 'This is a string dictionary',
- type: 'object',
- additionalProperties: {
- type: 'object',
- additionalProperties: {
- type: 'string'
- }
- }
-} as const;
-
-export const DictionaryWithPropertiesSchema = {
- description: 'This is a complex dictionary',
- type: 'object',
- additionalProperties: {
- type: 'object',
- properties: {
- foo: {
- type: 'string'
- },
- bar: {
- type: 'string'
- }
- }
- }
-} as const;
-
-export const DateSchema = {
- description: 'This is a type-only model that defines Date as a string',
- type: 'string'
-} as const;
-
-export const ModelWithIntegerSchema = {
- description: 'This is a model with one number property',
- type: 'object',
- properties: {
- prop: {
- description: 'This is a simple number property',
- type: 'integer'
- }
- }
-} as const;
-
-export const ModelWithBooleanSchema = {
- description: 'This is a model with one boolean property',
- type: 'object',
- properties: {
- prop: {
- description: 'This is a simple boolean property',
- type: 'boolean'
- }
- }
-} as const;
-
-export const ModelWithStringSchema = {
- description: 'This is a model with one string property',
- type: 'object',
- properties: {
- prop: {
- description: 'This is a simple string property',
- type: 'string'
- }
- }
-} as const;
-
-export const ModelWithStringErrorSchema = {
- description: 'This is a model with one string property',
- type: 'object',
- properties: {
- prop: {
- description: 'This is a simple string property',
- type: 'string'
- }
- }
-} as const;
-
-export const ModelWithNullableStringSchema = {
- description: 'This is a model with one string property',
- type: 'object',
- required: ['nullableRequiredProp'],
- properties: {
- nullableProp: {
- description: 'This is a simple string property',
- type: 'string',
- 'x-nullable': true
- },
- nullableRequiredProp: {
- description: 'This is a simple string property',
- type: 'string',
- 'x-nullable': true
- }
- }
-} as const;
-
-export const ModelWithEnumSchema = {
- description: 'This is a model with one enum',
- type: 'object',
- properties: {
- test: {
- description: 'This is a simple enum with strings',
- enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串']
- },
- statusCode: {
- description: 'These are the HTTP error code enums',
- enum: ['100', '200 FOO', '300 FOO_BAR', '400 foo-bar', '500 foo.bar', '600 foo&bar']
- },
- bool: {
- description: 'Simple boolean enum',
- type: 'boolean',
- enum: [true]
- }
- }
-} as const;
-
-export const ModelWithEnumFromDescriptionSchema = {
- description: 'This is a model with one enum',
- type: 'object',
- properties: {
- test: {
- type: 'integer',
- description: 'Success=1,Warning=2,Error=3'
- }
- }
-} as const;
-
-export const ModelWithNestedEnumsSchema = {
- description: 'This is a model with nested enums',
- type: 'object',
- properties: {
- dictionaryWithEnum: {
- type: 'object',
- additionalProperties: {
- enum: ['Success', 'Warning', 'Error']
- }
- },
- dictionaryWithEnumFromDescription: {
- type: 'object',
- additionalProperties: {
- type: 'integer',
- description: 'Success=1,Warning=2,Error=3'
- }
- },
- arrayWithEnum: {
- type: 'array',
- items: {
- enum: ['Success', 'Warning', 'Error']
- }
- },
- arrayWithDescription: {
- type: 'array',
- items: {
- type: 'integer',
- description: 'Success=1,Warning=2,Error=3'
- }
- }
- }
-} as const;
-
-export const ModelWithReferenceSchema = {
- description: 'This is a model with one property containing a reference',
- type: 'object',
- properties: {
- prop: {
- '$ref': '#/definitions/ModelWithProperties'
- }
- }
-} as const;
-
-export const ModelWithArraySchema = {
- description: 'This is a model with one property containing an array',
- type: 'object',
- properties: {
- prop: {
- type: 'array',
- items: {
- '$ref': '#/definitions/ModelWithString'
- }
- },
- propWithFile: {
- type: 'array',
- items: {
- type: 'file'
- }
- },
- propWithNumber: {
- type: 'array',
- items: {
- type: 'number'
- }
- }
- }
-} as const;
-
-export const ModelWithDictionarySchema = {
- description: 'This is a model with one property containing a dictionary',
- type: 'object',
- properties: {
- prop: {
- type: 'object',
- additionalProperties: {
- type: 'string'
- }
- }
- }
-} as const;
-
-export const ModelWithCircularReferenceSchema = {
- description: 'This is a model with one property containing a circular reference',
- type: 'object',
- properties: {
- prop: {
- '$ref': '#/definitions/ModelWithCircularReference'
- }
- }
-} as const;
-
-export const ModelWithPropertiesSchema = {
- description: 'This is a model with one nested property',
- type: 'object',
- required: ['required', 'requiredAndReadOnly'],
- properties: {
- required: {
- type: 'string'
- },
- requiredAndReadOnly: {
- type: 'string',
- readOnly: true
- },
- string: {
- type: 'string'
- },
- number: {
- type: 'number'
- },
- boolean: {
- type: 'boolean'
- },
- reference: {
- '$ref': '#/definitions/ModelWithString'
- },
- 'property with space': {
- type: 'string'
- },
- default: {
- type: 'string'
- },
- try: {
- type: 'string'
- },
- '@namespace.string': {
- type: 'string',
- readOnly: true
- },
- '@namespace.integer': {
- type: 'integer',
- readOnly: true
- }
- }
-} as const;
-
-export const ModelWithNestedPropertiesSchema = {
- description: 'This is a model with one nested property',
- type: 'object',
- required: ['first'],
- properties: {
- first: {
- type: 'object',
- required: ['second'],
- readOnly: true,
- properties: {
- second: {
- type: 'object',
- required: ['third'],
- readOnly: true,
- properties: {
- third: {
- type: 'string',
- readOnly: true
- }
- }
- }
- }
- }
- }
-} as const;
-
-export const ModelWithDuplicatePropertiesSchema = {
- description: 'This is a model with duplicated properties',
- type: 'object',
- properties: {
- prop: {
- '$ref': '#/definitions/ModelWithString'
- }
- }
-} as const;
-
-export const ModelWithOrderedPropertiesSchema = {
- description: 'This is a model with ordered properties',
- type: 'object',
- properties: {
- zebra: {
- type: 'string'
- },
- apple: {
- type: 'string'
- },
- hawaii: {
- type: 'string'
- }
- }
-} as const;
-
-export const ModelWithDuplicateImportsSchema = {
- description: 'This is a model with duplicated imports',
- type: 'object',
- properties: {
- propA: {
- '$ref': '#/definitions/ModelWithString'
- },
- propB: {
- '$ref': '#/definitions/ModelWithString'
- },
- propC: {
- '$ref': '#/definitions/ModelWithString'
- }
- }
-} as const;
-
-export const ModelThatExtendsSchema = {
- description: 'This is a model that extends another model',
- type: 'object',
- allOf: [
- {
- '$ref': '#/definitions/ModelWithString'
- },
- {
- type: 'object',
- properties: {
- propExtendsA: {
- type: 'string'
- },
- propExtendsB: {
- '$ref': '#/definitions/ModelWithString'
- }
- }
- }
- ]
-} as const;
-
-export const ModelThatExtendsExtendsSchema = {
- description: 'This is a model that extends another model',
- type: 'object',
- allOf: [
- {
- '$ref': '#/definitions/ModelWithString'
- },
- {
- '$ref': '#/definitions/ModelThatExtends'
- },
- {
- type: 'object',
- properties: {
- propExtendsC: {
- type: 'string'
- },
- propExtendsD: {
- '$ref': '#/definitions/ModelWithString'
- }
- }
- }
- ]
-} as const;
-
-export const defaultSchema = {
- type: 'object',
- properties: {
- name: {
- type: 'string'
- }
- }
-} as const;
-
-export const ModelWithPatternSchema = {
- description: 'This is a model that contains a some patterns',
- type: 'object',
- required: ['key', 'name'],
- properties: {
- key: {
- maxLength: 64,
- pattern: '^[a-zA-Z0-9_]*$',
- type: 'string'
- },
- name: {
- maxLength: 255,
- type: 'string'
- },
- enabled: {
- type: 'boolean',
- readOnly: true
- },
- modified: {
- type: 'string',
- format: 'date-time',
- readOnly: true
- },
- id: {
- type: 'string',
- pattern: '^\\d{2}-\\d{3}-\\d{4}$'
- },
- text: {
- type: 'string',
- pattern: '^\\w+$'
- },
- patternWithSingleQuotes: {
- type: 'string',
- pattern: "^[a-zA-Z0-9']*$"
- },
- patternWithNewline: {
- type: 'string',
- pattern: 'aaa\\nbbb'
- },
- patternWithBacktick: {
- type: 'string',
- pattern: 'aaa`bbb'
- }
- }
-} as const;
-
-export const parameter_ActivityParamsSchema = {
- type: 'object',
- properties: {
- description: {
- type: 'string'
- },
- graduate_id: {
- type: 'integer'
- },
- organization_id: {
- type: 'integer'
- },
- parent_activity: {
- type: 'integer'
- },
- post_id: {
- type: 'integer'
- }
- }
-} as const;
-
-export const response_PostActivityResponseSchema = {
- type: 'object',
- properties: {
- description: {
- type: 'string'
- },
- graduate_id: {
- type: 'integer'
- },
- organization_id: {
- type: 'integer'
- },
- parent_activity_id: {
- type: 'integer'
- },
- post_id: {
- type: 'integer'
- }
- }
-} as const;
-
-export const failure_FailureSchema = {
- type: 'object',
- properties: {
- error: {
- type: 'string'
- },
- message: {
- type: 'string'
- },
- reference_code: {
- type: 'string'
- }
- }
-} as const;
\ No newline at end of file
diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v2/sdk.gen.ts.snap b/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v2/sdk.gen.ts.snap
deleted file mode 100644
index ea2b892138..0000000000
--- a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v2/sdk.gen.ts.snap
+++ /dev/null
@@ -1,635 +0,0 @@
-// This file is auto-generated by @hey-api/openapi-ts
-
-import type { CancelablePromise } from './core/CancelablePromise';
-import { OpenAPI } from './core/OpenAPI';
-import { request as __request } from './core/request';
-import type { CollectionFormatData, ComplexTypesData, ComplexTypesResponse, PatchApiNoTagResponse, FooWowResponse, PostApiBodyData, PostApiBodyResponse, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, CallWithDescriptionsData, TestErrorCodeData, TestErrorCodeResponse, CallWithResultFromHeaderResponse, DummyAResponse, DummyBResponse, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithResponseResponse, CallWithDuplicateResponsesResponse, CallWithResponsesResponse, TypesData, TypesResponse } from './types.gen';
-
-export class CollectionFormat {
- /**
- * @param data The data for the request.
- * @param data.parameterArrayCsv This is an array parameter that is sent as csv format (comma-separated values)
- * @param data.parameterArraySsv This is an array parameter that is sent as ssv format (space-separated values)
- * @param data.parameterArrayTsv This is an array parameter that is sent as tsv format (tab-separated values)
- * @param data.parameterArrayPipes This is an array parameter that is sent as pipes format (pipe-separated values)
- * @param data.parameterArrayMulti This is an array parameter that is sent as multi format (multiple parameter instances)
- * @throws ApiError
- */
- public static collectionFormat(data: CollectionFormatData): CancelablePromise {
- return __request(OpenAPI, {
- method: 'GET',
- url: '/api/v{api-version}/collectionFormat',
- query: {
- parameterArrayCSV: data.parameterArrayCsv,
- parameterArraySSV: data.parameterArraySsv,
- parameterArrayTSV: data.parameterArrayTsv,
- parameterArrayPipes: data.parameterArrayPipes,
- parameterArrayMulti: data.parameterArrayMulti
- }
- });
- }
-}
-
-export class Complex {
- /**
- * @param data The data for the request.
- * @param data.parameterObject Parameter containing object
- * @param data.parameterReference Parameter containing reference
- * @returns ModelWithString Successful response
- * @throws ApiError
- */
- public static complexTypes(data: ComplexTypesData): CancelablePromise {
- return __request(OpenAPI, {
- method: 'GET',
- url: '/api/v{api-version}/complex',
- query: {
- parameterObject: data.parameterObject,
- parameterReference: data.parameterReference
- },
- errors: {
- 400: '400 server error',
- 500: '500 server error'
- }
- });
- }
-}
-
-export class Default {
- /**
- * @throws ApiError
- */
- public static serviceWithEmptyTag(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'GET',
- url: '/api/v{api-version}/no+tag'
- });
- }
-
- /**
- * @returns unknown OK
- * @throws ApiError
- */
- public static patchApiNoTag(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'PATCH',
- url: '/api/v{api-version}/no+tag'
- });
- }
-
- /**
- * @returns unknown OK
- * @throws ApiError
- */
- public static fooWow(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'PUT',
- url: '/api/v{api-version}/no+tag'
- });
- }
-
- /**
- * Body should not be unknown
- * Body should not be unknown
- * @param data The data for the request.
- * @param data.request Body should not be unknown
- * @returns response_PostActivityResponse OK
- * @throws ApiError
- */
- public static postApiBody(data: PostApiBodyData): CancelablePromise {
- return __request(OpenAPI, {
- method: 'POST',
- url: '/api/v{api-version}/body',
- body: data.request,
- errors: {
- 400: 'Bad Request',
- 500: 'Internal Server Error'
- }
- });
- }
-}
-
-export class Defaults {
- /**
- * @param data The data for the request.
- * @param data.parameterString This is a simple string with default value
- * @param data.parameterNumber This is a simple number with default value
- * @param data.parameterBoolean This is a simple boolean with default value
- * @param data.parameterEnum This is a simple enum with default value
- * @param data.parameterModel This is a simple model with default value
- * @throws ApiError
- */
- public static callWithDefaultParameters(data: CallWithDefaultParametersData): CancelablePromise {
- return __request(OpenAPI, {
- method: 'GET',
- url: '/api/v{api-version}/defaults',
- query: {
- parameterString: data.parameterString,
- parameterNumber: data.parameterNumber,
- parameterBoolean: data.parameterBoolean,
- parameterEnum: data.parameterEnum,
- parameterModel: data.parameterModel
- }
- });
- }
-
- /**
- * @param data The data for the request.
- * @param data.parameterString This is a simple string that is optional with default value
- * @param data.parameterNumber This is a simple number that is optional with default value
- * @param data.parameterBoolean This is a simple boolean that is optional with default value
- * @param data.parameterEnum This is a simple enum that is optional with default value
- * @param data.parameterModel This is a simple model that is optional with default value
- * @throws ApiError
- */
- public static callWithDefaultOptionalParameters(data: CallWithDefaultOptionalParametersData = {}): CancelablePromise {
- return __request(OpenAPI, {
- method: 'POST',
- url: '/api/v{api-version}/defaults',
- query: {
- parameterString: data.parameterString,
- parameterNumber: data.parameterNumber,
- parameterBoolean: data.parameterBoolean,
- parameterEnum: data.parameterEnum,
- parameterModel: data.parameterModel
- }
- });
- }
-
- /**
- * @param data The data for the request.
- * @param data.parameterStringWithNoDefault This is a string with no default
- * @param data.parameterOptionalStringWithDefault This is a optional string with default
- * @param data.parameterOptionalStringWithEmptyDefault This is a optional string with empty default
- * @param data.parameterOptionalStringWithNoDefault This is a optional string with no default
- * @param data.parameterStringWithDefault This is a string with default
- * @param data.parameterStringWithEmptyDefault This is a string with empty default
- * @param data.parameterStringNullableWithNoDefault This is a string that can be null with no default
- * @param data.parameterStringNullableWithDefault This is a string that can be null with default
- * @throws ApiError
- */
- public static callToTestOrderOfParams(data: CallToTestOrderOfParamsData): CancelablePromise {
- return __request(OpenAPI, {
- method: 'PUT',
- url: '/api/v{api-version}/defaults',
- query: {
- parameterOptionalStringWithDefault: data.parameterOptionalStringWithDefault,
- parameterOptionalStringWithEmptyDefault: data.parameterOptionalStringWithEmptyDefault,
- parameterOptionalStringWithNoDefault: data.parameterOptionalStringWithNoDefault,
- parameterStringWithDefault: data.parameterStringWithDefault,
- parameterStringWithEmptyDefault: data.parameterStringWithEmptyDefault,
- parameterStringWithNoDefault: data.parameterStringWithNoDefault,
- parameterStringNullableWithNoDefault: data.parameterStringNullableWithNoDefault,
- parameterStringNullableWithDefault: data.parameterStringNullableWithDefault
- }
- });
- }
-}
-
-export class Descriptions {
- /**
- * @param data The data for the request.
- * @param data.parameterWithBreaks Testing multiline comments in string: First line
- * Second line
- *
- * Fourth line
- * @param data.parameterWithBackticks Testing backticks in string: `backticks` and ```multiple backticks``` should work
- * @param data.parameterWithSlashes Testing slashes in string: \backwards\\\ and /forwards/// should work
- * @param data.parameterWithExpressionPlaceholders Testing expression placeholders in string: ${expression} should work
- * @param data.parameterWithQuotes Testing quotes in string: 'single quote''' and "double quotes""" should work
- * @param data.parameterWithReservedCharacters Testing reserved characters in string: * inline * and ** inline ** should work
- * @throws ApiError
- */
- public static callWithDescriptions(data: CallWithDescriptionsData = {}): CancelablePromise {
- return __request(OpenAPI, {
- method: 'POST',
- url: '/api/v{api-version}/descriptions/',
- query: {
- parameterWithBreaks: data.parameterWithBreaks,
- parameterWithBackticks: data.parameterWithBackticks,
- parameterWithSlashes: data.parameterWithSlashes,
- parameterWithExpressionPlaceholders: data.parameterWithExpressionPlaceholders,
- parameterWithQuotes: data.parameterWithQuotes,
- parameterWithReservedCharacters: data.parameterWithReservedCharacters
- }
- });
- }
-}
-
-export class Duplicate {
- /**
- * @throws ApiError
- */
- public static duplicateName(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'GET',
- url: '/api/v{api-version}/duplicate'
- });
- }
-
- /**
- * @throws ApiError
- */
- public static duplicateName1(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'POST',
- url: '/api/v{api-version}/duplicate'
- });
- }
-
- /**
- * @throws ApiError
- */
- public static duplicateName2(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'PUT',
- url: '/api/v{api-version}/duplicate'
- });
- }
-
- /**
- * @throws ApiError
- */
- public static duplicateName3(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'DELETE',
- url: '/api/v{api-version}/duplicate'
- });
- }
-}
-
-export class Error {
- /**
- * @param data The data for the request.
- * @param data.status Status code to return
- * @returns unknown Custom message: Successful response
- * @throws ApiError
- */
- public static testErrorCode(data: TestErrorCodeData): CancelablePromise {
- return __request(OpenAPI, {
- method: 'POST',
- url: '/api/v{api-version}/error',
- query: {
- status: data.status
- },
- errors: {
- 500: 'Custom message: Internal Server Error',
- 501: 'Custom message: Not Implemented',
- 502: 'Custom message: Bad Gateway',
- 503: 'Custom message: Service Unavailable'
- }
- });
- }
-}
-
-export class Header {
- /**
- * @returns string Successful response
- * @throws ApiError
- */
- public static callWithResultFromHeader(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'POST',
- url: '/api/v{api-version}/header',
- responseHeader: 'operation-location',
- errors: {
- 400: '400 server error',
- 500: '500 server error'
- }
- });
- }
-}
-
-export class MultipleTags1 {
- /**
- * @returns void Success
- * @throws ApiError
- */
- public static dummyA(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'GET',
- url: '/api/v{api-version}/multiple-tags/a'
- });
- }
-
- /**
- * @returns void Success
- * @throws ApiError
- */
- public static dummyB(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'GET',
- url: '/api/v{api-version}/multiple-tags/b'
- });
- }
-}
-
-export class MultipleTags2 {
- /**
- * @returns void Success
- * @throws ApiError
- */
- public static dummyA(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'GET',
- url: '/api/v{api-version}/multiple-tags/a'
- });
- }
-
- /**
- * @returns void Success
- * @throws ApiError
- */
- public static dummyB(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'GET',
- url: '/api/v{api-version}/multiple-tags/b'
- });
- }
-}
-
-export class MultipleTags3 {
- /**
- * @returns void Success
- * @throws ApiError
- */
- public static dummyB(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'GET',
- url: '/api/v{api-version}/multiple-tags/b'
- });
- }
-}
-
-export class NoContent {
- /**
- * @returns void Success
- * @throws ApiError
- */
- public static callWithNoContentResponse(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'GET',
- url: '/api/v{api-version}/no-content'
- });
- }
-
- /**
- * @returns unknown Response is a simple number
- * @returns void Success
- * @throws ApiError
- */
- public static callWithResponseAndNoContentResponse(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'GET',
- url: '/api/v{api-version}/multiple-tags/response-and-no-content'
- });
- }
-}
-
-export class NonAsciiÆøåÆøÅöôêÊ {
- /**
- * @param data The data for the request.
- * @param data.nonAsciiParamæøåÆøÅöôêÊ Dummy input param
- * @returns NonAsciiStringæøåÆØÅöôêÊ字符串 Successful response
- * @throws ApiError
- */
- public static nonAsciiæøåÆøÅöôêÊ字符串(data: NonAsciiæøåÆøÅöôêÊ字符串Data): CancelablePromise {
- return __request(OpenAPI, {
- method: 'POST',
- url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串',
- query: {
- 'nonAsciiParamæøåÆØÅöôêÊ': data.nonAsciiParamæøåÆøÅöôêÊ
- }
- });
- }
-}
-
-export class Parameters {
- /**
- * @param data The data for the request.
- * @param data.parameterHeader This is the parameter that goes into the header
- * @param data.parameterQuery This is the parameter that goes into the query params
- * @param data.parameterForm This is the parameter that goes into the form data
- * @param data.parameterPath This is the parameter that goes into the path
- * @throws ApiError
- */
- public static callWithParameters(data: CallWithParametersData): CancelablePromise {
- return __request(OpenAPI, {
- method: 'POST',
- url: '/api/v{api-version}/parameters/{parameterPath}',
- path: {
- parameterPath: data.parameterPath
- },
- headers: {
- parameterHeader: data.parameterHeader
- },
- query: {
- parameterQuery: data.parameterQuery
- },
- formData: {
- parameterForm: data.parameterForm
- }
- });
- }
-
- /**
- * @param data The data for the request.
- * @param data.parameterHeader This is the parameter that goes into the request header
- * @param data.parameterQuery This is the parameter that goes into the request query params
- * @param data.parameterBody This is the parameter that is sent as request body
- * @param data.parameterPath1 This is the parameter that goes into the path
- * @param data.parameterPath2 This is the parameter that goes into the path
- * @param data.parameterPath3 This is the parameter that goes into the path
- * @param data._default This is the parameter with a reserved keyword
- * @throws ApiError
- */
- public static callWithWeirdParameterNames(data: CallWithWeirdParameterNamesData): CancelablePromise {
- return __request(OpenAPI, {
- method: 'POST',
- url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}',
- path: {
- 'parameter.path.1': data.parameterPath1,
- 'parameter-path-2': data.parameterPath2,
- 'PARAMETER-PATH-3': data.parameterPath3
- },
- headers: {
- 'parameter.header': data.parameterHeader
- },
- query: {
- default: data._default,
- 'parameter-query': data.parameterQuery
- },
- body: data.parameterBody
- });
- }
-}
-
-export class Response {
- /**
- * @returns unknown Response is a simple number
- * @returns void Success
- * @throws ApiError
- */
- public static callWithResponseAndNoContentResponse(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'GET',
- url: '/api/v{api-version}/multiple-tags/response-and-no-content'
- });
- }
-
- /**
- * @returns ModelWithString Message for default response
- * @throws ApiError
- */
- public static callWithResponse(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'GET',
- url: '/api/v{api-version}/response'
- });
- }
-
- /**
- * @returns ModelWithString Message for 201 response
- * @returns ModelWithString Message for 202 response
- * @throws ApiError
- */
- public static callWithDuplicateResponses(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'POST',
- url: '/api/v{api-version}/response',
- errors: {
- 500: 'Message for 500 error',
- 501: 'Message for 501 error',
- 502: 'Message for 502 error',
- default: 'Message for default response'
- }
- });
- }
-
- /**
- * @returns unknown Message for 200 response
- * @returns ModelThatExtends Message for 201 response
- * @returns ModelThatExtendsExtends Message for 202 response
- * @throws ApiError
- */
- public static callWithResponses(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'PUT',
- url: '/api/v{api-version}/response',
- errors: {
- 500: 'Message for 500 error',
- 501: 'Message for 501 error',
- 502: 'Message for 502 error',
- default: 'Message for default response'
- }
- });
- }
-}
-
-export class Simple {
- /**
- * @throws ApiError
- */
- public static getCallWithoutParametersAndResponse(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'GET',
- url: '/api/v{api-version}/simple'
- });
- }
-
- /**
- * @throws ApiError
- */
- public static putCallWithoutParametersAndResponse(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'PUT',
- url: '/api/v{api-version}/simple'
- });
- }
-
- /**
- * @throws ApiError
- */
- public static postCallWithoutParametersAndResponse(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'POST',
- url: '/api/v{api-version}/simple'
- });
- }
-
- /**
- * @throws ApiError
- */
- public static deleteCallWithoutParametersAndResponse(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'DELETE',
- url: '/api/v{api-version}/simple'
- });
- }
-
- /**
- * @throws ApiError
- */
- public static optionsCallWithoutParametersAndResponse(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'OPTIONS',
- url: '/api/v{api-version}/simple'
- });
- }
-
- /**
- * @throws ApiError
- */
- public static headCallWithoutParametersAndResponse(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'HEAD',
- url: '/api/v{api-version}/simple'
- });
- }
-
- /**
- * @throws ApiError
- */
- public static patchCallWithoutParametersAndResponse(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'PATCH',
- url: '/api/v{api-version}/simple'
- });
- }
-}
-
-export class Types {
- /**
- * @param data The data for the request.
- * @param data.parameterArray This is an array parameter
- * @param data.parameterDictionary This is a dictionary parameter
- * @param data.parameterEnum This is an enum parameter
- * @param data.parameterNumber This is a number parameter
- * @param data.parameterString This is a string parameter
- * @param data.parameterBoolean This is a boolean parameter
- * @param data.parameterObject This is an object parameter
- * @param data.id This is a number parameter
- * @returns number Response is a simple number
- * @returns string Response is a simple string
- * @returns boolean Response is a simple boolean
- * @returns unknown Response is a simple object
- * @throws ApiError
- */
- public static types(data: TypesData): CancelablePromise {
- return __request(OpenAPI, {
- method: 'GET',
- url: '/api/v{api-version}/types',
- path: {
- id: data.id
- },
- query: {
- parameterNumber: data.parameterNumber,
- parameterString: data.parameterString,
- parameterBoolean: data.parameterBoolean,
- parameterObject: data.parameterObject,
- parameterArray: data.parameterArray,
- parameterDictionary: data.parameterDictionary,
- parameterEnum: data.parameterEnum
- }
- });
- }
-}
\ No newline at end of file
diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v2/types.gen.ts.snap b/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v2/types.gen.ts.snap
deleted file mode 100644
index 9c4bd8d196..0000000000
--- a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v2/types.gen.ts.snap
+++ /dev/null
@@ -1,777 +0,0 @@
-// This file is auto-generated by @hey-api/openapi-ts
-
-export type _default = {
- name?: string;
-};
-
-/**
- * This is a simple array containing an array
- */
-export type ArrayWithArray = Array>;
-
-/**
- * This is a simple array with booleans
- */
-export type ArrayWithBooleans = Array;
-
-/**
- * This is a simple array with numbers
- */
-export type ArrayWithNumbers = Array;
-
-/**
- * This is a simple array with properties
- */
-export type ArrayWithProperties = Array<{
- foo?: string;
- bar?: string;
-}>;
-
-/**
- * This is a simple array with references
- */
-export type ArrayWithReferences = Array;
-
-/**
- * This is a simple array with strings
- */
-export type ArrayWithStrings = Array;
-
-/**
- * Testing backticks in string: `backticks` and ```multiple backticks``` should work
- */
-export type CommentWithBackticks = number;
-
-/**
- * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work
- */
-export type CommentWithBackticksAndQuotes = number;
-
-/**
- * Testing multiline comments in string: First line
- * Second line
- *
- * Fourth line
- */
-export type CommentWithBreaks = number;
-
-/**
- * Testing expression placeholders in string: ${expression} should work
- */
-export type CommentWithExpressionPlaceholders = number;
-
-/**
- * Testing quotes in string: 'single quote''' and "double quotes""" should work
- */
-export type CommentWithQuotes = number;
-
-/**
- * Testing reserved characters in string: * inline * and ** inline ** should work
- */
-export type CommentWithReservedCharacters = number;
-
-/**
- * Testing slashes in string: \backwards\\\ and /forwards/// should work
- */
-export type CommentWithSlashes = number;
-
-/**
- * This is a type-only model that defines Date as a string
- */
-export type Date = string;
-
-/**
- * This is a complex dictionary
- */
-export type DictionaryWithArray = {
- [key: string]: Array;
-};
-
-/**
- * This is a string dictionary
- */
-export type DictionaryWithDictionary = {
- [key: string]: {
- [key: string]: string;
- };
-};
-
-/**
- * This is a complex dictionary
- */
-export type DictionaryWithProperties = {
- [key: string]: {
- foo?: string;
- bar?: string;
- };
-};
-
-/**
- * This is a string reference
- */
-export type DictionaryWithReference = {
- [key: string]: ModelWithString;
-};
-
-/**
- * This is a string dictionary
- */
-export type DictionaryWithString = {
- [key: string]: string;
-};
-
-/**
- * Success=1,Warning=2,Error=3
- */
-export type EnumFromDescription = number;
-
-/**
- * This is a simple enum with numbers
- */
-export type EnumWithExtensions = 200 | 400 | 500;
-
-/**
- * This is a simple enum with numbers
- */
-export const EnumWithExtensions = {
- /**
- * Used when the status of something is successful
- */
- CUSTOM_SUCCESS: 200,
- /**
- * Used when the status of something has a warning
- */
- CUSTOM_WARNING: 400,
- /**
- * Used when the status of something has an error
- */
- CUSTOM_ERROR: 500
-} as const;
-
-/**
- * This is a simple enum with numbers
- */
-export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3;
-
-/**
- * This is a simple enum with numbers
- */
-export const EnumWithNumbers = {
- '_1': 1,
- '_2': 2,
- '_3': 3,
- '_1.1': 1.1,
- '_1.2': 1.2,
- '_1.3': 1.3,
- '_100': 100,
- '_200': 200,
- '_300': 300,
- '_-100': -100,
- '_-200': -200,
- '_-300': -300,
- '_-1.1': -1.1,
- '_-1.2': -1.2,
- '_-1.3': -1.3
-} as const;
-
-/**
- * This is a simple enum with strings
- */
-export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串';
-
-/**
- * This is a simple enum with strings
- */
-export const EnumWithStrings = {
- SUCCESS: 'Success',
- WARNING: 'Warning',
- ERROR: 'Error',
- _SINGLE_QUOTE_: "'Single Quote'",
- _DOUBLE_QUOTES_: '"Double Quotes"',
- 'NON_ASCII__ØÆÅÔÖ_ØÆÅÔÖ字符串': 'Non-ascii: øæåôöØÆÅÔÖ字符串'
-} as const;
-
-export type failure_Failure = {
- error?: string;
- message?: string;
- reference_code?: string;
-};
-
-/**
- * This is a model that extends another model
- */
-export type ModelThatExtends = ModelWithString & {
- propExtendsA?: string;
- propExtendsB?: ModelWithString;
-};
-
-/**
- * This is a model that extends another model
- */
-export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & {
- propExtendsC?: string;
- propExtendsD?: ModelWithString;
-};
-
-/**
- * This is a model with one property containing an array
- */
-export type ModelWithArray = {
- prop?: Array;
- propWithFile?: Array;
- propWithNumber?: Array;
-};
-
-/**
- * This is a model with one boolean property
- */
-export type ModelWithBoolean = {
- /**
- * This is a simple boolean property
- */
- prop?: boolean;
-};
-
-/**
- * This is a model with one property containing a circular reference
- */
-export type ModelWithCircularReference = {
- prop?: ModelWithCircularReference;
-};
-
-/**
- * This is a model with one property containing a dictionary
- */
-export type ModelWithDictionary = {
- prop?: {
- [key: string]: string;
- };
-};
-
-/**
- * This is a model with duplicated imports
- */
-export type ModelWithDuplicateImports = {
- propA?: ModelWithString;
- propB?: ModelWithString;
- propC?: ModelWithString;
-};
-
-/**
- * This is a model with duplicated properties
- */
-export type ModelWithDuplicateProperties = {
- prop?: ModelWithString;
-};
-
-/**
- * This is a model with one enum
- */
-export type ModelWithEnum = {
- /**
- * This is a simple enum with strings
- */
- test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串';
- /**
- * These are the HTTP error code enums
- */
- statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar';
- /**
- * Simple boolean enum
- */
- bool?: boolean;
-};
-
-export namespace ModelWithEnum {
- /**
- * This is a simple enum with strings
- */
- export enum test {
- SUCCESS = 'Success',
- WARNING = 'Warning',
- ERROR = 'Error',
- ØÆÅ字符串 = 'ØÆÅ字符串'
- }
- /**
- * These are the HTTP error code enums
- */
- export enum statusCode {
- _100 = '100',
- _200_FOO = '200 FOO',
- _300_FOO_BAR = '300 FOO_BAR',
- _400_FOO_BAR = '400 foo-bar',
- _500_FOO_BAR = '500 foo.bar',
- _600_FOO_BAR = '600 foo&bar'
- }
-}
-
-/**
- * This is a model with one enum
- */
-export type ModelWithEnumFromDescription = {
- /**
- * Success=1,Warning=2,Error=3
- */
- test?: number;
-};
-
-/**
- * This is a model with one number property
- */
-export type ModelWithInteger = {
- /**
- * This is a simple number property
- */
- prop?: number;
-};
-
-/**
- * This is a model with nested enums
- */
-export type ModelWithNestedEnums = {
- dictionaryWithEnum?: {
- [key: string]: 'Success' | 'Warning' | 'Error';
- };
- dictionaryWithEnumFromDescription?: {
- [key: string]: number;
- };
- arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>;
- arrayWithDescription?: Array;
-};
-
-/**
- * This is a model with one nested property
- */
-export type ModelWithNestedProperties = {
- readonly first: {
- readonly second: {
- readonly third: string;
- };
- };
-};
-
-/**
- * This is a model with one string property
- */
-export type ModelWithNullableString = {
- /**
- * This is a simple string property
- */
- nullableProp?: (string) | null;
- /**
- * This is a simple string property
- */
- nullableRequiredProp: (string) | null;
-};
-
-/**
- * This is a model with ordered properties
- */
-export type ModelWithOrderedProperties = {
- zebra?: string;
- apple?: string;
- hawaii?: string;
-};
-
-/**
- * This is a model that contains a some patterns
- */
-export type ModelWithPattern = {
- key: string;
- name: string;
- readonly enabled?: boolean;
- readonly modified?: string;
- id?: string;
- text?: string;
- patternWithSingleQuotes?: string;
- patternWithNewline?: string;
- patternWithBacktick?: string;
-};
-
-/**
- * This is a model with one nested property
- */
-export type ModelWithProperties = {
- required: string;
- readonly requiredAndReadOnly: string;
- string?: string;
- number?: number;
- boolean?: boolean;
- reference?: ModelWithString;
- 'property with space'?: string;
- default?: string;
- try?: string;
- readonly '@namespace.string'?: string;
- readonly '@namespace.integer'?: number;
-};
-
-/**
- * This is a model with one property containing a reference
- */
-export type ModelWithReference = {
- prop?: ModelWithProperties;
-};
-
-/**
- * This is a model with one string property
- */
-export type ModelWithString = {
- /**
- * This is a simple string property
- */
- prop?: string;
-};
-
-/**
- * This is a model with one string property
- */
-export type ModelWithStringError = {
- /**
- * This is a simple string property
- */
- prop?: string;
-};
-
-/**
- * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串)
- */
-export type NonAsciiStringæøåÆØÅöôêÊ字符串 = string;
-
-export type parameter_ActivityParams = {
- description?: string;
- graduate_id?: number;
- organization_id?: number;
- parent_activity?: number;
- post_id?: number;
-};
-
-export type response_PostActivityResponse = {
- description?: string;
- graduate_id?: number;
- organization_id?: number;
- parent_activity_id?: number;
- post_id?: number;
-};
-
-/**
- * This is a simple boolean
- */
-export type SimpleBoolean = boolean;
-
-/**
- * This is a simple file
- */
-export type SimpleFile = Blob | File;
-
-/**
- * This is a simple number
- */
-export type SimpleInteger = number;
-
-/**
- * This is a simple reference
- */
-export type SimpleReference = ModelWithString;
-
-/**
- * This is a simple string
- */
-export type SimpleString = string;
-
-/**
- * This is a simple string
- */
-export type SimpleStringWithPattern = string;
-
-export type CollectionFormatData = {
- /**
- * This is an array parameter that is sent as csv format (comma-separated values)
- */
- parameterArrayCsv: Array;
- /**
- * This is an array parameter that is sent as multi format (multiple parameter instances)
- */
- parameterArrayMulti: Array;
- /**
- * This is an array parameter that is sent as pipes format (pipe-separated values)
- */
- parameterArrayPipes: Array;
- /**
- * This is an array parameter that is sent as ssv format (space-separated values)
- */
- parameterArraySsv: Array;
- /**
- * This is an array parameter that is sent as tsv format (tab-separated values)
- */
- parameterArrayTsv: Array;
-};
-
-export type ComplexTypesData = {
- /**
- * Parameter containing object
- */
- parameterObject: {
- first?: {
- second?: {
- third?: string;
- };
- };
- };
- /**
- * Parameter containing reference
- */
- parameterReference: ModelWithString;
-};
-
-export type ComplexTypesResponse = (Array);
-
-export type PatchApiNoTagResponse = (unknown);
-
-export type FooWowResponse = (unknown);
-
-export type PostApiBodyData = {
- /**
- * Body should not be unknown
- */
- request: parameter_ActivityParams;
-};
-
-export type PostApiBodyResponse = (response_PostActivityResponse);
-
-export type CallWithDefaultParametersData = {
- /**
- * This is a simple boolean with default value
- */
- parameterBoolean: boolean;
- /**
- * This is a simple enum with default value
- */
- parameterEnum: 'Success' | 'Warning' | 'Error';
- /**
- * This is a simple model with default value
- */
- parameterModel: ModelWithString;
- /**
- * This is a simple number with default value
- */
- parameterNumber: number;
- /**
- * This is a simple string with default value
- */
- parameterString: string;
-};
-
-export type CallWithDefaultOptionalParametersData = {
- /**
- * This is a simple boolean that is optional with default value
- */
- parameterBoolean?: boolean;
- /**
- * This is a simple enum that is optional with default value
- */
- parameterEnum?: 'Success' | 'Warning' | 'Error';
- /**
- * This is a simple model that is optional with default value
- */
- parameterModel?: ModelWithString;
- /**
- * This is a simple number that is optional with default value
- */
- parameterNumber?: number;
- /**
- * This is a simple string that is optional with default value
- */
- parameterString?: string;
-};
-
-export type CallToTestOrderOfParamsData = {
- /**
- * This is a optional string with default
- */
- parameterOptionalStringWithDefault?: string;
- /**
- * This is a optional string with empty default
- */
- parameterOptionalStringWithEmptyDefault?: string;
- /**
- * This is a optional string with no default
- */
- parameterOptionalStringWithNoDefault?: string;
- /**
- * This is a string that can be null with default
- */
- parameterStringNullableWithDefault?: (string) | null;
- /**
- * This is a string that can be null with no default
- */
- parameterStringNullableWithNoDefault?: (string) | null;
- /**
- * This is a string with default
- */
- parameterStringWithDefault: string;
- /**
- * This is a string with empty default
- */
- parameterStringWithEmptyDefault: string;
- /**
- * This is a string with no default
- */
- parameterStringWithNoDefault: string;
-};
-
-export type CallWithDescriptionsData = {
- /**
- * Testing backticks in string: `backticks` and ```multiple backticks``` should work
- */
- parameterWithBackticks?: string;
- /**
- * Testing multiline comments in string: First line
- * Second line
- *
- * Fourth line
- */
- parameterWithBreaks?: string;
- /**
- * Testing expression placeholders in string: ${expression} should work
- */
- parameterWithExpressionPlaceholders?: string;
- /**
- * Testing quotes in string: 'single quote''' and "double quotes""" should work
- */
- parameterWithQuotes?: string;
- /**
- * Testing reserved characters in string: * inline * and ** inline ** should work
- */
- parameterWithReservedCharacters?: string;
- /**
- * Testing slashes in string: \backwards\\\ and /forwards/// should work
- */
- parameterWithSlashes?: string;
-};
-
-export type TestErrorCodeData = {
- /**
- * Status code to return
- */
- status: string;
-};
-
-export type TestErrorCodeResponse = (unknown);
-
-export type CallWithResultFromHeaderResponse = (string);
-
-export type DummyAResponse = (void);
-
-export type DummyBResponse = (void);
-
-export type CallWithNoContentResponseResponse = (void);
-
-export type CallWithResponseAndNoContentResponseResponse = (unknown | void);
-
-export type NonAsciiæøåÆøÅöôêÊ字符串Data = {
- /**
- * Dummy input param
- */
- nonAsciiParamæøåÆøÅöôêÊ: number;
-};
-
-export type NonAsciiæøåÆøÅöôêÊ字符串Response = (NonAsciiStringæøåÆØÅöôêÊ字符串);
-
-export type CallWithParametersData = {
- /**
- * This is the parameter that goes into the form data
- */
- parameterForm: string;
- /**
- * This is the parameter that goes into the header
- */
- parameterHeader: string;
- /**
- * This is the parameter that goes into the path
- */
- parameterPath: string;
- /**
- * This is the parameter that goes into the query params
- */
- parameterQuery: string;
-};
-
-export type CallWithWeirdParameterNamesData = {
- /**
- * This is the parameter with a reserved keyword
- */
- _default?: string;
- /**
- * This is the parameter that is sent as request body
- */
- parameterBody: string;
- /**
- * This is the parameter that goes into the request header
- */
- parameterHeader: string;
- /**
- * This is the parameter that goes into the path
- */
- parameterPath1?: string;
- /**
- * This is the parameter that goes into the path
- */
- parameterPath2?: string;
- /**
- * This is the parameter that goes into the path
- */
- parameterPath3?: string;
- /**
- * This is the parameter that goes into the request query params
- */
- parameterQuery: string;
-};
-
-export type CallWithResponseResponse = (ModelWithString);
-
-export type CallWithDuplicateResponsesResponse = (ModelWithString);
-
-export type CallWithResponsesResponse = ({
- readonly '@namespace.string'?: string;
- readonly '@namespace.integer'?: number;
- readonly value?: Array;
-} | ModelThatExtends | ModelThatExtendsExtends);
-
-export type TypesData = {
- /**
- * This is a number parameter
- */
- id?: number;
- /**
- * This is an array parameter
- */
- parameterArray: Array;
- /**
- * This is a boolean parameter
- */
- parameterBoolean: boolean;
- /**
- * This is a dictionary parameter
- */
- parameterDictionary: {
- [key: string]: string;
- };
- /**
- * This is an enum parameter
- */
- parameterEnum: 'Success' | 'Warning' | 'Error';
- /**
- * This is a number parameter
- */
- parameterNumber: number;
- /**
- * This is an object parameter
- */
- parameterObject: unknown;
- /**
- * This is a string parameter
- */
- parameterString: string;
-};
-
-export type TypesResponse = (number | string | boolean | unknown);
\ No newline at end of file
diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3-schemas-form/schemas.gen.ts.snap b/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3-schemas-form/schemas.gen.ts.snap
deleted file mode 100644
index 97c0d88113..0000000000
--- a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3-schemas-form/schemas.gen.ts.snap
+++ /dev/null
@@ -1,1834 +0,0 @@
-// This file is auto-generated by @hey-api/openapi-ts
-
-export const _400Schema = {
- type: 'string'
-} as const;
-
-export const camelCaseCommentWithBreaksSchema = {
- type: 'integer'
-} as const;
-
-export const CommentWithBreaksSchema = {
- type: 'integer'
-} as const;
-
-export const CommentWithBackticksSchema = {
- type: 'integer'
-} as const;
-
-export const CommentWithBackticksAndQuotesSchema = {
- type: 'integer'
-} as const;
-
-export const CommentWithSlashesSchema = {
- type: 'integer'
-} as const;
-
-export const CommentWithExpressionPlaceholdersSchema = {
- type: 'integer'
-} as const;
-
-export const CommentWithQuotesSchema = {
- type: 'integer'
-} as const;
-
-export const CommentWithReservedCharactersSchema = {
- type: 'integer'
-} as const;
-
-export const SimpleIntegerSchema = {
- type: 'integer'
-} as const;
-
-export const SimpleBooleanSchema = {
- type: 'boolean'
-} as const;
-
-export const SimpleStringSchema = {
- type: 'string'
-} as const;
-
-export const NonAsciiStringæøåÆØÅöôêÊ字符串Schema = {
- type: 'string'
-} as const;
-
-export const SimpleFileSchema = {
- type: 'file'
-} as const;
-
-export const SimpleReferenceSchema = {
- '$ref': '#/components/schemas/ModelWithString'
-} as const;
-
-export const SimpleStringWithPatternSchema = {
- type: 'string',
- nullable: true,
- maxLength: 64,
- pattern: '^[a-zA-Z0-9_]*$'
-} as const;
-
-export const EnumWithStringsSchema = {
- enum: ['Success', 'Warning', 'Error', "'Single Quote'", '"Double Quotes"', 'Non-ascii: øæåôöØÆÅÔÖ字符串']
-} as const;
-
-export const EnumWithReplacedCharactersSchema = {
- enum: ["'Single Quote'", '"Double Quotes"', 'øæåôöØÆÅÔÖ字符串', 3.1, ''],
- type: 'string'
-} as const;
-
-export const EnumWithNumbersSchema = {
- enum: [1, 2, 3, 1.1, 1.2, 1.3, 100, 200, 300, -100, -200, -300, -1.1, -1.2, -1.3],
- default: 200
-} as const;
-
-export const EnumFromDescriptionSchema = {
- type: 'number'
-} as const;
-
-export const EnumWithExtensionsSchema = {
- enum: [200, 400, 500]
-} as const;
-
-export const EnumWithXEnumNamesSchema = {
- enum: [0, 1, 2]
-} as const;
-
-export const ArrayWithNumbersSchema = {
- type: 'array',
- items: {
- type: 'integer'
- }
-} as const;
-
-export const ArrayWithBooleansSchema = {
- type: 'array',
- items: {
- type: 'boolean'
- }
-} as const;
-
-export const ArrayWithStringsSchema = {
- type: 'array',
- items: {
- type: 'string'
- },
- default: ['test']
-} as const;
-
-export const ArrayWithReferencesSchema = {
- type: 'array',
- items: {
- '$ref': '#/components/schemas/ModelWithString'
- }
-} as const;
-
-export const ArrayWithArraySchema = {
- type: 'array',
- items: {
- type: 'array',
- items: {
- '$ref': '#/components/schemas/ModelWithString'
- }
- }
-} as const;
-
-export const ArrayWithPropertiesSchema = {
- type: 'array',
- items: {
- type: 'object',
- properties: {
- '16x16': {
- '$ref': '#/components/schemas/camelCaseCommentWithBreaks'
- },
- bar: {
- type: 'string'
- }
- }
- }
-} as const;
-
-export const ArrayWithAnyOfPropertiesSchema = {
- type: 'array',
- items: {
- anyOf: [
- {
- type: 'object',
- properties: {
- foo: {
- type: 'string',
- default: 'test'
- }
- }
- },
- {
- type: 'object',
- properties: {
- bar: {
- type: 'string'
- }
- }
- }
- ]
- }
-} as const;
-
-export const AnyOfAnyAndNullSchema = {
- type: 'object',
- properties: {
- data: {
- anyOf: [
- {},
- {
- type: 'null'
- }
- ]
- }
- }
-} as const;
-
-export const AnyOfArraysSchema = {
- type: 'object',
- properties: {
- results: {
- items: {
- anyOf: [
- {
- type: 'object',
- properties: {
- foo: {
- type: 'string'
- }
- }
- },
- {
- type: 'object',
- properties: {
- bar: {
- type: 'string'
- }
- }
- }
- ]
- },
- type: 'array'
- }
- }
-} as const;
-
-export const DictionaryWithStringSchema = {
- type: 'object',
- additionalProperties: {
- type: 'string'
- }
-} as const;
-
-export const DictionaryWithPropertiesAndAdditionalPropertiesSchema = {
- type: 'object',
- properties: {
- foo: {
- type: 'number'
- },
- bar: {
- type: 'boolean'
- }
- },
- additionalProperties: {
- type: 'string'
- }
-} as const;
-
-export const DictionaryWithReferenceSchema = {
- type: 'object',
- additionalProperties: {
- '$ref': '#/components/schemas/ModelWithString'
- }
-} as const;
-
-export const DictionaryWithArraySchema = {
- type: 'object',
- additionalProperties: {
- type: 'array',
- items: {
- '$ref': '#/components/schemas/ModelWithString'
- }
- }
-} as const;
-
-export const DictionaryWithDictionarySchema = {
- type: 'object',
- additionalProperties: {
- type: 'object',
- additionalProperties: {
- type: 'string'
- }
- }
-} as const;
-
-export const DictionaryWithPropertiesSchema = {
- type: 'object',
- additionalProperties: {
- type: 'object',
- properties: {
- foo: {
- type: 'string'
- },
- bar: {
- type: 'string'
- }
- }
- }
-} as const;
-
-export const ModelWithIntegerSchema = {
- type: 'object',
- properties: {
- prop: {
- type: 'integer'
- }
- }
-} as const;
-
-export const ModelWithBooleanSchema = {
- type: 'object',
- properties: {
- prop: {
- type: 'boolean'
- }
- }
-} as const;
-
-export const ModelWithStringSchema = {
- type: 'object',
- properties: {
- prop: {
- type: 'string'
- }
- }
-} as const;
-
-export const ModelWithStringErrorSchema = {
- type: 'object',
- properties: {
- prop: {
- type: 'string'
- }
- }
-} as const;
-
-export const Model_From_ZendeskSchema = {
- type: 'string'
-} as const;
-
-export const ModelWithNullableStringSchema = {
- type: 'object',
- required: ['nullableRequiredProp1', 'nullableRequiredProp2'],
- properties: {
- nullableProp1: {
- type: 'string',
- nullable: true
- },
- nullableRequiredProp1: {
- type: 'string',
- nullable: true
- },
- nullableProp2: {
- type: ['string', 'null']
- },
- nullableRequiredProp2: {
- type: ['string', 'null']
- },
- 'foo_bar-enum': {
- enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串']
- }
- }
-} as const;
-
-export const ModelWithEnumSchema = {
- type: 'object',
- properties: {
- 'foo_bar-enum': {
- enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串']
- },
- statusCode: {
- enum: ['100', '200 FOO', '300 FOO_BAR', '400 foo-bar', '500 foo.bar', '600 foo&bar']
- },
- bool: {
- type: 'boolean',
- enum: [true]
- }
- }
-} as const;
-
-export const ModelWithEnumWithHyphenSchema = {
- type: 'object',
- properties: {
- 'foo-bar-baz-qux': {
- type: 'string',
- enum: ['3.0'],
- default: '3.0'
- }
- }
-} as const;
-
-export const ModelWithEnumFromDescriptionSchema = {
- type: 'object',
- properties: {
- test: {
- type: 'integer'
- }
- }
-} as const;
-
-export const ModelWithNestedEnumsSchema = {
- type: 'object',
- properties: {
- dictionaryWithEnum: {
- type: 'object',
- additionalProperties: {
- enum: ['Success', 'Warning', 'Error']
- }
- },
- dictionaryWithEnumFromDescription: {
- type: 'object',
- additionalProperties: {
- type: 'integer'
- }
- },
- arrayWithEnum: {
- type: 'array',
- items: {
- enum: ['Success', 'Warning', 'Error']
- }
- },
- arrayWithDescription: {
- type: 'array',
- items: {
- type: 'integer'
- }
- },
- 'foo_bar-enum': {
- enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串']
- }
- }
-} as const;
-
-export const ModelWithReferenceSchema = {
- type: 'object',
- properties: {
- prop: {
- '$ref': '#/components/schemas/ModelWithProperties'
- }
- }
-} as const;
-
-export const ModelWithArrayReadOnlyAndWriteOnlySchema = {
- type: 'object',
- properties: {
- prop: {
- type: 'array',
- items: {
- '$ref': '#/components/schemas/ModelWithReadOnlyAndWriteOnly'
- }
- },
- propWithFile: {
- type: 'array',
- items: {
- type: 'file'
- }
- },
- propWithNumber: {
- type: 'array',
- items: {
- type: 'number'
- }
- }
- }
-} as const;
-
-export const ModelWithArraySchema = {
- type: 'object',
- properties: {
- prop: {
- type: 'array',
- items: {
- '$ref': '#/components/schemas/ModelWithString'
- }
- },
- propWithFile: {
- type: 'array',
- items: {
- type: 'file'
- }
- },
- propWithNumber: {
- type: 'array',
- items: {
- type: 'number'
- }
- }
- }
-} as const;
-
-export const ModelWithDictionarySchema = {
- type: 'object',
- properties: {
- prop: {
- type: 'object',
- additionalProperties: {
- type: 'string'
- }
- }
- }
-} as const;
-
-export const DeprecatedModelSchema = {
- deprecated: true,
- type: 'object',
- properties: {
- prop: {
- deprecated: true,
- type: 'string'
- }
- }
-} as const;
-
-export const ModelWithCircularReferenceSchema = {
- type: 'object',
- properties: {
- prop: {
- '$ref': '#/components/schemas/ModelWithCircularReference'
- }
- }
-} as const;
-
-export const CompositionWithOneOfSchema = {
- type: 'object',
- properties: {
- propA: {
- type: 'object',
- oneOf: [
- {
- '$ref': '#/components/schemas/ModelWithString'
- },
- {
- '$ref': '#/components/schemas/ModelWithEnum'
- },
- {
- '$ref': '#/components/schemas/ModelWithArray'
- },
- {
- '$ref': '#/components/schemas/ModelWithDictionary'
- }
- ]
- }
- }
-} as const;
-
-export const CompositionWithOneOfAnonymousSchema = {
- type: 'object',
- properties: {
- propA: {
- type: 'object',
- oneOf: [
- {
- type: 'object',
- properties: {
- propA: {
- type: 'string'
- }
- }
- },
- {
- type: 'string'
- },
- {
- type: 'integer'
- }
- ]
- }
- }
-} as const;
-
-export const ModelCircleSchema = {
- type: 'object',
- required: ['kind'],
- properties: {
- kind: {
- type: 'string'
- },
- radius: {
- type: 'number'
- }
- }
-} as const;
-
-export const ModelSquareSchema = {
- type: 'object',
- required: ['kind'],
- properties: {
- kind: {
- type: 'string'
- },
- sideLength: {
- type: 'number'
- }
- }
-} as const;
-
-export const CompositionWithOneOfDiscriminatorSchema = {
- type: 'object',
- oneOf: [
- {
- '$ref': '#/components/schemas/ModelCircle'
- },
- {
- '$ref': '#/components/schemas/ModelSquare'
- }
- ],
- discriminator: {
- propertyName: 'kind',
- mapping: {
- circle: '#/components/schemas/ModelCircle',
- square: '#/components/schemas/ModelSquare'
- }
- }
-} as const;
-
-export const CompositionWithAnyOfSchema = {
- type: 'object',
- properties: {
- propA: {
- type: 'object',
- anyOf: [
- {
- '$ref': '#/components/schemas/ModelWithString'
- },
- {
- '$ref': '#/components/schemas/ModelWithEnum'
- },
- {
- '$ref': '#/components/schemas/ModelWithArray'
- },
- {
- '$ref': '#/components/schemas/ModelWithDictionary'
- }
- ]
- }
- }
-} as const;
-
-export const CompositionWithAnyOfAnonymousSchema = {
- type: 'object',
- properties: {
- propA: {
- type: 'object',
- anyOf: [
- {
- type: 'object',
- properties: {
- propA: {
- type: 'string'
- }
- }
- },
- {
- type: 'string'
- },
- {
- type: 'integer'
- }
- ]
- }
- }
-} as const;
-
-export const CompositionWithNestedAnyAndTypeNullSchema = {
- type: 'object',
- properties: {
- propA: {
- type: 'object',
- anyOf: [
- {
- items: {
- anyOf: [
- {
- '$ref': '#/components/schemas/ModelWithDictionary'
- },
- {
- type: 'null'
- }
- ]
- },
- type: 'array'
- },
- {
- items: {
- anyOf: [
- {
- '$ref': '#/components/schemas/ModelWithArray'
- },
- {
- type: 'null'
- }
- ]
- },
- type: 'array'
- }
- ]
- }
- }
-} as const;
-
-export const _3e_num_1ПериодSchema = {
- enum: ['Bird', 'Dog'],
- type: 'string'
-} as const;
-
-export const ConstValueSchema = {
- type: 'string',
- const: 'ConstValue'
-} as const;
-
-export const CompositionWithNestedAnyOfAndNullSchema = {
- type: 'object',
- properties: {
- propA: {
- anyOf: [
- {
- items: {
- anyOf: [
- {
- '$ref': '#/components/schemas/3e-num_1Период'
- },
- {
- '$ref': '#/components/schemas/ConstValue'
- }
- ]
- },
- type: 'array'
- },
- {
- type: 'null'
- }
- ]
- }
- }
-} as const;
-
-export const CompositionWithOneOfAndNullableSchema = {
- type: 'object',
- properties: {
- propA: {
- nullable: true,
- type: 'object',
- oneOf: [
- {
- type: 'object',
- properties: {
- boolean: {
- type: 'boolean'
- }
- }
- },
- {
- '$ref': '#/components/schemas/ModelWithEnum'
- },
- {
- '$ref': '#/components/schemas/ModelWithArray'
- },
- {
- '$ref': '#/components/schemas/ModelWithDictionary'
- }
- ]
- }
- }
-} as const;
-
-export const CompositionWithOneOfAndSimpleDictionarySchema = {
- type: 'object',
- properties: {
- propA: {
- oneOf: [
- {
- type: 'boolean'
- },
- {
- type: 'object',
- additionalProperties: {
- type: 'number'
- }
- }
- ]
- }
- }
-} as const;
-
-export const CompositionWithOneOfAndSimpleArrayDictionarySchema = {
- type: 'object',
- properties: {
- propA: {
- oneOf: [
- {
- type: 'boolean'
- },
- {
- type: 'object',
- additionalProperties: {
- type: 'array',
- items: {
- type: 'boolean'
- }
- }
- }
- ]
- }
- }
-} as const;
-
-export const CompositionWithOneOfAndComplexArrayDictionarySchema = {
- type: 'object',
- properties: {
- propA: {
- oneOf: [
- {
- type: 'boolean'
- },
- {
- type: 'object',
- additionalProperties: {
- type: 'array',
- items: {
- oneOf: [
- {
- type: 'number'
- },
- {
- type: 'string'
- }
- ]
- }
- }
- }
- ]
- }
- }
-} as const;
-
-export const CompositionWithAllOfAndNullableSchema = {
- type: 'object',
- properties: {
- propA: {
- nullable: true,
- type: 'object',
- allOf: [
- {
- type: 'object',
- properties: {
- boolean: {
- type: 'boolean'
- }
- }
- },
- {
- '$ref': '#/components/schemas/ModelWithEnum'
- },
- {
- '$ref': '#/components/schemas/ModelWithArray'
- },
- {
- '$ref': '#/components/schemas/ModelWithDictionary'
- }
- ]
- }
- }
-} as const;
-
-export const CompositionWithAnyOfAndNullableSchema = {
- type: 'object',
- properties: {
- propA: {
- nullable: true,
- type: 'object',
- anyOf: [
- {
- type: 'object',
- properties: {
- boolean: {
- type: 'boolean'
- }
- }
- },
- {
- '$ref': '#/components/schemas/ModelWithEnum'
- },
- {
- '$ref': '#/components/schemas/ModelWithArray'
- },
- {
- '$ref': '#/components/schemas/ModelWithDictionary'
- }
- ]
- }
- }
-} as const;
-
-export const CompositionBaseModelSchema = {
- type: 'object',
- properties: {
- firstName: {
- type: 'string'
- },
- lastname: {
- type: 'string'
- }
- }
-} as const;
-
-export const CompositionExtendedModelSchema = {
- type: 'object',
- allOf: [
- {
- '$ref': '#/components/schemas/CompositionBaseModel'
- }
- ],
- properties: {
- age: {
- type: 'number'
- }
- },
- required: ['firstName', 'lastname', 'age']
-} as const;
-
-export const ModelWithPropertiesSchema = {
- type: 'object',
- required: ['required', 'requiredAndReadOnly', 'requiredAndNullable'],
- properties: {
- required: {
- type: 'string'
- },
- requiredAndReadOnly: {
- type: 'string',
- readOnly: true
- },
- requiredAndNullable: {
- type: 'string',
- nullable: true
- },
- string: {
- type: 'string'
- },
- number: {
- type: 'number'
- },
- boolean: {
- type: 'boolean'
- },
- reference: {
- '$ref': '#/components/schemas/ModelWithString'
- },
- 'property with space': {
- type: 'string'
- },
- default: {
- type: 'string'
- },
- try: {
- type: 'string'
- },
- '@namespace.string': {
- type: 'string',
- readOnly: true
- },
- '@namespace.integer': {
- type: 'integer',
- readOnly: true
- }
- }
-} as const;
-
-export const ModelWithNestedPropertiesSchema = {
- type: 'object',
- required: ['first'],
- properties: {
- first: {
- type: 'object',
- required: ['second'],
- readOnly: true,
- nullable: true,
- properties: {
- second: {
- type: 'object',
- required: ['third'],
- readOnly: true,
- nullable: true,
- properties: {
- third: {
- type: 'string',
- required: true,
- readOnly: true,
- nullable: true
- }
- }
- }
- }
- }
- }
-} as const;
-
-export const ModelWithDuplicatePropertiesSchema = {
- type: 'object',
- properties: {
- prop: {
- '$ref': '#/components/schemas/ModelWithString'
- }
- }
-} as const;
-
-export const ModelWithOrderedPropertiesSchema = {
- type: 'object',
- properties: {
- zebra: {
- type: 'string'
- },
- apple: {
- type: 'string'
- },
- hawaii: {
- type: 'string'
- }
- }
-} as const;
-
-export const ModelWithDuplicateImportsSchema = {
- type: 'object',
- properties: {
- propA: {
- '$ref': '#/components/schemas/ModelWithString'
- },
- propB: {
- '$ref': '#/components/schemas/ModelWithString'
- },
- propC: {
- '$ref': '#/components/schemas/ModelWithString'
- }
- }
-} as const;
-
-export const ModelThatExtendsSchema = {
- type: 'object',
- allOf: [
- {
- '$ref': '#/components/schemas/ModelWithString'
- },
- {
- type: 'object',
- properties: {
- propExtendsA: {
- type: 'string'
- },
- propExtendsB: {
- '$ref': '#/components/schemas/ModelWithString'
- }
- }
- }
- ]
-} as const;
-
-export const ModelThatExtendsExtendsSchema = {
- type: 'object',
- allOf: [
- {
- '$ref': '#/components/schemas/ModelWithString'
- },
- {
- '$ref': '#/components/schemas/ModelThatExtends'
- },
- {
- type: 'object',
- properties: {
- propExtendsC: {
- type: 'string'
- },
- propExtendsD: {
- '$ref': '#/components/schemas/ModelWithString'
- }
- }
- }
- ]
-} as const;
-
-export const ModelWithPatternSchema = {
- type: 'object',
- required: ['key', 'name'],
- properties: {
- key: {
- maxLength: 64,
- pattern: '^[a-zA-Z0-9_]*$',
- type: 'string'
- },
- name: {
- maxLength: 255,
- type: 'string'
- },
- enabled: {
- type: 'boolean',
- readOnly: true
- },
- modified: {
- type: 'string',
- format: 'date-time',
- readOnly: true
- },
- id: {
- type: 'string',
- pattern: '^\\d{2}-\\d{3}-\\d{4}$'
- },
- text: {
- type: 'string',
- pattern: '^\\w+$'
- },
- patternWithSingleQuotes: {
- type: 'string',
- pattern: "^[a-zA-Z0-9']*$"
- },
- patternWithNewline: {
- type: 'string',
- pattern: 'aaa\\nbbb'
- },
- patternWithBacktick: {
- type: 'string',
- pattern: 'aaa`bbb'
- }
- }
-} as const;
-
-export const FileSchema = {
- required: ['mime'],
- type: 'object',
- properties: {
- id: {
- type: 'string',
- readOnly: true,
- minLength: 1
- },
- updated_at: {
- type: 'string',
- format: 'date-time',
- readOnly: true
- },
- created_at: {
- type: 'string',
- format: 'date-time',
- readOnly: true
- },
- mime: {
- type: 'string',
- maxLength: 24,
- minLength: 1
- },
- file: {
- type: 'string',
- readOnly: true,
- format: 'uri'
- }
- }
-} as const;
-
-export const defaultSchema = {
- type: 'object',
- properties: {
- name: {
- type: 'string'
- }
- }
-} as const;
-
-export const PageableSchema = {
- type: 'object',
- properties: {
- page: {
- minimum: 0,
- type: 'integer',
- format: 'int32',
- default: 0
- },
- size: {
- minimum: 1,
- type: 'integer',
- format: 'int32'
- },
- sort: {
- type: 'array',
- items: {
- type: 'string'
- }
- }
- }
-} as const;
-
-export const FreeFormObjectWithoutAdditionalPropertiesSchema = {
- type: 'object'
-} as const;
-
-export const FreeFormObjectWithAdditionalPropertiesEqTrueSchema = {
- type: 'object',
- additionalProperties: true
-} as const;
-
-export const FreeFormObjectWithAdditionalPropertiesEqEmptyObjectSchema = {
- type: 'object',
- additionalProperties: {}
-} as const;
-
-export const ModelWithConstSchema = {
- type: 'object',
- properties: {
- String: {
- const: 'String'
- },
- number: {
- const: 0
- },
- null: {
- const: null
- },
- withType: {
- type: 'string',
- const: 'Some string'
- }
- }
-} as const;
-
-export const ModelWithAdditionalPropertiesEqTrueSchema = {
- type: 'object',
- properties: {
- prop: {
- type: 'string'
- }
- },
- additionalProperties: true
-} as const;
-
-export const NestedAnyOfArraysNullableSchema = {
- properties: {
- nullableArray: {
- anyOf: [
- {
- items: {
- anyOf: [
- {
- type: 'string'
- },
- {
- type: 'boolean'
- }
- ]
- },
- type: 'array'
- },
- {
- type: 'null'
- }
- ]
- }
- },
- type: 'object'
-} as const;
-
-export const CompositionWithOneOfAndPropertiesSchema = {
- type: 'object',
- oneOf: [
- {
- type: 'object',
- required: ['foo'],
- properties: {
- foo: {
- '$ref': '#/components/parameters/SimpleParameter'
- }
- },
- additionalProperties: false
- },
- {
- type: 'object',
- required: ['bar'],
- properties: {
- bar: {
- '$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串'
- }
- },
- additionalProperties: false
- }
- ],
- required: ['baz', 'qux'],
- properties: {
- baz: {
- type: 'integer',
- format: 'uint16',
- minimum: 0,
- nullable: true
- },
- qux: {
- type: 'integer',
- format: 'uint8',
- minimum: 0
- }
- }
-} as const;
-
-export const NullableObjectSchema = {
- type: ['object', 'null'],
- properties: {
- foo: {
- type: 'string'
- }
- },
- default: null
-} as const;
-
-export const CharactersInDescriptionSchema = {
- type: 'string'
-} as const;
-
-export const ModelWithNullableObjectSchema = {
- type: 'object',
- properties: {
- data: {
- '$ref': '#/components/schemas/NullableObject'
- }
- }
-} as const;
-
-export const ModelWithOneOfEnumSchema = {
- oneOf: [
- {
- type: 'object',
- required: ['foo'],
- properties: {
- foo: {
- type: 'string',
- enum: ['Bar']
- }
- }
- },
- {
- type: 'object',
- required: ['foo'],
- properties: {
- foo: {
- type: 'string',
- enum: ['Baz']
- }
- }
- },
- {
- type: 'object',
- required: ['foo'],
- properties: {
- foo: {
- type: 'string',
- enum: ['Qux']
- }
- }
- },
- {
- type: 'object',
- required: ['content', 'foo'],
- properties: {
- content: {
- type: 'string',
- format: 'date-time'
- },
- foo: {
- type: 'string',
- enum: ['Quux']
- }
- }
- },
- {
- type: 'object',
- required: ['content', 'foo'],
- properties: {
- content: {
- type: 'array',
- items: [
- {
- type: 'string',
- format: 'date-time'
- },
- {
- type: 'string'
- }
- ],
- maxItems: 2,
- minItems: 2
- },
- foo: {
- type: 'string',
- enum: ['Corge']
- }
- }
- }
- ]
-} as const;
-
-export const ModelWithNestedArrayEnumsDataFooSchema = {
- enum: ['foo', 'bar'],
- type: 'string'
-} as const;
-
-export const ModelWithNestedArrayEnumsDataBarSchema = {
- enum: ['baz', 'qux'],
- type: 'string'
-} as const;
-
-export const ModelWithNestedArrayEnumsDataSchema = {
- type: 'object',
- properties: {
- foo: {
- type: 'array',
- items: {
- '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo'
- }
- },
- bar: {
- type: 'array',
- items: {
- '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataBar'
- }
- }
- }
-} as const;
-
-export const ModelWithNestedArrayEnumsSchema = {
- type: 'object',
- properties: {
- array_strings: {
- type: 'array',
- items: {
- type: 'string'
- }
- },
- data: {
- allOf: [
- {
- '$ref': '#/components/schemas/ModelWithNestedArrayEnumsData'
- }
- ]
- }
- }
-} as const;
-
-export const ModelWithNestedCompositionEnumsSchema = {
- type: 'object',
- properties: {
- foo: {
- allOf: [
- {
- '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo'
- }
- ]
- }
- }
-} as const;
-
-export const ModelWithReadOnlyAndWriteOnlySchema = {
- type: 'object',
- required: ['foo', 'bar', 'baz'],
- properties: {
- foo: {
- type: 'string'
- },
- bar: {
- readOnly: true,
- type: 'string'
- },
- baz: {
- type: 'string',
- writeOnly: true
- }
- }
-} as const;
-
-export const ModelWithConstantSizeArraySchema = {
- type: 'array',
- items: {
- type: 'number'
- },
- minItems: 2,
- maxItems: 2
-} as const;
-
-export const ModelWithAnyOfConstantSizeArraySchema = {
- type: 'array',
- items: {
- oneOf: [
- {
- type: 'number'
- },
- {
- type: 'string'
- }
- ]
- },
- minItems: 3,
- maxItems: 3
-} as const;
-
-export const ModelWithPrefixItemsConstantSizeArraySchema = {
- type: 'array',
- prefixItems: [
- {
- '$ref': '#/components/schemas/ModelWithInteger'
- },
- {
- oneOf: [
- {
- type: 'number'
- },
- {
- type: 'string'
- }
- ]
- },
- {
- type: 'string'
- }
- ]
-} as const;
-
-export const ModelWithAnyOfConstantSizeArrayNullableSchema = {
- type: ['array'],
- items: {
- oneOf: [
- {
- type: 'number',
- nullable: true
- },
- {
- type: 'string'
- }
- ]
- },
- minItems: 3,
- maxItems: 3
-} as const;
-
-export const ModelWithAnyOfConstantSizeArrayWithNSizeAndOptionsSchema = {
- type: 'array',
- items: {
- oneOf: [
- {
- type: 'number'
- },
- {
- '$ref': '#/components/schemas/import'
- }
- ]
- },
- minItems: 2,
- maxItems: 2
-} as const;
-
-export const ModelWithAnyOfConstantSizeArrayAndIntersectSchema = {
- type: 'array',
- items: {
- allOf: [
- {
- type: 'number'
- },
- {
- type: 'string'
- }
- ]
- },
- minItems: 2,
- maxItems: 2
-} as const;
-
-export const ModelWithNumericEnumUnionSchema = {
- type: 'object',
- properties: {
- value: {
- type: 'number',
- enum: [-10, -1, 0, 1, 3, 6, 12]
- }
- }
-} as const;
-
-export const ModelWithBackticksInDescriptionSchema = {
- type: 'object',
- properties: {
- template: {
- type: 'string'
- }
- }
-} as const;
-
-export const ModelWithOneOfAndPropertiesSchema = {
- type: 'object',
- oneOf: [
- {
- '$ref': '#/components/parameters/SimpleParameter'
- },
- {
- '$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串'
- }
- ],
- required: ['baz', 'qux'],
- properties: {
- baz: {
- type: 'integer',
- format: 'uint16',
- minimum: 0,
- nullable: true
- },
- qux: {
- type: 'integer',
- format: 'uint8',
- minimum: 0
- }
- }
-} as const;
-
-export const ParameterSimpleParameterUnusedSchema = {
- type: 'string'
-} as const;
-
-export const PostServiceWithEmptyTagResponseSchema = {
- type: 'string'
-} as const;
-
-export const PostServiceWithEmptyTagResponse2Schema = {
- type: 'string'
-} as const;
-
-export const DeleteFooDataSchema = {
- type: 'string'
-} as const;
-
-export const DeleteFooData2Schema = {
- type: 'string'
-} as const;
-
-export const importSchema = {
- type: 'string'
-} as const;
-
-export const SchemaWithFormRestrictedKeysSchema = {
- properties: {
- description: {
- type: 'string'
- },
- 'x-enum-descriptions': {
- type: 'string'
- },
- 'x-enum-varnames': {
- type: 'string'
- },
- 'x-enumNames': {
- type: 'string'
- },
- title: {
- type: 'string'
- },
- object: {
- type: 'object',
- properties: {
- description: {
- type: 'string'
- },
- 'x-enum-descriptions': {
- type: 'string'
- },
- 'x-enum-varnames': {
- type: 'string'
- },
- 'x-enumNames': {
- type: 'string'
- },
- title: {
- type: 'string'
- }
- }
- },
- array: {
- type: 'array',
- items: [
- {
- type: 'object',
- properties: {
- description: {
- type: 'string'
- },
- 'x-enum-descriptions': {
- type: 'string'
- },
- 'x-enum-varnames': {
- type: 'string'
- },
- 'x-enumNames': {
- type: 'string'
- },
- title: {
- type: 'string'
- }
- }
- }
- ]
- }
- }
-} as const;
-
-export const io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptionsSchema = {
- properties: {
- preconditions: {
- allOf: [
- {
- '$ref': '#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions'
- }
- ]
- }
- },
- type: 'object'
-} as const;
-
-export const io_k8s_apimachinery_pkg_apis_meta_v1_PreconditionsSchema = {
- properties: {
- resourceVersion: {
- type: 'string'
- },
- uid: {
- type: 'string'
- }
- },
- type: 'object'
-} as const;
-
-export const AdditionalPropertiesUnknownIssueSchema = {
- type: 'object',
- properties: {},
- additionalProperties: {
- anyOf: [
- {
- type: 'string'
- },
- {
- type: 'number'
- }
- ]
- }
-} as const;
-
-export const AdditionalPropertiesUnknownIssue2Schema = {
- type: 'object',
- additionalProperties: {
- anyOf: [
- {
- type: 'string'
- },
- {
- type: 'number'
- }
- ]
- }
-} as const;
-
-export const AdditionalPropertiesUnknownIssue3Schema = {
- type: 'object',
- allOf: [
- {
- type: 'string'
- },
- {
- type: 'object',
- required: ['entries'],
- properties: {
- entries: {
- additionalProperties: {
- '$ref': '#/components/schemas/AdditionalPropertiesUnknownIssue'
- }
- }
- }
- }
- ]
-} as const;
-
-export const AdditionalPropertiesIntegerIssueSchema = {
- type: 'object',
- required: ['value'],
- properties: {
- value: {
- type: 'integer'
- }
- },
- additionalProperties: {
- type: 'integer'
- }
-} as const;
-
-export const OneOfAllOfIssueSchema = {
- oneOf: [
- {
- allOf: [
- {
- oneOf: [
- {
- '$ref': '#/components/schemas/ConstValue'
- },
- {
- '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]'
- }
- ]
- },
- {
- '$ref': '#/components/schemas/3e-num_1Период'
- }
- ]
- },
- {
- '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]'
- }
- ]
-} as const;
-
-export const Generic_Schema_Duplicate_Issue_1_System_Boolean_Schema = {
- type: 'object',
- properties: {
- item: {
- type: 'boolean'
- },
- error: {
- type: 'string',
- nullable: true
- },
- hasError: {
- type: 'boolean',
- readOnly: true
- },
- data: {
- type: 'object',
- properties: {},
- additionalProperties: false
- }
- },
- additionalProperties: false
-} as const;
-
-export const Generic_Schema_Duplicate_Issue_1_System_String_Schema = {
- type: 'object',
- properties: {
- item: {
- type: 'string',
- nullable: true
- },
- error: {
- type: 'string',
- nullable: true
- },
- hasError: {
- type: 'boolean',
- readOnly: true
- }
- },
- additionalProperties: false
-} as const;
diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3-schemas-json/schemas.gen.ts.snap b/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3-schemas-json/schemas.gen.ts.snap
deleted file mode 100644
index 0bba7f05c4..0000000000
--- a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3-schemas-json/schemas.gen.ts.snap
+++ /dev/null
@@ -1,1994 +0,0 @@
-// This file is auto-generated by @hey-api/openapi-ts
-
-export const _400Schema = {
- description: 'Model with number-only name',
- type: 'string'
-} as const;
-
-export const camelCaseCommentWithBreaksSchema = {
- description: `Testing multiline comments in string: First line
-Second line
-
-Fourth line`,
- type: 'integer'
-} as const;
-
-export const CommentWithBreaksSchema = {
- description: `Testing multiline comments in string: First line
-Second line
-
-Fourth line`,
- type: 'integer'
-} as const;
-
-export const CommentWithBackticksSchema = {
- description: 'Testing backticks in string: `backticks` and ```multiple backticks``` should work',
- type: 'integer'
-} as const;
-
-export const CommentWithBackticksAndQuotesSchema = {
- description: `Testing backticks and quotes in string: \`backticks\`, 'quotes', "double quotes" and \`\`\`multiple backticks\`\`\` should work`,
- type: 'integer'
-} as const;
-
-export const CommentWithSlashesSchema = {
- description: 'Testing slashes in string: \\backwards\\\\\\ and /forwards/// should work',
- type: 'integer'
-} as const;
-
-export const CommentWithExpressionPlaceholdersSchema = {
- description: 'Testing expression placeholders in string: ${expression} should work',
- type: 'integer'
-} as const;
-
-export const CommentWithQuotesSchema = {
- description: `Testing quotes in string: 'single quote''' and "double quotes""" should work`,
- type: 'integer'
-} as const;
-
-export const CommentWithReservedCharactersSchema = {
- description: 'Testing reserved characters in string: /* inline */ and /** inline **/ should work',
- type: 'integer'
-} as const;
-
-export const SimpleIntegerSchema = {
- description: 'This is a simple number',
- type: 'integer'
-} as const;
-
-export const SimpleBooleanSchema = {
- description: 'This is a simple boolean',
- type: 'boolean'
-} as const;
-
-export const SimpleStringSchema = {
- description: 'This is a simple string',
- type: 'string'
-} as const;
-
-export const NonAsciiStringæøåÆØÅöôêÊ字符串Schema = {
- description: 'A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串)',
- type: 'string'
-} as const;
-
-export const SimpleFileSchema = {
- description: 'This is a simple file',
- type: 'file'
-} as const;
-
-export const SimpleReferenceSchema = {
- description: 'This is a simple reference',
- '$ref': '#/components/schemas/ModelWithString'
-} as const;
-
-export const SimpleStringWithPatternSchema = {
- description: 'This is a simple string',
- type: 'string',
- nullable: true,
- maxLength: 64,
- pattern: '^[a-zA-Z0-9_]*$'
-} as const;
-
-export const EnumWithStringsSchema = {
- description: 'This is a simple enum with strings',
- enum: ['Success', 'Warning', 'Error', "'Single Quote'", '"Double Quotes"', 'Non-ascii: øæåôöØÆÅÔÖ字符串']
-} as const;
-
-export const EnumWithReplacedCharactersSchema = {
- enum: ["'Single Quote'", '"Double Quotes"', 'øæåôöØÆÅÔÖ字符串', 3.1, ''],
- type: 'string'
-} as const;
-
-export const EnumWithNumbersSchema = {
- description: 'This is a simple enum with numbers',
- enum: [1, 2, 3, 1.1, 1.2, 1.3, 100, 200, 300, -100, -200, -300, -1.1, -1.2, -1.3],
- default: 200
-} as const;
-
-export const EnumFromDescriptionSchema = {
- description: 'Success=1,Warning=2,Error=3',
- type: 'number'
-} as const;
-
-export const EnumWithExtensionsSchema = {
- description: 'This is a simple enum with numbers',
- enum: [200, 400, 500],
- 'x-enum-varnames': ['CUSTOM_SUCCESS', 'CUSTOM_WARNING', 'CUSTOM_ERROR'],
- 'x-enum-descriptions': ['Used when the status of something is successful', 'Used when the status of something has a warning', 'Used when the status of something has an error']
-} as const;
-
-export const EnumWithXEnumNamesSchema = {
- enum: [0, 1, 2],
- 'x-enumNames': ['zero', 'one', 'two']
-} as const;
-
-export const ArrayWithNumbersSchema = {
- description: 'This is a simple array with numbers',
- type: 'array',
- items: {
- type: 'integer'
- }
-} as const;
-
-export const ArrayWithBooleansSchema = {
- description: 'This is a simple array with booleans',
- type: 'array',
- items: {
- type: 'boolean'
- }
-} as const;
-
-export const ArrayWithStringsSchema = {
- description: 'This is a simple array with strings',
- type: 'array',
- items: {
- type: 'string'
- },
- default: ['test']
-} as const;
-
-export const ArrayWithReferencesSchema = {
- description: 'This is a simple array with references',
- type: 'array',
- items: {
- '$ref': '#/components/schemas/ModelWithString'
- }
-} as const;
-
-export const ArrayWithArraySchema = {
- description: 'This is a simple array containing an array',
- type: 'array',
- items: {
- type: 'array',
- items: {
- '$ref': '#/components/schemas/ModelWithString'
- }
- }
-} as const;
-
-export const ArrayWithPropertiesSchema = {
- description: 'This is a simple array with properties',
- type: 'array',
- items: {
- type: 'object',
- properties: {
- '16x16': {
- '$ref': '#/components/schemas/camelCaseCommentWithBreaks'
- },
- bar: {
- type: 'string'
- }
- }
- }
-} as const;
-
-export const ArrayWithAnyOfPropertiesSchema = {
- description: 'This is a simple array with any of properties',
- type: 'array',
- items: {
- anyOf: [
- {
- type: 'object',
- properties: {
- foo: {
- type: 'string',
- default: 'test'
- }
- }
- },
- {
- type: 'object',
- properties: {
- bar: {
- type: 'string'
- }
- }
- }
- ]
- }
-} as const;
-
-export const AnyOfAnyAndNullSchema = {
- type: 'object',
- properties: {
- data: {
- anyOf: [
- {},
- {
- type: 'null'
- }
- ]
- }
- }
-} as const;
-
-export const AnyOfArraysSchema = {
- description: 'This is a simple array with any of properties',
- type: 'object',
- properties: {
- results: {
- items: {
- anyOf: [
- {
- type: 'object',
- properties: {
- foo: {
- type: 'string'
- }
- }
- },
- {
- type: 'object',
- properties: {
- bar: {
- type: 'string'
- }
- }
- }
- ]
- },
- type: 'array'
- }
- }
-} as const;
-
-export const DictionaryWithStringSchema = {
- description: 'This is a string dictionary',
- type: 'object',
- additionalProperties: {
- type: 'string'
- }
-} as const;
-
-export const DictionaryWithPropertiesAndAdditionalPropertiesSchema = {
- type: 'object',
- properties: {
- foo: {
- type: 'number'
- },
- bar: {
- type: 'boolean'
- }
- },
- additionalProperties: {
- type: 'string'
- }
-} as const;
-
-export const DictionaryWithReferenceSchema = {
- description: 'This is a string reference',
- type: 'object',
- additionalProperties: {
- '$ref': '#/components/schemas/ModelWithString'
- }
-} as const;
-
-export const DictionaryWithArraySchema = {
- description: 'This is a complex dictionary',
- type: 'object',
- additionalProperties: {
- type: 'array',
- items: {
- '$ref': '#/components/schemas/ModelWithString'
- }
- }
-} as const;
-
-export const DictionaryWithDictionarySchema = {
- description: 'This is a string dictionary',
- type: 'object',
- additionalProperties: {
- type: 'object',
- additionalProperties: {
- type: 'string'
- }
- }
-} as const;
-
-export const DictionaryWithPropertiesSchema = {
- description: 'This is a complex dictionary',
- type: 'object',
- additionalProperties: {
- type: 'object',
- properties: {
- foo: {
- type: 'string'
- },
- bar: {
- type: 'string'
- }
- }
- }
-} as const;
-
-export const ModelWithIntegerSchema = {
- description: 'This is a model with one number property',
- type: 'object',
- properties: {
- prop: {
- description: 'This is a simple number property',
- type: 'integer'
- }
- }
-} as const;
-
-export const ModelWithBooleanSchema = {
- description: 'This is a model with one boolean property',
- type: 'object',
- properties: {
- prop: {
- description: 'This is a simple boolean property',
- type: 'boolean'
- }
- }
-} as const;
-
-export const ModelWithStringSchema = {
- description: 'This is a model with one string property',
- type: 'object',
- properties: {
- prop: {
- description: 'This is a simple string property',
- type: 'string'
- }
- }
-} as const;
-
-export const ModelWithStringErrorSchema = {
- description: 'This is a model with one string property',
- type: 'object',
- properties: {
- prop: {
- description: 'This is a simple string property',
- type: 'string'
- }
- }
-} as const;
-
-export const Model_From_ZendeskSchema = {
- description: `\`Comment\` or \`VoiceComment\`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets)`,
- type: 'string'
-} as const;
-
-export const ModelWithNullableStringSchema = {
- description: 'This is a model with one string property',
- type: 'object',
- required: ['nullableRequiredProp1', 'nullableRequiredProp2'],
- properties: {
- nullableProp1: {
- description: 'This is a simple string property',
- type: 'string',
- nullable: true
- },
- nullableRequiredProp1: {
- description: 'This is a simple string property',
- type: 'string',
- nullable: true
- },
- nullableProp2: {
- description: 'This is a simple string property',
- type: ['string', 'null']
- },
- nullableRequiredProp2: {
- description: 'This is a simple string property',
- type: ['string', 'null']
- },
- 'foo_bar-enum': {
- description: 'This is a simple enum with strings',
- enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串']
- }
- }
-} as const;
-
-export const ModelWithEnumSchema = {
- description: 'This is a model with one enum',
- type: 'object',
- properties: {
- 'foo_bar-enum': {
- description: 'This is a simple enum with strings',
- enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串']
- },
- statusCode: {
- description: 'These are the HTTP error code enums',
- enum: ['100', '200 FOO', '300 FOO_BAR', '400 foo-bar', '500 foo.bar', '600 foo&bar']
- },
- bool: {
- description: 'Simple boolean enum',
- type: 'boolean',
- enum: [true]
- }
- }
-} as const;
-
-export const ModelWithEnumWithHyphenSchema = {
- description: 'This is a model with one enum with escaped name',
- type: 'object',
- properties: {
- 'foo-bar-baz-qux': {
- type: 'string',
- enum: ['3.0'],
- title: 'Foo-Bar-Baz-Qux',
- default: '3.0'
- }
- }
-} as const;
-
-export const ModelWithEnumFromDescriptionSchema = {
- description: 'This is a model with one enum',
- type: 'object',
- properties: {
- test: {
- type: 'integer',
- description: 'Success=1,Warning=2,Error=3'
- }
- }
-} as const;
-
-export const ModelWithNestedEnumsSchema = {
- description: 'This is a model with nested enums',
- type: 'object',
- properties: {
- dictionaryWithEnum: {
- type: 'object',
- additionalProperties: {
- enum: ['Success', 'Warning', 'Error']
- }
- },
- dictionaryWithEnumFromDescription: {
- type: 'object',
- additionalProperties: {
- type: 'integer',
- description: 'Success=1,Warning=2,Error=3'
- }
- },
- arrayWithEnum: {
- type: 'array',
- items: {
- enum: ['Success', 'Warning', 'Error']
- }
- },
- arrayWithDescription: {
- type: 'array',
- items: {
- type: 'integer',
- description: 'Success=1,Warning=2,Error=3'
- }
- },
- 'foo_bar-enum': {
- description: 'This is a simple enum with strings',
- enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串']
- }
- }
-} as const;
-
-export const ModelWithReferenceSchema = {
- description: 'This is a model with one property containing a reference',
- type: 'object',
- properties: {
- prop: {
- '$ref': '#/components/schemas/ModelWithProperties'
- }
- }
-} as const;
-
-export const ModelWithArrayReadOnlyAndWriteOnlySchema = {
- description: 'This is a model with one property containing an array',
- type: 'object',
- properties: {
- prop: {
- type: 'array',
- items: {
- '$ref': '#/components/schemas/ModelWithReadOnlyAndWriteOnly'
- }
- },
- propWithFile: {
- type: 'array',
- items: {
- type: 'file'
- }
- },
- propWithNumber: {
- type: 'array',
- items: {
- type: 'number'
- }
- }
- }
-} as const;
-
-export const ModelWithArraySchema = {
- description: 'This is a model with one property containing an array',
- type: 'object',
- properties: {
- prop: {
- type: 'array',
- items: {
- '$ref': '#/components/schemas/ModelWithString'
- }
- },
- propWithFile: {
- type: 'array',
- items: {
- type: 'file'
- }
- },
- propWithNumber: {
- type: 'array',
- items: {
- type: 'number'
- }
- }
- }
-} as const;
-
-export const ModelWithDictionarySchema = {
- description: 'This is a model with one property containing a dictionary',
- type: 'object',
- properties: {
- prop: {
- type: 'object',
- additionalProperties: {
- type: 'string'
- }
- }
- }
-} as const;
-
-export const DeprecatedModelSchema = {
- deprecated: true,
- description: 'This is a deprecated model with a deprecated property',
- type: 'object',
- properties: {
- prop: {
- deprecated: true,
- description: 'This is a deprecated property',
- type: 'string'
- }
- }
-} as const;
-
-export const ModelWithCircularReferenceSchema = {
- description: 'This is a model with one property containing a circular reference',
- type: 'object',
- properties: {
- prop: {
- '$ref': '#/components/schemas/ModelWithCircularReference'
- }
- }
-} as const;
-
-export const CompositionWithOneOfSchema = {
- description: "This is a model with one property with a 'one of' relationship",
- type: 'object',
- properties: {
- propA: {
- type: 'object',
- oneOf: [
- {
- '$ref': '#/components/schemas/ModelWithString'
- },
- {
- '$ref': '#/components/schemas/ModelWithEnum'
- },
- {
- '$ref': '#/components/schemas/ModelWithArray'
- },
- {
- '$ref': '#/components/schemas/ModelWithDictionary'
- }
- ]
- }
- }
-} as const;
-
-export const CompositionWithOneOfAnonymousSchema = {
- description: "This is a model with one property with a 'one of' relationship where the options are not $ref",
- type: 'object',
- properties: {
- propA: {
- type: 'object',
- oneOf: [
- {
- description: 'Anonymous object type',
- type: 'object',
- properties: {
- propA: {
- type: 'string'
- }
- }
- },
- {
- description: 'Anonymous string type',
- type: 'string'
- },
- {
- description: 'Anonymous integer type',
- type: 'integer'
- }
- ]
- }
- }
-} as const;
-
-export const ModelCircleSchema = {
- description: 'Circle',
- type: 'object',
- required: ['kind'],
- properties: {
- kind: {
- type: 'string'
- },
- radius: {
- type: 'number'
- }
- }
-} as const;
-
-export const ModelSquareSchema = {
- description: 'Square',
- type: 'object',
- required: ['kind'],
- properties: {
- kind: {
- type: 'string'
- },
- sideLength: {
- type: 'number'
- }
- }
-} as const;
-
-export const CompositionWithOneOfDiscriminatorSchema = {
- description: "This is a model with one property with a 'one of' relationship where the options are not $ref",
- type: 'object',
- oneOf: [
- {
- '$ref': '#/components/schemas/ModelCircle'
- },
- {
- '$ref': '#/components/schemas/ModelSquare'
- }
- ],
- discriminator: {
- propertyName: 'kind',
- mapping: {
- circle: '#/components/schemas/ModelCircle',
- square: '#/components/schemas/ModelSquare'
- }
- }
-} as const;
-
-export const CompositionWithAnyOfSchema = {
- description: "This is a model with one property with a 'any of' relationship",
- type: 'object',
- properties: {
- propA: {
- type: 'object',
- anyOf: [
- {
- '$ref': '#/components/schemas/ModelWithString'
- },
- {
- '$ref': '#/components/schemas/ModelWithEnum'
- },
- {
- '$ref': '#/components/schemas/ModelWithArray'
- },
- {
- '$ref': '#/components/schemas/ModelWithDictionary'
- }
- ]
- }
- }
-} as const;
-
-export const CompositionWithAnyOfAnonymousSchema = {
- description: "This is a model with one property with a 'any of' relationship where the options are not $ref",
- type: 'object',
- properties: {
- propA: {
- type: 'object',
- anyOf: [
- {
- description: 'Anonymous object type',
- type: 'object',
- properties: {
- propA: {
- type: 'string'
- }
- }
- },
- {
- description: 'Anonymous string type',
- type: 'string'
- },
- {
- description: 'Anonymous integer type',
- type: 'integer'
- }
- ]
- }
- }
-} as const;
-
-export const CompositionWithNestedAnyAndTypeNullSchema = {
- description: "This is a model with nested 'any of' property with a type null",
- type: 'object',
- properties: {
- propA: {
- type: 'object',
- anyOf: [
- {
- items: {
- anyOf: [
- {
- '$ref': '#/components/schemas/ModelWithDictionary'
- },
- {
- type: 'null'
- }
- ]
- },
- type: 'array'
- },
- {
- items: {
- anyOf: [
- {
- '$ref': '#/components/schemas/ModelWithArray'
- },
- {
- type: 'null'
- }
- ]
- },
- type: 'array'
- }
- ]
- }
- }
-} as const;
-
-export const _3e_num_1ПериодSchema = {
- enum: ['Bird', 'Dog'],
- type: 'string'
-} as const;
-
-export const ConstValueSchema = {
- type: 'string',
- const: 'ConstValue'
-} as const;
-
-export const CompositionWithNestedAnyOfAndNullSchema = {
- description: "This is a model with one property with a 'any of' relationship where the options are not $ref",
- type: 'object',
- properties: {
- propA: {
- anyOf: [
- {
- items: {
- anyOf: [
- {
- '$ref': '#/components/schemas/3e-num_1Период'
- },
- {
- '$ref': '#/components/schemas/ConstValue'
- }
- ]
- },
- type: 'array'
- },
- {
- type: 'null'
- }
- ],
- title: 'Scopes'
- }
- }
-} as const;
-
-export const CompositionWithOneOfAndNullableSchema = {
- description: "This is a model with one property with a 'one of' relationship",
- type: 'object',
- properties: {
- propA: {
- nullable: true,
- type: 'object',
- oneOf: [
- {
- type: 'object',
- properties: {
- boolean: {
- type: 'boolean'
- }
- }
- },
- {
- '$ref': '#/components/schemas/ModelWithEnum'
- },
- {
- '$ref': '#/components/schemas/ModelWithArray'
- },
- {
- '$ref': '#/components/schemas/ModelWithDictionary'
- }
- ]
- }
- }
-} as const;
-
-export const CompositionWithOneOfAndSimpleDictionarySchema = {
- description: 'This is a model that contains a simple dictionary within composition',
- type: 'object',
- properties: {
- propA: {
- oneOf: [
- {
- type: 'boolean'
- },
- {
- type: 'object',
- additionalProperties: {
- type: 'number'
- }
- }
- ]
- }
- }
-} as const;
-
-export const CompositionWithOneOfAndSimpleArrayDictionarySchema = {
- description: 'This is a model that contains a dictionary of simple arrays within composition',
- type: 'object',
- properties: {
- propA: {
- oneOf: [
- {
- type: 'boolean'
- },
- {
- type: 'object',
- additionalProperties: {
- type: 'array',
- items: {
- type: 'boolean'
- }
- }
- }
- ]
- }
- }
-} as const;
-
-export const CompositionWithOneOfAndComplexArrayDictionarySchema = {
- description: 'This is a model that contains a dictionary of complex arrays (composited) within composition',
- type: 'object',
- properties: {
- propA: {
- oneOf: [
- {
- type: 'boolean'
- },
- {
- type: 'object',
- additionalProperties: {
- type: 'array',
- items: {
- oneOf: [
- {
- type: 'number'
- },
- {
- type: 'string'
- }
- ]
- }
- }
- }
- ]
- }
- }
-} as const;
-
-export const CompositionWithAllOfAndNullableSchema = {
- description: "This is a model with one property with a 'all of' relationship",
- type: 'object',
- properties: {
- propA: {
- nullable: true,
- type: 'object',
- allOf: [
- {
- type: 'object',
- properties: {
- boolean: {
- type: 'boolean'
- }
- }
- },
- {
- '$ref': '#/components/schemas/ModelWithEnum'
- },
- {
- '$ref': '#/components/schemas/ModelWithArray'
- },
- {
- '$ref': '#/components/schemas/ModelWithDictionary'
- }
- ]
- }
- }
-} as const;
-
-export const CompositionWithAnyOfAndNullableSchema = {
- description: "This is a model with one property with a 'any of' relationship",
- type: 'object',
- properties: {
- propA: {
- nullable: true,
- type: 'object',
- anyOf: [
- {
- type: 'object',
- properties: {
- boolean: {
- type: 'boolean'
- }
- }
- },
- {
- '$ref': '#/components/schemas/ModelWithEnum'
- },
- {
- '$ref': '#/components/schemas/ModelWithArray'
- },
- {
- '$ref': '#/components/schemas/ModelWithDictionary'
- }
- ]
- }
- }
-} as const;
-
-export const CompositionBaseModelSchema = {
- description: 'This is a base model with two simple optional properties',
- type: 'object',
- properties: {
- firstName: {
- type: 'string'
- },
- lastname: {
- type: 'string'
- }
- }
-} as const;
-
-export const CompositionExtendedModelSchema = {
- description: 'This is a model that extends the base model',
- type: 'object',
- allOf: [
- {
- '$ref': '#/components/schemas/CompositionBaseModel'
- }
- ],
- properties: {
- age: {
- type: 'number'
- }
- },
- required: ['firstName', 'lastname', 'age']
-} as const;
-
-export const ModelWithPropertiesSchema = {
- description: 'This is a model with one nested property',
- type: 'object',
- required: ['required', 'requiredAndReadOnly', 'requiredAndNullable'],
- properties: {
- required: {
- type: 'string'
- },
- requiredAndReadOnly: {
- type: 'string',
- readOnly: true
- },
- requiredAndNullable: {
- type: 'string',
- nullable: true
- },
- string: {
- type: 'string'
- },
- number: {
- type: 'number'
- },
- boolean: {
- type: 'boolean'
- },
- reference: {
- '$ref': '#/components/schemas/ModelWithString'
- },
- 'property with space': {
- type: 'string'
- },
- default: {
- type: 'string'
- },
- try: {
- type: 'string'
- },
- '@namespace.string': {
- type: 'string',
- readOnly: true
- },
- '@namespace.integer': {
- type: 'integer',
- readOnly: true
- }
- }
-} as const;
-
-export const ModelWithNestedPropertiesSchema = {
- description: 'This is a model with one nested property',
- type: 'object',
- required: ['first'],
- properties: {
- first: {
- type: 'object',
- required: ['second'],
- readOnly: true,
- nullable: true,
- properties: {
- second: {
- type: 'object',
- required: ['third'],
- readOnly: true,
- nullable: true,
- properties: {
- third: {
- type: 'string',
- required: true,
- readOnly: true,
- nullable: true
- }
- }
- }
- }
- }
- }
-} as const;
-
-export const ModelWithDuplicatePropertiesSchema = {
- description: 'This is a model with duplicated properties',
- type: 'object',
- properties: {
- prop: {
- '$ref': '#/components/schemas/ModelWithString'
- }
- }
-} as const;
-
-export const ModelWithOrderedPropertiesSchema = {
- description: 'This is a model with ordered properties',
- type: 'object',
- properties: {
- zebra: {
- type: 'string'
- },
- apple: {
- type: 'string'
- },
- hawaii: {
- type: 'string'
- }
- }
-} as const;
-
-export const ModelWithDuplicateImportsSchema = {
- description: 'This is a model with duplicated imports',
- type: 'object',
- properties: {
- propA: {
- '$ref': '#/components/schemas/ModelWithString'
- },
- propB: {
- '$ref': '#/components/schemas/ModelWithString'
- },
- propC: {
- '$ref': '#/components/schemas/ModelWithString'
- }
- }
-} as const;
-
-export const ModelThatExtendsSchema = {
- description: 'This is a model that extends another model',
- type: 'object',
- allOf: [
- {
- '$ref': '#/components/schemas/ModelWithString'
- },
- {
- type: 'object',
- properties: {
- propExtendsA: {
- type: 'string'
- },
- propExtendsB: {
- '$ref': '#/components/schemas/ModelWithString'
- }
- }
- }
- ]
-} as const;
-
-export const ModelThatExtendsExtendsSchema = {
- description: 'This is a model that extends another model',
- type: 'object',
- allOf: [
- {
- '$ref': '#/components/schemas/ModelWithString'
- },
- {
- '$ref': '#/components/schemas/ModelThatExtends'
- },
- {
- type: 'object',
- properties: {
- propExtendsC: {
- type: 'string'
- },
- propExtendsD: {
- '$ref': '#/components/schemas/ModelWithString'
- }
- }
- }
- ]
-} as const;
-
-export const ModelWithPatternSchema = {
- description: 'This is a model that contains a some patterns',
- type: 'object',
- required: ['key', 'name'],
- properties: {
- key: {
- maxLength: 64,
- pattern: '^[a-zA-Z0-9_]*$',
- type: 'string'
- },
- name: {
- maxLength: 255,
- type: 'string'
- },
- enabled: {
- type: 'boolean',
- readOnly: true
- },
- modified: {
- type: 'string',
- format: 'date-time',
- readOnly: true
- },
- id: {
- type: 'string',
- pattern: '^\\d{2}-\\d{3}-\\d{4}$'
- },
- text: {
- type: 'string',
- pattern: '^\\w+$'
- },
- patternWithSingleQuotes: {
- type: 'string',
- pattern: "^[a-zA-Z0-9']*$"
- },
- patternWithNewline: {
- type: 'string',
- pattern: 'aaa\\nbbb'
- },
- patternWithBacktick: {
- type: 'string',
- pattern: 'aaa`bbb'
- }
- }
-} as const;
-
-export const FileSchema = {
- required: ['mime'],
- type: 'object',
- properties: {
- id: {
- title: 'Id',
- type: 'string',
- readOnly: true,
- minLength: 1
- },
- updated_at: {
- title: 'Updated at',
- type: 'string',
- format: 'date-time',
- readOnly: true
- },
- created_at: {
- title: 'Created at',
- type: 'string',
- format: 'date-time',
- readOnly: true
- },
- mime: {
- title: 'Mime',
- type: 'string',
- maxLength: 24,
- minLength: 1
- },
- file: {
- title: 'File',
- type: 'string',
- readOnly: true,
- format: 'uri'
- }
- }
-} as const;
-
-export const defaultSchema = {
- type: 'object',
- properties: {
- name: {
- type: 'string'
- }
- }
-} as const;
-
-export const PageableSchema = {
- type: 'object',
- properties: {
- page: {
- minimum: 0,
- type: 'integer',
- format: 'int32',
- default: 0
- },
- size: {
- minimum: 1,
- type: 'integer',
- format: 'int32'
- },
- sort: {
- type: 'array',
- items: {
- type: 'string'
- }
- }
- }
-} as const;
-
-export const FreeFormObjectWithoutAdditionalPropertiesSchema = {
- description: 'This is a free-form object without additionalProperties.',
- type: 'object'
-} as const;
-
-export const FreeFormObjectWithAdditionalPropertiesEqTrueSchema = {
- description: 'This is a free-form object with additionalProperties: true.',
- type: 'object',
- additionalProperties: true
-} as const;
-
-export const FreeFormObjectWithAdditionalPropertiesEqEmptyObjectSchema = {
- description: 'This is a free-form object with additionalProperties: {}.',
- type: 'object',
- additionalProperties: {}
-} as const;
-
-export const ModelWithConstSchema = {
- type: 'object',
- properties: {
- String: {
- const: 'String'
- },
- number: {
- const: 0
- },
- null: {
- const: null
- },
- withType: {
- type: 'string',
- const: 'Some string'
- }
- }
-} as const;
-
-export const ModelWithAdditionalPropertiesEqTrueSchema = {
- description: 'This is a model with one property and additionalProperties: true',
- type: 'object',
- properties: {
- prop: {
- description: 'This is a simple string property',
- type: 'string'
- }
- },
- additionalProperties: true
-} as const;
-
-export const NestedAnyOfArraysNullableSchema = {
- properties: {
- nullableArray: {
- anyOf: [
- {
- items: {
- anyOf: [
- {
- type: 'string'
- },
- {
- type: 'boolean'
- }
- ]
- },
- type: 'array'
- },
- {
- type: 'null'
- }
- ]
- }
- },
- type: 'object'
-} as const;
-
-export const CompositionWithOneOfAndPropertiesSchema = {
- type: 'object',
- oneOf: [
- {
- type: 'object',
- required: ['foo'],
- properties: {
- foo: {
- '$ref': '#/components/parameters/SimpleParameter'
- }
- },
- additionalProperties: false
- },
- {
- type: 'object',
- required: ['bar'],
- properties: {
- bar: {
- '$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串'
- }
- },
- additionalProperties: false
- }
- ],
- required: ['baz', 'qux'],
- properties: {
- baz: {
- type: 'integer',
- format: 'uint16',
- minimum: 0,
- nullable: true
- },
- qux: {
- type: 'integer',
- format: 'uint8',
- minimum: 0
- }
- }
-} as const;
-
-export const NullableObjectSchema = {
- type: ['object', 'null'],
- description: 'An object that can be null',
- properties: {
- foo: {
- type: 'string'
- }
- },
- default: null
-} as const;
-
-export const CharactersInDescriptionSchema = {
- type: 'string',
- description: 'Some % character'
-} as const;
-
-export const ModelWithNullableObjectSchema = {
- type: 'object',
- properties: {
- data: {
- '$ref': '#/components/schemas/NullableObject'
- }
- }
-} as const;
-
-export const ModelWithOneOfEnumSchema = {
- oneOf: [
- {
- type: 'object',
- required: ['foo'],
- properties: {
- foo: {
- type: 'string',
- enum: ['Bar']
- }
- }
- },
- {
- type: 'object',
- required: ['foo'],
- properties: {
- foo: {
- type: 'string',
- enum: ['Baz']
- }
- }
- },
- {
- type: 'object',
- required: ['foo'],
- properties: {
- foo: {
- type: 'string',
- enum: ['Qux']
- }
- }
- },
- {
- type: 'object',
- required: ['content', 'foo'],
- properties: {
- content: {
- type: 'string',
- format: 'date-time'
- },
- foo: {
- type: 'string',
- enum: ['Quux']
- }
- }
- },
- {
- type: 'object',
- required: ['content', 'foo'],
- properties: {
- content: {
- type: 'array',
- items: [
- {
- type: 'string',
- format: 'date-time'
- },
- {
- type: 'string'
- }
- ],
- maxItems: 2,
- minItems: 2
- },
- foo: {
- type: 'string',
- enum: ['Corge']
- }
- }
- }
- ]
-} as const;
-
-export const ModelWithNestedArrayEnumsDataFooSchema = {
- enum: ['foo', 'bar'],
- type: 'string'
-} as const;
-
-export const ModelWithNestedArrayEnumsDataBarSchema = {
- enum: ['baz', 'qux'],
- type: 'string'
-} as const;
-
-export const ModelWithNestedArrayEnumsDataSchema = {
- type: 'object',
- properties: {
- foo: {
- type: 'array',
- items: {
- '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo'
- }
- },
- bar: {
- type: 'array',
- items: {
- '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataBar'
- }
- }
- }
-} as const;
-
-export const ModelWithNestedArrayEnumsSchema = {
- type: 'object',
- properties: {
- array_strings: {
- type: 'array',
- items: {
- type: 'string'
- }
- },
- data: {
- allOf: [
- {
- '$ref': '#/components/schemas/ModelWithNestedArrayEnumsData'
- }
- ]
- }
- }
-} as const;
-
-export const ModelWithNestedCompositionEnumsSchema = {
- type: 'object',
- properties: {
- foo: {
- allOf: [
- {
- '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo'
- }
- ]
- }
- }
-} as const;
-
-export const ModelWithReadOnlyAndWriteOnlySchema = {
- type: 'object',
- required: ['foo', 'bar', 'baz'],
- properties: {
- foo: {
- type: 'string'
- },
- bar: {
- readOnly: true,
- type: 'string'
- },
- baz: {
- type: 'string',
- writeOnly: true
- }
- }
-} as const;
-
-export const ModelWithConstantSizeArraySchema = {
- type: 'array',
- items: {
- type: 'number'
- },
- minItems: 2,
- maxItems: 2
-} as const;
-
-export const ModelWithAnyOfConstantSizeArraySchema = {
- type: 'array',
- items: {
- oneOf: [
- {
- type: 'number'
- },
- {
- type: 'string'
- }
- ]
- },
- minItems: 3,
- maxItems: 3
-} as const;
-
-export const ModelWithPrefixItemsConstantSizeArraySchema = {
- type: 'array',
- prefixItems: [
- {
- '$ref': '#/components/schemas/ModelWithInteger'
- },
- {
- oneOf: [
- {
- type: 'number'
- },
- {
- type: 'string'
- }
- ]
- },
- {
- type: 'string'
- }
- ]
-} as const;
-
-export const ModelWithAnyOfConstantSizeArrayNullableSchema = {
- type: ['array'],
- items: {
- oneOf: [
- {
- type: 'number',
- nullable: true
- },
- {
- type: 'string'
- }
- ]
- },
- minItems: 3,
- maxItems: 3
-} as const;
-
-export const ModelWithAnyOfConstantSizeArrayWithNSizeAndOptionsSchema = {
- type: 'array',
- items: {
- oneOf: [
- {
- type: 'number'
- },
- {
- '$ref': '#/components/schemas/import'
- }
- ]
- },
- minItems: 2,
- maxItems: 2
-} as const;
-
-export const ModelWithAnyOfConstantSizeArrayAndIntersectSchema = {
- type: 'array',
- items: {
- allOf: [
- {
- type: 'number'
- },
- {
- type: 'string'
- }
- ]
- },
- minItems: 2,
- maxItems: 2
-} as const;
-
-export const ModelWithNumericEnumUnionSchema = {
- type: 'object',
- properties: {
- value: {
- type: 'number',
- description: 'Период',
- enum: [-10, -1, 0, 1, 3, 6, 12]
- }
- }
-} as const;
-
-export const ModelWithBackticksInDescriptionSchema = {
- description: 'Some description with `back ticks`',
- type: 'object',
- properties: {
- template: {
- type: 'string',
- description: `The template \`that\` should be used for parsing and importing the contents of the CSV file.
-
-
There is one placeholder currently supported:
- \${x} - refers to the n-th column in the CSV file, e.g. \${1}, \${2}, ...)
Example of a correct JSON template:
-
-[
- {
- "resourceType": "Asset",
- "identifier": {
- "name": "\${1}",
- "domain": {
- "name": "\${2}",
- "community": {
- "name": "Some Community"
- }
- }
- },
- "attributes" : {
- "00000000-0000-0000-0000-000000003115" : [ {
- "value" : "\${3}"
- } ],
- "00000000-0000-0000-0000-000000000222" : [ {
- "value" : "\${4}"
- } ]
- }
- }
-]
-`
- }
- }
-} as const;
-
-export const ModelWithOneOfAndPropertiesSchema = {
- type: 'object',
- oneOf: [
- {
- '$ref': '#/components/parameters/SimpleParameter'
- },
- {
- '$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串'
- }
- ],
- required: ['baz', 'qux'],
- properties: {
- baz: {
- type: 'integer',
- format: 'uint16',
- minimum: 0,
- nullable: true
- },
- qux: {
- type: 'integer',
- format: 'uint8',
- minimum: 0
- }
- }
-} as const;
-
-export const ParameterSimpleParameterUnusedSchema = {
- description: 'Model used to test deduplication strategy (unused)',
- type: 'string'
-} as const;
-
-export const PostServiceWithEmptyTagResponseSchema = {
- description: 'Model used to test deduplication strategy',
- type: 'string'
-} as const;
-
-export const PostServiceWithEmptyTagResponse2Schema = {
- description: 'Model used to test deduplication strategy',
- type: 'string'
-} as const;
-
-export const DeleteFooDataSchema = {
- description: 'Model used to test deduplication strategy',
- type: 'string'
-} as const;
-
-export const DeleteFooData2Schema = {
- description: 'Model used to test deduplication strategy',
- type: 'string'
-} as const;
-
-export const importSchema = {
- description: 'Model with restricted keyword name',
- type: 'string'
-} as const;
-
-export const SchemaWithFormRestrictedKeysSchema = {
- properties: {
- description: {
- type: 'string'
- },
- 'x-enum-descriptions': {
- type: 'string'
- },
- 'x-enum-varnames': {
- type: 'string'
- },
- 'x-enumNames': {
- type: 'string'
- },
- title: {
- type: 'string'
- },
- object: {
- type: 'object',
- properties: {
- description: {
- type: 'string'
- },
- 'x-enum-descriptions': {
- type: 'string'
- },
- 'x-enum-varnames': {
- type: 'string'
- },
- 'x-enumNames': {
- type: 'string'
- },
- title: {
- type: 'string'
- }
- }
- },
- array: {
- type: 'array',
- items: [
- {
- type: 'object',
- properties: {
- description: {
- type: 'string'
- },
- 'x-enum-descriptions': {
- type: 'string'
- },
- 'x-enum-varnames': {
- type: 'string'
- },
- 'x-enumNames': {
- type: 'string'
- },
- title: {
- type: 'string'
- }
- }
- }
- ]
- }
- }
-} as const;
-
-export const io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptionsSchema = {
- description: 'This schema was giving PascalCase transformations a hard time',
- properties: {
- preconditions: {
- allOf: [
- {
- '$ref': '#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions'
- }
- ],
- description: 'Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.'
- }
- },
- type: 'object'
-} as const;
-
-export const io_k8s_apimachinery_pkg_apis_meta_v1_PreconditionsSchema = {
- description: 'This schema was giving PascalCase transformations a hard time',
- properties: {
- resourceVersion: {
- description: 'Specifies the target ResourceVersion',
- type: 'string'
- },
- uid: {
- description: 'Specifies the target UID.',
- type: 'string'
- }
- },
- type: 'object'
-} as const;
-
-export const AdditionalPropertiesUnknownIssueSchema = {
- type: 'object',
- properties: {},
- additionalProperties: {
- anyOf: [
- {
- type: 'string'
- },
- {
- type: 'number'
- }
- ]
- }
-} as const;
-
-export const AdditionalPropertiesUnknownIssue2Schema = {
- type: 'object',
- additionalProperties: {
- anyOf: [
- {
- type: 'string'
- },
- {
- type: 'number'
- }
- ]
- }
-} as const;
-
-export const AdditionalPropertiesUnknownIssue3Schema = {
- type: 'object',
- allOf: [
- {
- type: 'string'
- },
- {
- type: 'object',
- required: ['entries'],
- properties: {
- entries: {
- additionalProperties: {
- '$ref': '#/components/schemas/AdditionalPropertiesUnknownIssue'
- }
- }
- }
- }
- ]
-} as const;
-
-export const AdditionalPropertiesIntegerIssueSchema = {
- type: 'object',
- required: ['value'],
- properties: {
- value: {
- type: 'integer'
- }
- },
- additionalProperties: {
- type: 'integer'
- }
-} as const;
-
-export const OneOfAllOfIssueSchema = {
- oneOf: [
- {
- allOf: [
- {
- oneOf: [
- {
- '$ref': '#/components/schemas/ConstValue'
- },
- {
- '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]'
- }
- ]
- },
- {
- '$ref': '#/components/schemas/3e-num_1Период'
- }
- ]
- },
- {
- '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]'
- }
- ]
-} as const;
-
-export const Generic_Schema_Duplicate_Issue_1_System_Boolean_Schema = {
- type: 'object',
- properties: {
- item: {
- type: 'boolean'
- },
- error: {
- type: 'string',
- nullable: true
- },
- hasError: {
- type: 'boolean',
- readOnly: true
- },
- data: {
- type: 'object',
- properties: {},
- additionalProperties: false
- }
- },
- additionalProperties: false
-} as const;
-
-export const Generic_Schema_Duplicate_Issue_1_System_String_Schema = {
- type: 'object',
- properties: {
- item: {
- type: 'string',
- nullable: true
- },
- error: {
- type: 'string',
- nullable: true
- },
- hasError: {
- type: 'boolean',
- readOnly: true
- }
- },
- additionalProperties: false
-} as const;
diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3-schemas-name/schemas.gen.ts.snap b/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3-schemas-name/schemas.gen.ts.snap
deleted file mode 100644
index af93bb248e..0000000000
--- a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3-schemas-name/schemas.gen.ts.snap
+++ /dev/null
@@ -1,1994 +0,0 @@
-// This file is auto-generated by @hey-api/openapi-ts
-
-export const $400 = {
- description: 'Model with number-only name',
- type: 'string'
-} as const;
-
-export const $camelCaseCommentWithBreaks = {
- description: `Testing multiline comments in string: First line
-Second line
-
-Fourth line`,
- type: 'integer'
-} as const;
-
-export const $CommentWithBreaks = {
- description: `Testing multiline comments in string: First line
-Second line
-
-Fourth line`,
- type: 'integer'
-} as const;
-
-export const $CommentWithBackticks = {
- description: 'Testing backticks in string: `backticks` and ```multiple backticks``` should work',
- type: 'integer'
-} as const;
-
-export const $CommentWithBackticksAndQuotes = {
- description: `Testing backticks and quotes in string: \`backticks\`, 'quotes', "double quotes" and \`\`\`multiple backticks\`\`\` should work`,
- type: 'integer'
-} as const;
-
-export const $CommentWithSlashes = {
- description: 'Testing slashes in string: \\backwards\\\\\\ and /forwards/// should work',
- type: 'integer'
-} as const;
-
-export const $CommentWithExpressionPlaceholders = {
- description: 'Testing expression placeholders in string: ${expression} should work',
- type: 'integer'
-} as const;
-
-export const $CommentWithQuotes = {
- description: `Testing quotes in string: 'single quote''' and "double quotes""" should work`,
- type: 'integer'
-} as const;
-
-export const $CommentWithReservedCharacters = {
- description: 'Testing reserved characters in string: /* inline */ and /** inline **/ should work',
- type: 'integer'
-} as const;
-
-export const $SimpleInteger = {
- description: 'This is a simple number',
- type: 'integer'
-} as const;
-
-export const $SimpleBoolean = {
- description: 'This is a simple boolean',
- type: 'boolean'
-} as const;
-
-export const $SimpleString = {
- description: 'This is a simple string',
- type: 'string'
-} as const;
-
-export const $NonAsciiStringæøåÆØÅöôêÊ字符串 = {
- description: 'A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串)',
- type: 'string'
-} as const;
-
-export const $SimpleFile = {
- description: 'This is a simple file',
- type: 'file'
-} as const;
-
-export const $SimpleReference = {
- description: 'This is a simple reference',
- '$ref': '#/components/schemas/ModelWithString'
-} as const;
-
-export const $SimpleStringWithPattern = {
- description: 'This is a simple string',
- type: 'string',
- nullable: true,
- maxLength: 64,
- pattern: '^[a-zA-Z0-9_]*$'
-} as const;
-
-export const $EnumWithStrings = {
- description: 'This is a simple enum with strings',
- enum: ['Success', 'Warning', 'Error', "'Single Quote'", '"Double Quotes"', 'Non-ascii: øæåôöØÆÅÔÖ字符串']
-} as const;
-
-export const $EnumWithReplacedCharacters = {
- enum: ["'Single Quote'", '"Double Quotes"', 'øæåôöØÆÅÔÖ字符串', 3.1, ''],
- type: 'string'
-} as const;
-
-export const $EnumWithNumbers = {
- description: 'This is a simple enum with numbers',
- enum: [1, 2, 3, 1.1, 1.2, 1.3, 100, 200, 300, -100, -200, -300, -1.1, -1.2, -1.3],
- default: 200
-} as const;
-
-export const $EnumFromDescription = {
- description: 'Success=1,Warning=2,Error=3',
- type: 'number'
-} as const;
-
-export const $EnumWithExtensions = {
- description: 'This is a simple enum with numbers',
- enum: [200, 400, 500],
- 'x-enum-varnames': ['CUSTOM_SUCCESS', 'CUSTOM_WARNING', 'CUSTOM_ERROR'],
- 'x-enum-descriptions': ['Used when the status of something is successful', 'Used when the status of something has a warning', 'Used when the status of something has an error']
-} as const;
-
-export const $EnumWithXEnumNames = {
- enum: [0, 1, 2],
- 'x-enumNames': ['zero', 'one', 'two']
-} as const;
-
-export const $ArrayWithNumbers = {
- description: 'This is a simple array with numbers',
- type: 'array',
- items: {
- type: 'integer'
- }
-} as const;
-
-export const $ArrayWithBooleans = {
- description: 'This is a simple array with booleans',
- type: 'array',
- items: {
- type: 'boolean'
- }
-} as const;
-
-export const $ArrayWithStrings = {
- description: 'This is a simple array with strings',
- type: 'array',
- items: {
- type: 'string'
- },
- default: ['test']
-} as const;
-
-export const $ArrayWithReferences = {
- description: 'This is a simple array with references',
- type: 'array',
- items: {
- '$ref': '#/components/schemas/ModelWithString'
- }
-} as const;
-
-export const $ArrayWithArray = {
- description: 'This is a simple array containing an array',
- type: 'array',
- items: {
- type: 'array',
- items: {
- '$ref': '#/components/schemas/ModelWithString'
- }
- }
-} as const;
-
-export const $ArrayWithProperties = {
- description: 'This is a simple array with properties',
- type: 'array',
- items: {
- type: 'object',
- properties: {
- '16x16': {
- '$ref': '#/components/schemas/camelCaseCommentWithBreaks'
- },
- bar: {
- type: 'string'
- }
- }
- }
-} as const;
-
-export const $ArrayWithAnyOfProperties = {
- description: 'This is a simple array with any of properties',
- type: 'array',
- items: {
- anyOf: [
- {
- type: 'object',
- properties: {
- foo: {
- type: 'string',
- default: 'test'
- }
- }
- },
- {
- type: 'object',
- properties: {
- bar: {
- type: 'string'
- }
- }
- }
- ]
- }
-} as const;
-
-export const $AnyOfAnyAndNull = {
- type: 'object',
- properties: {
- data: {
- anyOf: [
- {},
- {
- type: 'null'
- }
- ]
- }
- }
-} as const;
-
-export const $AnyOfArrays = {
- description: 'This is a simple array with any of properties',
- type: 'object',
- properties: {
- results: {
- items: {
- anyOf: [
- {
- type: 'object',
- properties: {
- foo: {
- type: 'string'
- }
- }
- },
- {
- type: 'object',
- properties: {
- bar: {
- type: 'string'
- }
- }
- }
- ]
- },
- type: 'array'
- }
- }
-} as const;
-
-export const $DictionaryWithString = {
- description: 'This is a string dictionary',
- type: 'object',
- additionalProperties: {
- type: 'string'
- }
-} as const;
-
-export const $DictionaryWithPropertiesAndAdditionalProperties = {
- type: 'object',
- properties: {
- foo: {
- type: 'number'
- },
- bar: {
- type: 'boolean'
- }
- },
- additionalProperties: {
- type: 'string'
- }
-} as const;
-
-export const $DictionaryWithReference = {
- description: 'This is a string reference',
- type: 'object',
- additionalProperties: {
- '$ref': '#/components/schemas/ModelWithString'
- }
-} as const;
-
-export const $DictionaryWithArray = {
- description: 'This is a complex dictionary',
- type: 'object',
- additionalProperties: {
- type: 'array',
- items: {
- '$ref': '#/components/schemas/ModelWithString'
- }
- }
-} as const;
-
-export const $DictionaryWithDictionary = {
- description: 'This is a string dictionary',
- type: 'object',
- additionalProperties: {
- type: 'object',
- additionalProperties: {
- type: 'string'
- }
- }
-} as const;
-
-export const $DictionaryWithProperties = {
- description: 'This is a complex dictionary',
- type: 'object',
- additionalProperties: {
- type: 'object',
- properties: {
- foo: {
- type: 'string'
- },
- bar: {
- type: 'string'
- }
- }
- }
-} as const;
-
-export const $ModelWithInteger = {
- description: 'This is a model with one number property',
- type: 'object',
- properties: {
- prop: {
- description: 'This is a simple number property',
- type: 'integer'
- }
- }
-} as const;
-
-export const $ModelWithBoolean = {
- description: 'This is a model with one boolean property',
- type: 'object',
- properties: {
- prop: {
- description: 'This is a simple boolean property',
- type: 'boolean'
- }
- }
-} as const;
-
-export const $ModelWithString = {
- description: 'This is a model with one string property',
- type: 'object',
- properties: {
- prop: {
- description: 'This is a simple string property',
- type: 'string'
- }
- }
-} as const;
-
-export const $ModelWithStringError = {
- description: 'This is a model with one string property',
- type: 'object',
- properties: {
- prop: {
- description: 'This is a simple string property',
- type: 'string'
- }
- }
-} as const;
-
-export const $Model_From_Zendesk = {
- description: `\`Comment\` or \`VoiceComment\`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets)`,
- type: 'string'
-} as const;
-
-export const $ModelWithNullableString = {
- description: 'This is a model with one string property',
- type: 'object',
- required: ['nullableRequiredProp1', 'nullableRequiredProp2'],
- properties: {
- nullableProp1: {
- description: 'This is a simple string property',
- type: 'string',
- nullable: true
- },
- nullableRequiredProp1: {
- description: 'This is a simple string property',
- type: 'string',
- nullable: true
- },
- nullableProp2: {
- description: 'This is a simple string property',
- type: ['string', 'null']
- },
- nullableRequiredProp2: {
- description: 'This is a simple string property',
- type: ['string', 'null']
- },
- 'foo_bar-enum': {
- description: 'This is a simple enum with strings',
- enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串']
- }
- }
-} as const;
-
-export const $ModelWithEnum = {
- description: 'This is a model with one enum',
- type: 'object',
- properties: {
- 'foo_bar-enum': {
- description: 'This is a simple enum with strings',
- enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串']
- },
- statusCode: {
- description: 'These are the HTTP error code enums',
- enum: ['100', '200 FOO', '300 FOO_BAR', '400 foo-bar', '500 foo.bar', '600 foo&bar']
- },
- bool: {
- description: 'Simple boolean enum',
- type: 'boolean',
- enum: [true]
- }
- }
-} as const;
-
-export const $ModelWithEnumWithHyphen = {
- description: 'This is a model with one enum with escaped name',
- type: 'object',
- properties: {
- 'foo-bar-baz-qux': {
- type: 'string',
- enum: ['3.0'],
- title: 'Foo-Bar-Baz-Qux',
- default: '3.0'
- }
- }
-} as const;
-
-export const $ModelWithEnumFromDescription = {
- description: 'This is a model with one enum',
- type: 'object',
- properties: {
- test: {
- type: 'integer',
- description: 'Success=1,Warning=2,Error=3'
- }
- }
-} as const;
-
-export const $ModelWithNestedEnums = {
- description: 'This is a model with nested enums',
- type: 'object',
- properties: {
- dictionaryWithEnum: {
- type: 'object',
- additionalProperties: {
- enum: ['Success', 'Warning', 'Error']
- }
- },
- dictionaryWithEnumFromDescription: {
- type: 'object',
- additionalProperties: {
- type: 'integer',
- description: 'Success=1,Warning=2,Error=3'
- }
- },
- arrayWithEnum: {
- type: 'array',
- items: {
- enum: ['Success', 'Warning', 'Error']
- }
- },
- arrayWithDescription: {
- type: 'array',
- items: {
- type: 'integer',
- description: 'Success=1,Warning=2,Error=3'
- }
- },
- 'foo_bar-enum': {
- description: 'This is a simple enum with strings',
- enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串']
- }
- }
-} as const;
-
-export const $ModelWithReference = {
- description: 'This is a model with one property containing a reference',
- type: 'object',
- properties: {
- prop: {
- '$ref': '#/components/schemas/ModelWithProperties'
- }
- }
-} as const;
-
-export const $ModelWithArrayReadOnlyAndWriteOnly = {
- description: 'This is a model with one property containing an array',
- type: 'object',
- properties: {
- prop: {
- type: 'array',
- items: {
- '$ref': '#/components/schemas/ModelWithReadOnlyAndWriteOnly'
- }
- },
- propWithFile: {
- type: 'array',
- items: {
- type: 'file'
- }
- },
- propWithNumber: {
- type: 'array',
- items: {
- type: 'number'
- }
- }
- }
-} as const;
-
-export const $ModelWithArray = {
- description: 'This is a model with one property containing an array',
- type: 'object',
- properties: {
- prop: {
- type: 'array',
- items: {
- '$ref': '#/components/schemas/ModelWithString'
- }
- },
- propWithFile: {
- type: 'array',
- items: {
- type: 'file'
- }
- },
- propWithNumber: {
- type: 'array',
- items: {
- type: 'number'
- }
- }
- }
-} as const;
-
-export const $ModelWithDictionary = {
- description: 'This is a model with one property containing a dictionary',
- type: 'object',
- properties: {
- prop: {
- type: 'object',
- additionalProperties: {
- type: 'string'
- }
- }
- }
-} as const;
-
-export const $DeprecatedModel = {
- deprecated: true,
- description: 'This is a deprecated model with a deprecated property',
- type: 'object',
- properties: {
- prop: {
- deprecated: true,
- description: 'This is a deprecated property',
- type: 'string'
- }
- }
-} as const;
-
-export const $ModelWithCircularReference = {
- description: 'This is a model with one property containing a circular reference',
- type: 'object',
- properties: {
- prop: {
- '$ref': '#/components/schemas/ModelWithCircularReference'
- }
- }
-} as const;
-
-export const $CompositionWithOneOf = {
- description: "This is a model with one property with a 'one of' relationship",
- type: 'object',
- properties: {
- propA: {
- type: 'object',
- oneOf: [
- {
- '$ref': '#/components/schemas/ModelWithString'
- },
- {
- '$ref': '#/components/schemas/ModelWithEnum'
- },
- {
- '$ref': '#/components/schemas/ModelWithArray'
- },
- {
- '$ref': '#/components/schemas/ModelWithDictionary'
- }
- ]
- }
- }
-} as const;
-
-export const $CompositionWithOneOfAnonymous = {
- description: "This is a model with one property with a 'one of' relationship where the options are not $ref",
- type: 'object',
- properties: {
- propA: {
- type: 'object',
- oneOf: [
- {
- description: 'Anonymous object type',
- type: 'object',
- properties: {
- propA: {
- type: 'string'
- }
- }
- },
- {
- description: 'Anonymous string type',
- type: 'string'
- },
- {
- description: 'Anonymous integer type',
- type: 'integer'
- }
- ]
- }
- }
-} as const;
-
-export const $ModelCircle = {
- description: 'Circle',
- type: 'object',
- required: ['kind'],
- properties: {
- kind: {
- type: 'string'
- },
- radius: {
- type: 'number'
- }
- }
-} as const;
-
-export const $ModelSquare = {
- description: 'Square',
- type: 'object',
- required: ['kind'],
- properties: {
- kind: {
- type: 'string'
- },
- sideLength: {
- type: 'number'
- }
- }
-} as const;
-
-export const $CompositionWithOneOfDiscriminator = {
- description: "This is a model with one property with a 'one of' relationship where the options are not $ref",
- type: 'object',
- oneOf: [
- {
- '$ref': '#/components/schemas/ModelCircle'
- },
- {
- '$ref': '#/components/schemas/ModelSquare'
- }
- ],
- discriminator: {
- propertyName: 'kind',
- mapping: {
- circle: '#/components/schemas/ModelCircle',
- square: '#/components/schemas/ModelSquare'
- }
- }
-} as const;
-
-export const $CompositionWithAnyOf = {
- description: "This is a model with one property with a 'any of' relationship",
- type: 'object',
- properties: {
- propA: {
- type: 'object',
- anyOf: [
- {
- '$ref': '#/components/schemas/ModelWithString'
- },
- {
- '$ref': '#/components/schemas/ModelWithEnum'
- },
- {
- '$ref': '#/components/schemas/ModelWithArray'
- },
- {
- '$ref': '#/components/schemas/ModelWithDictionary'
- }
- ]
- }
- }
-} as const;
-
-export const $CompositionWithAnyOfAnonymous = {
- description: "This is a model with one property with a 'any of' relationship where the options are not $ref",
- type: 'object',
- properties: {
- propA: {
- type: 'object',
- anyOf: [
- {
- description: 'Anonymous object type',
- type: 'object',
- properties: {
- propA: {
- type: 'string'
- }
- }
- },
- {
- description: 'Anonymous string type',
- type: 'string'
- },
- {
- description: 'Anonymous integer type',
- type: 'integer'
- }
- ]
- }
- }
-} as const;
-
-export const $CompositionWithNestedAnyAndTypeNull = {
- description: "This is a model with nested 'any of' property with a type null",
- type: 'object',
- properties: {
- propA: {
- type: 'object',
- anyOf: [
- {
- items: {
- anyOf: [
- {
- '$ref': '#/components/schemas/ModelWithDictionary'
- },
- {
- type: 'null'
- }
- ]
- },
- type: 'array'
- },
- {
- items: {
- anyOf: [
- {
- '$ref': '#/components/schemas/ModelWithArray'
- },
- {
- type: 'null'
- }
- ]
- },
- type: 'array'
- }
- ]
- }
- }
-} as const;
-
-export const $3e_num_1Период = {
- enum: ['Bird', 'Dog'],
- type: 'string'
-} as const;
-
-export const $ConstValue = {
- type: 'string',
- const: 'ConstValue'
-} as const;
-
-export const $CompositionWithNestedAnyOfAndNull = {
- description: "This is a model with one property with a 'any of' relationship where the options are not $ref",
- type: 'object',
- properties: {
- propA: {
- anyOf: [
- {
- items: {
- anyOf: [
- {
- '$ref': '#/components/schemas/3e-num_1Период'
- },
- {
- '$ref': '#/components/schemas/ConstValue'
- }
- ]
- },
- type: 'array'
- },
- {
- type: 'null'
- }
- ],
- title: 'Scopes'
- }
- }
-} as const;
-
-export const $CompositionWithOneOfAndNullable = {
- description: "This is a model with one property with a 'one of' relationship",
- type: 'object',
- properties: {
- propA: {
- nullable: true,
- type: 'object',
- oneOf: [
- {
- type: 'object',
- properties: {
- boolean: {
- type: 'boolean'
- }
- }
- },
- {
- '$ref': '#/components/schemas/ModelWithEnum'
- },
- {
- '$ref': '#/components/schemas/ModelWithArray'
- },
- {
- '$ref': '#/components/schemas/ModelWithDictionary'
- }
- ]
- }
- }
-} as const;
-
-export const $CompositionWithOneOfAndSimpleDictionary = {
- description: 'This is a model that contains a simple dictionary within composition',
- type: 'object',
- properties: {
- propA: {
- oneOf: [
- {
- type: 'boolean'
- },
- {
- type: 'object',
- additionalProperties: {
- type: 'number'
- }
- }
- ]
- }
- }
-} as const;
-
-export const $CompositionWithOneOfAndSimpleArrayDictionary = {
- description: 'This is a model that contains a dictionary of simple arrays within composition',
- type: 'object',
- properties: {
- propA: {
- oneOf: [
- {
- type: 'boolean'
- },
- {
- type: 'object',
- additionalProperties: {
- type: 'array',
- items: {
- type: 'boolean'
- }
- }
- }
- ]
- }
- }
-} as const;
-
-export const $CompositionWithOneOfAndComplexArrayDictionary = {
- description: 'This is a model that contains a dictionary of complex arrays (composited) within composition',
- type: 'object',
- properties: {
- propA: {
- oneOf: [
- {
- type: 'boolean'
- },
- {
- type: 'object',
- additionalProperties: {
- type: 'array',
- items: {
- oneOf: [
- {
- type: 'number'
- },
- {
- type: 'string'
- }
- ]
- }
- }
- }
- ]
- }
- }
-} as const;
-
-export const $CompositionWithAllOfAndNullable = {
- description: "This is a model with one property with a 'all of' relationship",
- type: 'object',
- properties: {
- propA: {
- nullable: true,
- type: 'object',
- allOf: [
- {
- type: 'object',
- properties: {
- boolean: {
- type: 'boolean'
- }
- }
- },
- {
- '$ref': '#/components/schemas/ModelWithEnum'
- },
- {
- '$ref': '#/components/schemas/ModelWithArray'
- },
- {
- '$ref': '#/components/schemas/ModelWithDictionary'
- }
- ]
- }
- }
-} as const;
-
-export const $CompositionWithAnyOfAndNullable = {
- description: "This is a model with one property with a 'any of' relationship",
- type: 'object',
- properties: {
- propA: {
- nullable: true,
- type: 'object',
- anyOf: [
- {
- type: 'object',
- properties: {
- boolean: {
- type: 'boolean'
- }
- }
- },
- {
- '$ref': '#/components/schemas/ModelWithEnum'
- },
- {
- '$ref': '#/components/schemas/ModelWithArray'
- },
- {
- '$ref': '#/components/schemas/ModelWithDictionary'
- }
- ]
- }
- }
-} as const;
-
-export const $CompositionBaseModel = {
- description: 'This is a base model with two simple optional properties',
- type: 'object',
- properties: {
- firstName: {
- type: 'string'
- },
- lastname: {
- type: 'string'
- }
- }
-} as const;
-
-export const $CompositionExtendedModel = {
- description: 'This is a model that extends the base model',
- type: 'object',
- allOf: [
- {
- '$ref': '#/components/schemas/CompositionBaseModel'
- }
- ],
- properties: {
- age: {
- type: 'number'
- }
- },
- required: ['firstName', 'lastname', 'age']
-} as const;
-
-export const $ModelWithProperties = {
- description: 'This is a model with one nested property',
- type: 'object',
- required: ['required', 'requiredAndReadOnly', 'requiredAndNullable'],
- properties: {
- required: {
- type: 'string'
- },
- requiredAndReadOnly: {
- type: 'string',
- readOnly: true
- },
- requiredAndNullable: {
- type: 'string',
- nullable: true
- },
- string: {
- type: 'string'
- },
- number: {
- type: 'number'
- },
- boolean: {
- type: 'boolean'
- },
- reference: {
- '$ref': '#/components/schemas/ModelWithString'
- },
- 'property with space': {
- type: 'string'
- },
- default: {
- type: 'string'
- },
- try: {
- type: 'string'
- },
- '@namespace.string': {
- type: 'string',
- readOnly: true
- },
- '@namespace.integer': {
- type: 'integer',
- readOnly: true
- }
- }
-} as const;
-
-export const $ModelWithNestedProperties = {
- description: 'This is a model with one nested property',
- type: 'object',
- required: ['first'],
- properties: {
- first: {
- type: 'object',
- required: ['second'],
- readOnly: true,
- nullable: true,
- properties: {
- second: {
- type: 'object',
- required: ['third'],
- readOnly: true,
- nullable: true,
- properties: {
- third: {
- type: 'string',
- required: true,
- readOnly: true,
- nullable: true
- }
- }
- }
- }
- }
- }
-} as const;
-
-export const $ModelWithDuplicateProperties = {
- description: 'This is a model with duplicated properties',
- type: 'object',
- properties: {
- prop: {
- '$ref': '#/components/schemas/ModelWithString'
- }
- }
-} as const;
-
-export const $ModelWithOrderedProperties = {
- description: 'This is a model with ordered properties',
- type: 'object',
- properties: {
- zebra: {
- type: 'string'
- },
- apple: {
- type: 'string'
- },
- hawaii: {
- type: 'string'
- }
- }
-} as const;
-
-export const $ModelWithDuplicateImports = {
- description: 'This is a model with duplicated imports',
- type: 'object',
- properties: {
- propA: {
- '$ref': '#/components/schemas/ModelWithString'
- },
- propB: {
- '$ref': '#/components/schemas/ModelWithString'
- },
- propC: {
- '$ref': '#/components/schemas/ModelWithString'
- }
- }
-} as const;
-
-export const $ModelThatExtends = {
- description: 'This is a model that extends another model',
- type: 'object',
- allOf: [
- {
- '$ref': '#/components/schemas/ModelWithString'
- },
- {
- type: 'object',
- properties: {
- propExtendsA: {
- type: 'string'
- },
- propExtendsB: {
- '$ref': '#/components/schemas/ModelWithString'
- }
- }
- }
- ]
-} as const;
-
-export const $ModelThatExtendsExtends = {
- description: 'This is a model that extends another model',
- type: 'object',
- allOf: [
- {
- '$ref': '#/components/schemas/ModelWithString'
- },
- {
- '$ref': '#/components/schemas/ModelThatExtends'
- },
- {
- type: 'object',
- properties: {
- propExtendsC: {
- type: 'string'
- },
- propExtendsD: {
- '$ref': '#/components/schemas/ModelWithString'
- }
- }
- }
- ]
-} as const;
-
-export const $ModelWithPattern = {
- description: 'This is a model that contains a some patterns',
- type: 'object',
- required: ['key', 'name'],
- properties: {
- key: {
- maxLength: 64,
- pattern: '^[a-zA-Z0-9_]*$',
- type: 'string'
- },
- name: {
- maxLength: 255,
- type: 'string'
- },
- enabled: {
- type: 'boolean',
- readOnly: true
- },
- modified: {
- type: 'string',
- format: 'date-time',
- readOnly: true
- },
- id: {
- type: 'string',
- pattern: '^\\d{2}-\\d{3}-\\d{4}$'
- },
- text: {
- type: 'string',
- pattern: '^\\w+$'
- },
- patternWithSingleQuotes: {
- type: 'string',
- pattern: "^[a-zA-Z0-9']*$"
- },
- patternWithNewline: {
- type: 'string',
- pattern: 'aaa\\nbbb'
- },
- patternWithBacktick: {
- type: 'string',
- pattern: 'aaa`bbb'
- }
- }
-} as const;
-
-export const $File = {
- required: ['mime'],
- type: 'object',
- properties: {
- id: {
- title: 'Id',
- type: 'string',
- readOnly: true,
- minLength: 1
- },
- updated_at: {
- title: 'Updated at',
- type: 'string',
- format: 'date-time',
- readOnly: true
- },
- created_at: {
- title: 'Created at',
- type: 'string',
- format: 'date-time',
- readOnly: true
- },
- mime: {
- title: 'Mime',
- type: 'string',
- maxLength: 24,
- minLength: 1
- },
- file: {
- title: 'File',
- type: 'string',
- readOnly: true,
- format: 'uri'
- }
- }
-} as const;
-
-export const $default = {
- type: 'object',
- properties: {
- name: {
- type: 'string'
- }
- }
-} as const;
-
-export const $Pageable = {
- type: 'object',
- properties: {
- page: {
- minimum: 0,
- type: 'integer',
- format: 'int32',
- default: 0
- },
- size: {
- minimum: 1,
- type: 'integer',
- format: 'int32'
- },
- sort: {
- type: 'array',
- items: {
- type: 'string'
- }
- }
- }
-} as const;
-
-export const $FreeFormObjectWithoutAdditionalProperties = {
- description: 'This is a free-form object without additionalProperties.',
- type: 'object'
-} as const;
-
-export const $FreeFormObjectWithAdditionalPropertiesEqTrue = {
- description: 'This is a free-form object with additionalProperties: true.',
- type: 'object',
- additionalProperties: true
-} as const;
-
-export const $FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {
- description: 'This is a free-form object with additionalProperties: {}.',
- type: 'object',
- additionalProperties: {}
-} as const;
-
-export const $ModelWithConst = {
- type: 'object',
- properties: {
- String: {
- const: 'String'
- },
- number: {
- const: 0
- },
- null: {
- const: null
- },
- withType: {
- type: 'string',
- const: 'Some string'
- }
- }
-} as const;
-
-export const $ModelWithAdditionalPropertiesEqTrue = {
- description: 'This is a model with one property and additionalProperties: true',
- type: 'object',
- properties: {
- prop: {
- description: 'This is a simple string property',
- type: 'string'
- }
- },
- additionalProperties: true
-} as const;
-
-export const $NestedAnyOfArraysNullable = {
- properties: {
- nullableArray: {
- anyOf: [
- {
- items: {
- anyOf: [
- {
- type: 'string'
- },
- {
- type: 'boolean'
- }
- ]
- },
- type: 'array'
- },
- {
- type: 'null'
- }
- ]
- }
- },
- type: 'object'
-} as const;
-
-export const $CompositionWithOneOfAndProperties = {
- type: 'object',
- oneOf: [
- {
- type: 'object',
- required: ['foo'],
- properties: {
- foo: {
- '$ref': '#/components/parameters/SimpleParameter'
- }
- },
- additionalProperties: false
- },
- {
- type: 'object',
- required: ['bar'],
- properties: {
- bar: {
- '$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串'
- }
- },
- additionalProperties: false
- }
- ],
- required: ['baz', 'qux'],
- properties: {
- baz: {
- type: 'integer',
- format: 'uint16',
- minimum: 0,
- nullable: true
- },
- qux: {
- type: 'integer',
- format: 'uint8',
- minimum: 0
- }
- }
-} as const;
-
-export const $NullableObject = {
- type: ['object', 'null'],
- description: 'An object that can be null',
- properties: {
- foo: {
- type: 'string'
- }
- },
- default: null
-} as const;
-
-export const $CharactersInDescription = {
- type: 'string',
- description: 'Some % character'
-} as const;
-
-export const $ModelWithNullableObject = {
- type: 'object',
- properties: {
- data: {
- '$ref': '#/components/schemas/NullableObject'
- }
- }
-} as const;
-
-export const $ModelWithOneOfEnum = {
- oneOf: [
- {
- type: 'object',
- required: ['foo'],
- properties: {
- foo: {
- type: 'string',
- enum: ['Bar']
- }
- }
- },
- {
- type: 'object',
- required: ['foo'],
- properties: {
- foo: {
- type: 'string',
- enum: ['Baz']
- }
- }
- },
- {
- type: 'object',
- required: ['foo'],
- properties: {
- foo: {
- type: 'string',
- enum: ['Qux']
- }
- }
- },
- {
- type: 'object',
- required: ['content', 'foo'],
- properties: {
- content: {
- type: 'string',
- format: 'date-time'
- },
- foo: {
- type: 'string',
- enum: ['Quux']
- }
- }
- },
- {
- type: 'object',
- required: ['content', 'foo'],
- properties: {
- content: {
- type: 'array',
- items: [
- {
- type: 'string',
- format: 'date-time'
- },
- {
- type: 'string'
- }
- ],
- maxItems: 2,
- minItems: 2
- },
- foo: {
- type: 'string',
- enum: ['Corge']
- }
- }
- }
- ]
-} as const;
-
-export const $ModelWithNestedArrayEnumsDataFoo = {
- enum: ['foo', 'bar'],
- type: 'string'
-} as const;
-
-export const $ModelWithNestedArrayEnumsDataBar = {
- enum: ['baz', 'qux'],
- type: 'string'
-} as const;
-
-export const $ModelWithNestedArrayEnumsData = {
- type: 'object',
- properties: {
- foo: {
- type: 'array',
- items: {
- '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo'
- }
- },
- bar: {
- type: 'array',
- items: {
- '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataBar'
- }
- }
- }
-} as const;
-
-export const $ModelWithNestedArrayEnums = {
- type: 'object',
- properties: {
- array_strings: {
- type: 'array',
- items: {
- type: 'string'
- }
- },
- data: {
- allOf: [
- {
- '$ref': '#/components/schemas/ModelWithNestedArrayEnumsData'
- }
- ]
- }
- }
-} as const;
-
-export const $ModelWithNestedCompositionEnums = {
- type: 'object',
- properties: {
- foo: {
- allOf: [
- {
- '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo'
- }
- ]
- }
- }
-} as const;
-
-export const $ModelWithReadOnlyAndWriteOnly = {
- type: 'object',
- required: ['foo', 'bar', 'baz'],
- properties: {
- foo: {
- type: 'string'
- },
- bar: {
- readOnly: true,
- type: 'string'
- },
- baz: {
- type: 'string',
- writeOnly: true
- }
- }
-} as const;
-
-export const $ModelWithConstantSizeArray = {
- type: 'array',
- items: {
- type: 'number'
- },
- minItems: 2,
- maxItems: 2
-} as const;
-
-export const $ModelWithAnyOfConstantSizeArray = {
- type: 'array',
- items: {
- oneOf: [
- {
- type: 'number'
- },
- {
- type: 'string'
- }
- ]
- },
- minItems: 3,
- maxItems: 3
-} as const;
-
-export const $ModelWithPrefixItemsConstantSizeArray = {
- type: 'array',
- prefixItems: [
- {
- '$ref': '#/components/schemas/ModelWithInteger'
- },
- {
- oneOf: [
- {
- type: 'number'
- },
- {
- type: 'string'
- }
- ]
- },
- {
- type: 'string'
- }
- ]
-} as const;
-
-export const $ModelWithAnyOfConstantSizeArrayNullable = {
- type: ['array'],
- items: {
- oneOf: [
- {
- type: 'number',
- nullable: true
- },
- {
- type: 'string'
- }
- ]
- },
- minItems: 3,
- maxItems: 3
-} as const;
-
-export const $ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = {
- type: 'array',
- items: {
- oneOf: [
- {
- type: 'number'
- },
- {
- '$ref': '#/components/schemas/import'
- }
- ]
- },
- minItems: 2,
- maxItems: 2
-} as const;
-
-export const $ModelWithAnyOfConstantSizeArrayAndIntersect = {
- type: 'array',
- items: {
- allOf: [
- {
- type: 'number'
- },
- {
- type: 'string'
- }
- ]
- },
- minItems: 2,
- maxItems: 2
-} as const;
-
-export const $ModelWithNumericEnumUnion = {
- type: 'object',
- properties: {
- value: {
- type: 'number',
- description: 'Период',
- enum: [-10, -1, 0, 1, 3, 6, 12]
- }
- }
-} as const;
-
-export const $ModelWithBackticksInDescription = {
- description: 'Some description with `back ticks`',
- type: 'object',
- properties: {
- template: {
- type: 'string',
- description: `The template \`that\` should be used for parsing and importing the contents of the CSV file.
-
-
There is one placeholder currently supported:
- \${x} - refers to the n-th column in the CSV file, e.g. \${1}, \${2}, ...)
Example of a correct JSON template:
-
-[
- {
- "resourceType": "Asset",
- "identifier": {
- "name": "\${1}",
- "domain": {
- "name": "\${2}",
- "community": {
- "name": "Some Community"
- }
- }
- },
- "attributes" : {
- "00000000-0000-0000-0000-000000003115" : [ {
- "value" : "\${3}"
- } ],
- "00000000-0000-0000-0000-000000000222" : [ {
- "value" : "\${4}"
- } ]
- }
- }
-]
-`
- }
- }
-} as const;
-
-export const $ModelWithOneOfAndProperties = {
- type: 'object',
- oneOf: [
- {
- '$ref': '#/components/parameters/SimpleParameter'
- },
- {
- '$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串'
- }
- ],
- required: ['baz', 'qux'],
- properties: {
- baz: {
- type: 'integer',
- format: 'uint16',
- minimum: 0,
- nullable: true
- },
- qux: {
- type: 'integer',
- format: 'uint8',
- minimum: 0
- }
- }
-} as const;
-
-export const $ParameterSimpleParameterUnused = {
- description: 'Model used to test deduplication strategy (unused)',
- type: 'string'
-} as const;
-
-export const $PostServiceWithEmptyTagResponse = {
- description: 'Model used to test deduplication strategy',
- type: 'string'
-} as const;
-
-export const $PostServiceWithEmptyTagResponse2 = {
- description: 'Model used to test deduplication strategy',
- type: 'string'
-} as const;
-
-export const $DeleteFooData = {
- description: 'Model used to test deduplication strategy',
- type: 'string'
-} as const;
-
-export const $DeleteFooData2 = {
- description: 'Model used to test deduplication strategy',
- type: 'string'
-} as const;
-
-export const $import = {
- description: 'Model with restricted keyword name',
- type: 'string'
-} as const;
-
-export const $SchemaWithFormRestrictedKeys = {
- properties: {
- description: {
- type: 'string'
- },
- 'x-enum-descriptions': {
- type: 'string'
- },
- 'x-enum-varnames': {
- type: 'string'
- },
- 'x-enumNames': {
- type: 'string'
- },
- title: {
- type: 'string'
- },
- object: {
- type: 'object',
- properties: {
- description: {
- type: 'string'
- },
- 'x-enum-descriptions': {
- type: 'string'
- },
- 'x-enum-varnames': {
- type: 'string'
- },
- 'x-enumNames': {
- type: 'string'
- },
- title: {
- type: 'string'
- }
- }
- },
- array: {
- type: 'array',
- items: [
- {
- type: 'object',
- properties: {
- description: {
- type: 'string'
- },
- 'x-enum-descriptions': {
- type: 'string'
- },
- 'x-enum-varnames': {
- type: 'string'
- },
- 'x-enumNames': {
- type: 'string'
- },
- title: {
- type: 'string'
- }
- }
- }
- ]
- }
- }
-} as const;
-
-export const $io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = {
- description: 'This schema was giving PascalCase transformations a hard time',
- properties: {
- preconditions: {
- allOf: [
- {
- '$ref': '#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions'
- }
- ],
- description: 'Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.'
- }
- },
- type: 'object'
-} as const;
-
-export const $io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = {
- description: 'This schema was giving PascalCase transformations a hard time',
- properties: {
- resourceVersion: {
- description: 'Specifies the target ResourceVersion',
- type: 'string'
- },
- uid: {
- description: 'Specifies the target UID.',
- type: 'string'
- }
- },
- type: 'object'
-} as const;
-
-export const $AdditionalPropertiesUnknownIssue = {
- type: 'object',
- properties: {},
- additionalProperties: {
- anyOf: [
- {
- type: 'string'
- },
- {
- type: 'number'
- }
- ]
- }
-} as const;
-
-export const $AdditionalPropertiesUnknownIssue2 = {
- type: 'object',
- additionalProperties: {
- anyOf: [
- {
- type: 'string'
- },
- {
- type: 'number'
- }
- ]
- }
-} as const;
-
-export const $AdditionalPropertiesUnknownIssue3 = {
- type: 'object',
- allOf: [
- {
- type: 'string'
- },
- {
- type: 'object',
- required: ['entries'],
- properties: {
- entries: {
- additionalProperties: {
- '$ref': '#/components/schemas/AdditionalPropertiesUnknownIssue'
- }
- }
- }
- }
- ]
-} as const;
-
-export const $AdditionalPropertiesIntegerIssue = {
- type: 'object',
- required: ['value'],
- properties: {
- value: {
- type: 'integer'
- }
- },
- additionalProperties: {
- type: 'integer'
- }
-} as const;
-
-export const $OneOfAllOfIssue = {
- oneOf: [
- {
- allOf: [
- {
- oneOf: [
- {
- '$ref': '#/components/schemas/ConstValue'
- },
- {
- '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]'
- }
- ]
- },
- {
- '$ref': '#/components/schemas/3e-num_1Период'
- }
- ]
- },
- {
- '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]'
- }
- ]
-} as const;
-
-export const $Generic_Schema_Duplicate_Issue_1_System_Boolean_ = {
- type: 'object',
- properties: {
- item: {
- type: 'boolean'
- },
- error: {
- type: 'string',
- nullable: true
- },
- hasError: {
- type: 'boolean',
- readOnly: true
- },
- data: {
- type: 'object',
- properties: {},
- additionalProperties: false
- }
- },
- additionalProperties: false
-} as const;
-
-export const $Generic_Schema_Duplicate_Issue_1_System_String_ = {
- type: 'object',
- properties: {
- item: {
- type: 'string',
- nullable: true
- },
- error: {
- type: 'string',
- nullable: true
- },
- hasError: {
- type: 'boolean',
- readOnly: true
- }
- },
- additionalProperties: false
-} as const;
diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3-types-PascalCase/index.ts.snap b/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3-types-PascalCase/index.ts.snap
deleted file mode 100644
index b43a5238d8..0000000000
--- a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3-types-PascalCase/index.ts.snap
+++ /dev/null
@@ -1,3 +0,0 @@
-// This file is auto-generated by @hey-api/openapi-ts
-
-export type * from './types.gen';
diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3-types-PascalCase/types.gen.ts.snap b/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3-types-PascalCase/types.gen.ts.snap
deleted file mode 100644
index f350f691fb..0000000000
--- a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3-types-PascalCase/types.gen.ts.snap
+++ /dev/null
@@ -1,1996 +0,0 @@
-// This file is auto-generated by @hey-api/openapi-ts
-
-export type ClientOptions = {
- baseUrl: 'http://localhost:3000/base' | (string & {});
-};
-
-/**
- * Model with number-only name
- */
-export type _400 = string;
-
-/**
- * Testing multiline comments in string: First line
- * Second line
- *
- * Fourth line
- */
-export type CamelCaseCommentWithBreaks = number;
-
-/**
- * Testing multiline comments in string: First line
- * Second line
- *
- * Fourth line
- */
-export type CommentWithBreaks = number;
-
-/**
- * Testing backticks in string: `backticks` and ```multiple backticks``` should work
- */
-export type CommentWithBackticks = number;
-
-/**
- * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work
- */
-export type CommentWithBackticksAndQuotes = number;
-
-/**
- * Testing slashes in string: \backwards\\\ and /forwards/// should work
- */
-export type CommentWithSlashes = number;
-
-/**
- * Testing expression placeholders in string: ${expression} should work
- */
-export type CommentWithExpressionPlaceholders = number;
-
-/**
- * Testing quotes in string: 'single quote''' and "double quotes""" should work
- */
-export type CommentWithQuotes = number;
-
-/**
- * Testing reserved characters in string: * inline * and ** inline ** should work
- */
-export type CommentWithReservedCharacters = number;
-
-/**
- * This is a simple number
- */
-export type SimpleInteger = number;
-
-/**
- * This is a simple boolean
- */
-export type SimpleBoolean = boolean;
-
-/**
- * This is a simple string
- */
-export type SimpleString = string;
-
-/**
- * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串)
- */
-export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string;
-
-/**
- * This is a simple file
- */
-export type SimpleFile = unknown;
-
-/**
- * This is a simple reference
- */
-export type SimpleReference = ModelWithString;
-
-/**
- * This is a simple string
- */
-export type SimpleStringWithPattern = string;
-
-/**
- * This is a simple enum with strings
- */
-export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串';
-
-export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | '';
-
-/**
- * This is a simple enum with numbers
- */
-export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3;
-
-/**
- * Success=1,Warning=2,Error=3
- */
-export type EnumFromDescription = number;
-
-/**
- * This is a simple enum with numbers
- */
-export type EnumWithExtensions = 200 | 400 | 500;
-
-export type EnumWithXEnumNames = 0 | 1 | 2;
-
-/**
- * This is a simple array with numbers
- */
-export type ArrayWithNumbers = Array;
-
-/**
- * This is a simple array with booleans
- */
-export type ArrayWithBooleans = Array;
-
-/**
- * This is a simple array with strings
- */
-export type ArrayWithStrings = Array;
-
-/**
- * This is a simple array with references
- */
-export type ArrayWithReferences = Array;
-
-/**
- * This is a simple array containing an array
- */
-export type ArrayWithArray = Array>;
-
-/**
- * This is a simple array with properties
- */
-export type ArrayWithProperties = Array<{
- '16x16'?: CamelCaseCommentWithBreaks;
- bar?: string;
-}>;
-
-/**
- * This is a simple array with any of properties
- */
-export type ArrayWithAnyOfProperties = Array<{
- foo?: string;
-} | {
- bar?: string;
-}>;
-
-export type AnyOfAnyAndNull = {
- data?: unknown | null;
-};
-
-/**
- * This is a simple array with any of properties
- */
-export type AnyOfArrays = {
- results?: Array<{
- foo?: string;
- } | {
- bar?: string;
- }>;
-};
-
-/**
- * This is a string dictionary
- */
-export type DictionaryWithString = {
- [key: string]: string;
-};
-
-export type DictionaryWithPropertiesAndAdditionalProperties = {
- foo?: number;
- bar?: boolean;
- [key: string]: string | number | boolean | undefined;
-};
-
-/**
- * This is a string reference
- */
-export type DictionaryWithReference = {
- [key: string]: ModelWithString;
-};
-
-/**
- * This is a complex dictionary
- */
-export type DictionaryWithArray = {
- [key: string]: Array;
-};
-
-/**
- * This is a string dictionary
- */
-export type DictionaryWithDictionary = {
- [key: string]: {
- [key: string]: string;
- };
-};
-
-/**
- * This is a complex dictionary
- */
-export type DictionaryWithProperties = {
- [key: string]: {
- foo?: string;
- bar?: string;
- };
-};
-
-/**
- * This is a model with one number property
- */
-export type ModelWithInteger = {
- /**
- * This is a simple number property
- */
- prop?: number;
-};
-
-/**
- * This is a model with one boolean property
- */
-export type ModelWithBoolean = {
- /**
- * This is a simple boolean property
- */
- prop?: boolean;
-};
-
-/**
- * This is a model with one string property
- */
-export type ModelWithString = {
- /**
- * This is a simple string property
- */
- prop?: string;
-};
-
-/**
- * This is a model with one string property
- */
-export type ModelWithStringError = {
- /**
- * This is a simple string property
- */
- prop?: string;
-};
-
-/**
- * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets)
- */
-export type ModelFromZendesk = string;
-
-/**
- * This is a model with one string property
- */
-export type ModelWithNullableString = {
- /**
- * This is a simple string property
- */
- nullableProp1?: string;
- /**
- * This is a simple string property
- */
- nullableRequiredProp1: string;
- /**
- * This is a simple string property
- */
- nullableProp2?: string | null;
- /**
- * This is a simple string property
- */
- nullableRequiredProp2: string | null;
- /**
- * This is a simple enum with strings
- */
- 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串';
-};
-
-/**
- * This is a model with one enum
- */
-export type ModelWithEnum = {
- /**
- * This is a simple enum with strings
- */
- 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串';
- /**
- * These are the HTTP error code enums
- */
- statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar';
- /**
- * Simple boolean enum
- */
- bool?: true;
-};
-
-/**
- * This is a model with one enum with escaped name
- */
-export type ModelWithEnumWithHyphen = {
- /**
- * Foo-Bar-Baz-Qux
- */
- 'foo-bar-baz-qux'?: '3.0';
-};
-
-/**
- * This is a model with one enum
- */
-export type ModelWithEnumFromDescription = {
- /**
- * Success=1,Warning=2,Error=3
- */
- test?: number;
-};
-
-/**
- * This is a model with nested enums
- */
-export type ModelWithNestedEnums = {
- dictionaryWithEnum?: {
- [key: string]: 'Success' | 'Warning' | 'Error';
- };
- dictionaryWithEnumFromDescription?: {
- [key: string]: number;
- };
- arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>;
- arrayWithDescription?: Array;
- /**
- * This is a simple enum with strings
- */
- 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串';
-};
-
-/**
- * This is a model with one property containing a reference
- */
-export type ModelWithReference = {
- prop?: ModelWithProperties;
-};
-
-/**
- * This is a model with one property containing an array
- */
-export type ModelWithArrayReadOnlyAndWriteOnly = {
- prop?: Array;
- propWithFile?: Array;
- propWithNumber?: Array;
-};
-
-/**
- * This is a model with one property containing an array
- */
-export type ModelWithArray = {
- prop?: Array;
- propWithFile?: Array;
- propWithNumber?: Array;
-};
-
-/**
- * This is a model with one property containing a dictionary
- */
-export type ModelWithDictionary = {
- prop?: {
- [key: string]: string;
- };
-};
-
-/**
- * This is a deprecated model with a deprecated property
- *
- * @deprecated
- */
-export type DeprecatedModel = {
- /**
- * This is a deprecated property
- *
- * @deprecated
- */
- prop?: string;
-};
-
-/**
- * This is a model with one property containing a circular reference
- */
-export type ModelWithCircularReference = {
- prop?: ModelWithCircularReference;
-};
-
-/**
- * This is a model with one property with a 'one of' relationship
- */
-export type CompositionWithOneOf = {
- propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary;
-};
-
-/**
- * This is a model with one property with a 'one of' relationship where the options are not $ref
- */
-export type CompositionWithOneOfAnonymous = {
- propA?: {
- propA?: string;
- } | string | number;
-};
-
-/**
- * Circle
- */
-export type ModelCircle = {
- kind: string;
- radius?: number;
-};
-
-/**
- * Square
- */
-export type ModelSquare = {
- kind: string;
- sideLength?: number;
-};
-
-/**
- * This is a model with one property with a 'one of' relationship where the options are not $ref
- */
-export type CompositionWithOneOfDiscriminator = ({
- kind: 'circle';
-} & ModelCircle) | ({
- kind: 'square';
-} & ModelSquare);
-
-/**
- * This is a model with one property with a 'any of' relationship
- */
-export type CompositionWithAnyOf = {
- propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary;
-};
-
-/**
- * This is a model with one property with a 'any of' relationship where the options are not $ref
- */
-export type CompositionWithAnyOfAnonymous = {
- propA?: {
- propA?: string;
- } | string | number;
-};
-
-/**
- * This is a model with nested 'any of' property with a type null
- */
-export type CompositionWithNestedAnyAndTypeNull = {
- propA?: Array | Array;
-};
-
-export type _3eNum1Период = 'Bird' | 'Dog';
-
-export type ConstValue = 'ConstValue';
-
-/**
- * This is a model with one property with a 'any of' relationship where the options are not $ref
- */
-export type CompositionWithNestedAnyOfAndNull = {
- /**
- * Scopes
- */
- propA?: Array<_3eNum1Период | ConstValue> | null;
-};
-
-/**
- * This is a model with one property with a 'one of' relationship
- */
-export type CompositionWithOneOfAndNullable = {
- propA?: {
- boolean?: boolean;
- } | ModelWithEnum | ModelWithArray | ModelWithDictionary;
-};
-
-/**
- * This is a model that contains a simple dictionary within composition
- */
-export type CompositionWithOneOfAndSimpleDictionary = {
- propA?: boolean | {
- [key: string]: number;
- };
-};
-
-/**
- * This is a model that contains a dictionary of simple arrays within composition
- */
-export type CompositionWithOneOfAndSimpleArrayDictionary = {
- propA?: boolean | {
- [key: string]: Array;
- };
-};
-
-/**
- * This is a model that contains a dictionary of complex arrays (composited) within composition
- */
-export type CompositionWithOneOfAndComplexArrayDictionary = {
- propA?: boolean | {
- [key: string]: Array;
- };
-};
-
-/**
- * This is a model with one property with a 'all of' relationship
- */
-export type CompositionWithAllOfAndNullable = {
- propA?: {
- boolean?: boolean;
- } & ModelWithEnum & ModelWithArray & ModelWithDictionary;
-};
-
-/**
- * This is a model with one property with a 'any of' relationship
- */
-export type CompositionWithAnyOfAndNullable = {
- propA?: {
- boolean?: boolean;
- } | ModelWithEnum | ModelWithArray | ModelWithDictionary;
-};
-
-/**
- * This is a base model with two simple optional properties
- */
-export type CompositionBaseModel = {
- firstName?: string;
- lastname?: string;
-};
-
-/**
- * This is a model that extends the base model
- */
-export type CompositionExtendedModel = CompositionBaseModel & {
- age: number;
- firstName: string;
- lastname: string;
-};
-
-/**
- * This is a model with one nested property
- */
-export type ModelWithProperties = {
- required: string;
- readonly requiredAndReadOnly: string;
- requiredAndNullable: string;
- string?: string;
- number?: number;
- boolean?: boolean;
- reference?: ModelWithString;
- 'property with space'?: string;
- default?: string;
- try?: string;
- readonly '@namespace.string'?: string;
- readonly '@namespace.integer'?: number;
-};
-
-/**
- * This is a model with one nested property
- */
-export type ModelWithNestedProperties = {
- readonly first: {
- readonly second: {
- readonly third: string;
- };
- };
-};
-
-/**
- * This is a model with duplicated properties
- */
-export type ModelWithDuplicateProperties = {
- prop?: ModelWithString;
-};
-
-/**
- * This is a model with ordered properties
- */
-export type ModelWithOrderedProperties = {
- zebra?: string;
- apple?: string;
- hawaii?: string;
-};
-
-/**
- * This is a model with duplicated imports
- */
-export type ModelWithDuplicateImports = {
- propA?: ModelWithString;
- propB?: ModelWithString;
- propC?: ModelWithString;
-};
-
-/**
- * This is a model that extends another model
- */
-export type ModelThatExtends = ModelWithString & {
- propExtendsA?: string;
- propExtendsB?: ModelWithString;
-};
-
-/**
- * This is a model that extends another model
- */
-export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & {
- propExtendsC?: string;
- propExtendsD?: ModelWithString;
-};
-
-/**
- * This is a model that contains a some patterns
- */
-export type ModelWithPattern = {
- key: string;
- name: string;
- readonly enabled?: boolean;
- readonly modified?: string;
- id?: string;
- text?: string;
- patternWithSingleQuotes?: string;
- patternWithNewline?: string;
- patternWithBacktick?: string;
-};
-
-export type File = {
- /**
- * Id
- */
- readonly id?: string;
- /**
- * Updated at
- */
- readonly updated_at?: string;
- /**
- * Created at
- */
- readonly created_at?: string;
- /**
- * Mime
- */
- mime: string;
- /**
- * File
- */
- readonly file?: string;
-};
-
-export type Default = {
- name?: string;
-};
-
-export type Pageable = {
- page?: number;
- size?: number;
- sort?: Array;
-};
-
-/**
- * This is a free-form object without additionalProperties.
- */
-export type FreeFormObjectWithoutAdditionalProperties = {
- [key: string]: unknown;
-};
-
-/**
- * This is a free-form object with additionalProperties: true.
- */
-export type FreeFormObjectWithAdditionalPropertiesEqTrue = {
- [key: string]: unknown;
-};
-
-/**
- * This is a free-form object with additionalProperties: {}.
- */
-export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {
- [key: string]: unknown;
-};
-
-export type ModelWithConst = {
- String?: 'String';
- number?: 0;
- null?: null;
- withType?: 'Some string';
-};
-
-/**
- * This is a model with one property and additionalProperties: true
- */
-export type ModelWithAdditionalPropertiesEqTrue = {
- /**
- * This is a simple string property
- */
- prop?: string;
- [key: string]: unknown | string | undefined;
-};
-
-export type NestedAnyOfArraysNullable = {
- nullableArray?: Array | null;
-};
-
-export type CompositionWithOneOfAndProperties = ({
- foo: SimpleParameter;
-} | {
- bar: NonAsciiStringæøåÆøÅöôêÊ字符串;
-}) & {
- baz: number;
- qux: number;
-};
-
-/**
- * An object that can be null
- */
-export type NullableObject = {
- foo?: string;
-} | null;
-
-/**
- * Some % character
- */
-export type CharactersInDescription = string;
-
-export type ModelWithNullableObject = {
- data?: NullableObject;
-};
-
-export type ModelWithOneOfEnum = {
- foo: 'Bar';
-} | {
- foo: 'Baz';
-} | {
- foo: 'Qux';
-} | {
- content: string;
- foo: 'Quux';
-} | {
- content: [
- unknown,
- unknown
- ];
- foo: 'Corge';
-};
-
-export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar';
-
-export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux';
-
-export type ModelWithNestedArrayEnumsData = {
- foo?: Array;
- bar?: Array;
-};
-
-export type ModelWithNestedArrayEnums = {
- array_strings?: Array;
- data?: ModelWithNestedArrayEnumsData;
-};
-
-export type ModelWithNestedCompositionEnums = {
- foo?: ModelWithNestedArrayEnumsDataFoo;
-};
-
-export type ModelWithReadOnlyAndWriteOnly = {
- foo: string;
- readonly bar: string;
- baz: string;
-};
-
-export type ModelWithConstantSizeArray = [
- number,
- number
-];
-
-export type ModelWithAnyOfConstantSizeArray = [
- number | string,
- number | string,
- number | string
-];
-
-export type ModelWithPrefixItemsConstantSizeArray = [
- ModelWithInteger,
- number | string,
- string
-];
-
-export type ModelWithAnyOfConstantSizeArrayNullable = [
- number | string,
- number | string,
- number | string
-];
-
-export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [
- number | Import,
- number | Import
-];
-
-export type ModelWithAnyOfConstantSizeArrayAndIntersect = [
- number & string,
- number & string
-];
-
-export type ModelWithNumericEnumUnion = {
- /**
- * Период
- */
- value?: -10 | -1 | 0 | 1 | 3 | 6 | 12;
-};
-
-/**
- * Some description with `back ticks`
- */
-export type ModelWithBackticksInDescription = {
- /**
- * The template `that` should be used for parsing and importing the contents of the CSV file.
- *
- *
There is one placeholder currently supported:
- ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)
Example of a correct JSON template:
- *
- * [
- * {
- * "resourceType": "Asset",
- * "identifier": {
- * "name": "${1}",
- * "domain": {
- * "name": "${2}",
- * "community": {
- * "name": "Some Community"
- * }
- * }
- * },
- * "attributes" : {
- * "00000000-0000-0000-0000-000000003115" : [ {
- * "value" : "${3}"
- * } ],
- * "00000000-0000-0000-0000-000000000222" : [ {
- * "value" : "${4}"
- * } ]
- * }
- * }
- * ]
- *
- */
- template?: string;
-};
-
-export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & {
- baz: number;
- qux: number;
-};
-
-/**
- * Model used to test deduplication strategy (unused)
- */
-export type ParameterSimpleParameterUnused = string;
-
-/**
- * Model used to test deduplication strategy
- */
-export type PostServiceWithEmptyTagResponse = string;
-
-/**
- * Model used to test deduplication strategy
- */
-export type PostServiceWithEmptyTagResponse2 = string;
-
-/**
- * Model used to test deduplication strategy
- */
-export type DeleteFooData = string;
-
-/**
- * Model used to test deduplication strategy
- */
-export type DeleteFooData2 = string;
-
-/**
- * Model with restricted keyword name
- */
-export type Import = string;
-
-export type SchemaWithFormRestrictedKeys = {
- description?: string;
- 'x-enum-descriptions'?: string;
- 'x-enum-varnames'?: string;
- 'x-enumNames'?: string;
- title?: string;
- object?: {
- description?: string;
- 'x-enum-descriptions'?: string;
- 'x-enum-varnames'?: string;
- 'x-enumNames'?: string;
- title?: string;
- };
- array?: Array;
-};
-
-/**
- * This schema was giving PascalCase transformations a hard time
- */
-export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = {
- /**
- * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.
- */
- preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions;
-};
-
-/**
- * This schema was giving PascalCase transformations a hard time
- */
-export type IoK8sApimachineryPkgApisMetaV1Preconditions = {
- /**
- * Specifies the target ResourceVersion
- */
- resourceVersion?: string;
- /**
- * Specifies the target UID.
- */
- uid?: string;
-};
-
-export type AdditionalPropertiesUnknownIssue = {
- [key: string]: string | number;
-};
-
-export type AdditionalPropertiesUnknownIssue2 = {
- [key: string]: string | number;
-};
-
-export type AdditionalPropertiesUnknownIssue3 = string & {
- entries: unknown;
-};
-
-export type AdditionalPropertiesIntegerIssue = {
- value: number;
- [key: string]: number;
-};
-
-export type OneOfAllOfIssue = ((ConstValue | GenericSchemaDuplicateIssue1SystemBoolean) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemString;
-
-export type GenericSchemaDuplicateIssue1SystemBoolean = {
- item?: boolean;
- error?: string;
- readonly hasError?: boolean;
- data?: {
- [key: string]: never;
- };
-};
-
-export type GenericSchemaDuplicateIssue1SystemString = {
- item?: string;
- error?: string;
- readonly hasError?: boolean;
-};
-
-/**
- * This is a reusable parameter
- */
-export type SimpleParameter = string;
-
-/**
- * Parameter with illegal characters
- */
-export type XFooBar = ModelWithString;
-
-/**
- * A reusable request body
- */
-export type SimpleRequestBody = ModelWithString;
-
-/**
- * A reusable request body
- */
-export type SimpleFormData = ModelWithString;
-
-export type ExportData = {
- body?: never;
- path?: never;
- query?: never;
- url: '/api/v{api-version}/no+tag';
-};
-
-export type PatchApiVbyApiVersionNoTagData = {
- body?: never;
- path?: never;
- query?: never;
- url: '/api/v{api-version}/no+tag';
-};
-
-export type PatchApiVbyApiVersionNoTagResponses = {
- /**
- * OK
- */
- default: unknown;
-};
-
-export type ImportData = {
- body: ModelWithReadOnlyAndWriteOnly | ModelWithArrayReadOnlyAndWriteOnly;
- path?: never;
- query?: never;
- url: '/api/v{api-version}/no+tag';
-};
-
-export type ImportResponses = {
- /**
- * Success
- */
- 200: ModelFromZendesk;
- /**
- * Default success response
- */
- default: ModelWithReadOnlyAndWriteOnly;
-};
-
-export type ImportResponse = ImportResponses[keyof ImportResponses];
-
-export type FooWowData = {
- body?: never;
- path?: never;
- query?: never;
- url: '/api/v{api-version}/no+tag';
-};
-
-export type FooWowResponses = {
- /**
- * OK
- */
- default: unknown;
-};
-
-export type ApiVVersionODataControllerCountData = {
- body?: never;
- path?: never;
- query?: never;
- url: '/api/v{api-version}/simple/$count';
-};
-
-export type ApiVVersionODataControllerCountResponses = {
- /**
- * Success
- */
- 200: ModelFromZendesk;
-};
-
-export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses];
-
-export type GetApiVbyApiVersionSimpleOperationData = {
- body?: never;
- path: {
- /**
- * foo in method
- */
- foo_param: string;
- };
- query?: never;
- url: '/api/v{api-version}/simple:operation';
-};
-
-export type GetApiVbyApiVersionSimpleOperationErrors = {
- /**
- * Default error response
- */
- default: ModelWithBoolean;
-};
-
-export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors];
-
-export type GetApiVbyApiVersionSimpleOperationResponses = {
- /**
- * Response is a simple number
- */
- 200: number;
-};
-
-export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses];
-
-export type DeleteCallWithoutParametersAndResponseData = {
- body?: never;
- path?: never;
- query?: never;
- url: '/api/v{api-version}/simple';
-};
-
-export type GetCallWithoutParametersAndResponseData = {
- body?: never;
- path?: never;
- query?: never;
- url: '/api/v{api-version}/simple';
-};
-
-export type HeadCallWithoutParametersAndResponseData = {
- body?: never;
- path?: never;
- query?: never;
- url: '/api/v{api-version}/simple';
-};
-
-export type OptionsCallWithoutParametersAndResponseData = {
- body?: never;
- path?: never;
- query?: never;
- url: '/api/v{api-version}/simple';
-};
-
-export type PatchCallWithoutParametersAndResponseData = {
- body?: never;
- path?: never;
- query?: never;
- url: '/api/v{api-version}/simple';
-};
-
-export type PostCallWithoutParametersAndResponseData = {
- body?: never;
- path?: never;
- query?: never;
- url: '/api/v{api-version}/simple';
-};
-
-export type PutCallWithoutParametersAndResponseData = {
- body?: never;
- path?: never;
- query?: never;
- url: '/api/v{api-version}/simple';
-};
-
-export type DeleteFooData3 = {
- body?: never;
- headers: {
- /**
- * Parameter with illegal characters
- */
- 'x-Foo-Bar': ModelWithString;
- };
- path: {
- /**
- * foo in method
- */
- foo_param: string;
- /**
- * bar in method
- */
- BarParam: string;
- };
- query?: never;
- url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}';
-};
-
-export type CallWithDescriptionsData = {
- body?: never;
- path?: never;
- query?: {
- /**
- * Testing multiline comments in string: First line
- * Second line
- *
- * Fourth line
- */
- parameterWithBreaks?: unknown;
- /**
- * Testing backticks in string: `backticks` and ```multiple backticks``` should work
- */
- parameterWithBackticks?: unknown;
- /**
- * Testing slashes in string: \backwards\\\ and /forwards/// should work
- */
- parameterWithSlashes?: unknown;
- /**
- * Testing expression placeholders in string: ${expression} should work
- */
- parameterWithExpressionPlaceholders?: unknown;
- /**
- * Testing quotes in string: 'single quote''' and "double quotes""" should work
- */
- parameterWithQuotes?: unknown;
- /**
- * Testing reserved characters in string: * inline * and ** inline ** should work
- */
- parameterWithReservedCharacters?: unknown;
- };
- url: '/api/v{api-version}/descriptions/';
-};
-
-export type DeprecatedCallData = {
- body?: never;
- headers: {
- /**
- * This parameter is deprecated
- *
- * @deprecated
- */
- parameter: DeprecatedModel;
- };
- path?: never;
- query?: never;
- url: '/api/v{api-version}/parameters/deprecated';
-};
-
-export type CallWithParametersData = {
- /**
- * This is the parameter that goes into the body
- */
- body: {
- [key: string]: unknown;
- };
- headers: {
- /**
- * This is the parameter that goes into the header
- */
- parameterHeader: string;
- };
- path: {
- /**
- * This is the parameter that goes into the path
- */
- parameterPath: string;
- /**
- * api-version should be required in standalone clients
- */
- 'api-version': string;
- };
- query: {
- foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo;
- foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo;
- /**
- * This is the parameter that goes into the query params
- */
- cursor: string;
- };
- url: '/api/v{api-version}/parameters/{parameterPath}';
-};
-
-export type CallWithWeirdParameterNamesData = {
- /**
- * This is the parameter that goes into the body
- */
- body: ModelWithString;
- headers: {
- /**
- * This is the parameter that goes into the request header
- */
- 'parameter.header': string;
- };
- path: {
- /**
- * This is the parameter that goes into the path
- */
- 'parameter.path.1'?: string;
- /**
- * This is the parameter that goes into the path
- */
- 'parameter-path-2'?: string;
- /**
- * This is the parameter that goes into the path
- */
- 'PARAMETER-PATH-3'?: string;
- /**
- * api-version should be required in standalone clients
- */
- 'api-version': string;
- };
- query: {
- /**
- * This is the parameter with a reserved keyword
- */
- default?: string;
- /**
- * This is the parameter that goes into the request query params
- */
- 'parameter-query': string;
- };
- url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}';
-};
-
-export type GetCallWithOptionalParamData = {
- /**
- * This is a required parameter
- */
- body: ModelWithOneOfEnum;
- path?: never;
- query?: {
- /**
- * This is an optional parameter
- */
- page?: number;
- };
- url: '/api/v{api-version}/parameters/';
-};
-
-export type PostCallWithOptionalParamData = {
- /**
- * This is an optional parameter
- */
- body?: {
- offset?: number;
- };
- path?: never;
- query: {
- /**
- * This is a required parameter
- */
- parameter: Pageable;
- };
- url: '/api/v{api-version}/parameters/';
-};
-
-export type PostCallWithOptionalParamResponses = {
- /**
- * Response is a simple number
- */
- 200: number;
- /**
- * Success
- */
- 204: void;
-};
-
-export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses];
-
-export type PostApiVbyApiVersionRequestBodyData = {
- /**
- * A reusable request body
- */
- body?: SimpleRequestBody;
- path?: never;
- query?: {
- /**
- * This is a reusable parameter
- */
- parameter?: string;
- };
- url: '/api/v{api-version}/requestBody/';
-};
-
-export type PostApiVbyApiVersionFormDataData = {
- /**
- * A reusable request body
- */
- body?: SimpleFormData;
- path?: never;
- query?: {
- /**
- * This is a reusable parameter
- */
- parameter?: string;
- };
- url: '/api/v{api-version}/formData/';
-};
-
-export type CallWithDefaultParametersData = {
- body?: never;
- path?: never;
- query?: {
- /**
- * This is a simple string with default value
- */
- parameterString?: string;
- /**
- * This is a simple number with default value
- */
- parameterNumber?: number;
- /**
- * This is a simple boolean with default value
- */
- parameterBoolean?: boolean;
- /**
- * This is a simple enum with default value
- */
- parameterEnum?: 'Success' | 'Warning' | 'Error';
- /**
- * This is a simple model with default value
- */
- parameterModel?: ModelWithString;
- };
- url: '/api/v{api-version}/defaults';
-};
-
-export type CallWithDefaultOptionalParametersData = {
- body?: never;
- path?: never;
- query?: {
- /**
- * This is a simple string that is optional with default value
- */
- parameterString?: string;
- /**
- * This is a simple number that is optional with default value
- */
- parameterNumber?: number;
- /**
- * This is a simple boolean that is optional with default value
- */
- parameterBoolean?: boolean;
- /**
- * This is a simple enum that is optional with default value
- */
- parameterEnum?: 'Success' | 'Warning' | 'Error';
- /**
- * This is a simple model that is optional with default value
- */
- parameterModel?: ModelWithString;
- };
- url: '/api/v{api-version}/defaults';
-};
-
-export type CallToTestOrderOfParamsData = {
- body?: never;
- path?: never;
- query: {
- /**
- * This is a optional string with default
- */
- parameterOptionalStringWithDefault?: string;
- /**
- * This is a optional string with empty default
- */
- parameterOptionalStringWithEmptyDefault?: string;
- /**
- * This is a optional string with no default
- */
- parameterOptionalStringWithNoDefault?: string;
- /**
- * This is a string with default
- */
- parameterStringWithDefault: string;
- /**
- * This is a string with empty default
- */
- parameterStringWithEmptyDefault: string;
- /**
- * This is a string with no default
- */
- parameterStringWithNoDefault: string;
- /**
- * This is a string that can be null with no default
- */
- parameterStringNullableWithNoDefault?: string;
- /**
- * This is a string that can be null with default
- */
- parameterStringNullableWithDefault?: string;
- };
- url: '/api/v{api-version}/defaults';
-};
-
-export type DuplicateNameData = {
- body?: never;
- path?: never;
- query?: never;
- url: '/api/v{api-version}/duplicate';
-};
-
-export type DuplicateName2Data = {
- body?: never;
- path?: never;
- query?: never;
- url: '/api/v{api-version}/duplicate';
-};
-
-export type DuplicateName3Data = {
- body?: never;
- path?: never;
- query?: never;
- url: '/api/v{api-version}/duplicate';
-};
-
-export type DuplicateName4Data = {
- body?: never;
- path?: never;
- query?: never;
- url: '/api/v{api-version}/duplicate';
-};
-
-export type CallWithNoContentResponseData = {
- body?: never;
- path?: never;
- query?: never;
- url: '/api/v{api-version}/no-content';
-};
-
-export type CallWithNoContentResponseResponses = {
- /**
- * Success
- */
- 204: void;
-};
-
-export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses];
-
-export type CallWithResponseAndNoContentResponseData = {
- body?: never;
- path?: never;
- query?: never;
- url: '/api/v{api-version}/multiple-tags/response-and-no-content';
-};
-
-export type CallWithResponseAndNoContentResponseResponses = {
- /**
- * Response is a simple number
- */
- 200: number;
- /**
- * Success
- */
- 204: void;
-};
-
-export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses];
-
-export type DummyAData = {
- body?: never;
- path?: never;
- query?: never;
- url: '/api/v{api-version}/multiple-tags/a';
-};
-
-export type DummyAResponses = {
- 200: _400;
-};
-
-export type DummyAResponse = DummyAResponses[keyof DummyAResponses];
-
-export type DummyBData = {
- body?: never;
- path?: never;
- query?: never;
- url: '/api/v{api-version}/multiple-tags/b';
-};
-
-export type DummyBResponses = {
- /**
- * Success
- */
- 204: void;
-};
-
-export type DummyBResponse = DummyBResponses[keyof DummyBResponses];
-
-export type CallWithResponseData = {
- body?: never;
- path?: never;
- query?: never;
- url: '/api/v{api-version}/response';
-};
-
-export type CallWithResponseResponses = {
- default: Import;
-};
-
-export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses];
-
-export type CallWithDuplicateResponsesData = {
- body?: never;
- path?: never;
- query?: never;
- url: '/api/v{api-version}/response';
-};
-
-export type CallWithDuplicateResponsesErrors = {
- /**
- * Message for 500 error
- */
- 500: ModelWithStringError;
- /**
- * Message for 501 error
- */
- 501: ModelWithStringError;
- /**
- * Message for 502 error
- */
- 502: ModelWithStringError;
- /**
- * Message for 4XX errors
- */
- '4XX': DictionaryWithArray;
- /**
- * Default error response
- */
- default: ModelWithBoolean;
-};
-
-export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors];
-
-export type CallWithDuplicateResponsesResponses = {
- /**
- * Message for 200 response
- */
- 200: ModelWithBoolean & ModelWithInteger;
- /**
- * Message for 201 response
- */
- 201: ModelWithString;
- /**
- * Message for 202 response
- */
- 202: ModelWithString;
-};
-
-export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses];
-
-export type CallWithResponsesData = {
- body?: never;
- path?: never;
- query?: never;
- url: '/api/v{api-version}/response';
-};
-
-export type CallWithResponsesErrors = {
- /**
- * Message for 500 error
- */
- 500: ModelWithStringError;
- /**
- * Message for 501 error
- */
- 501: ModelWithStringError;
- /**
- * Message for 502 error
- */
- 502: ModelWithStringError;
- /**
- * Message for default response
- */
- default: ModelWithStringError;
-};
-
-export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors];
-
-export type CallWithResponsesResponses = {
- /**
- * Message for 200 response
- */
- 200: {
- readonly '@namespace.string'?: string;
- readonly '@namespace.integer'?: number;
- readonly value?: Array;
- };
- /**
- * Message for 201 response
- */
- 201: ModelThatExtends;
- /**
- * Message for 202 response
- */
- 202: ModelThatExtendsExtends;
-};
-
-export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses];
-
-export type CollectionFormatData = {
- body?: never;
- path?: never;
- query: {
- /**
- * This is an array parameter that is sent as csv format (comma-separated values)
- */
- parameterArrayCSV: Array;
- /**
- * This is an array parameter that is sent as ssv format (space-separated values)
- */
- parameterArraySSV: Array;
- /**
- * This is an array parameter that is sent as tsv format (tab-separated values)
- */
- parameterArrayTSV: Array;
- /**
- * This is an array parameter that is sent as pipes format (pipe-separated values)
- */
- parameterArrayPipes: Array;
- /**
- * This is an array parameter that is sent as multi format (multiple parameter instances)
- */
- parameterArrayMulti: Array;
- };
- url: '/api/v{api-version}/collectionFormat';
-};
-
-export type TypesData = {
- body?: never;
- path?: {
- /**
- * This is a number parameter
- */
- id?: number;
- };
- query: {
- /**
- * This is a number parameter
- */
- parameterNumber: number;
- /**
- * This is a string parameter
- */
- parameterString: string;
- /**
- * This is a boolean parameter
- */
- parameterBoolean: boolean;
- /**
- * This is an object parameter
- */
- parameterObject: {
- [key: string]: unknown;
- };
- /**
- * This is an array parameter
- */
- parameterArray: Array;
- /**
- * This is a dictionary parameter
- */
- parameterDictionary: {
- [key: string]: unknown;
- };
- /**
- * This is an enum parameter
- */
- parameterEnum: 'Success' | 'Warning' | 'Error';
- /**
- * This is tuple parameter
- */
- parameterTuple: [
- number,
- number,
- number,
- number
- ];
- };
- url: '/api/v{api-version}/types';
-};
-
-export type TypesResponses = {
- /**
- * Response is a simple number
- */
- 200: number;
- /**
- * Response is a simple string
- */
- 201: string;
- /**
- * Response is a simple boolean
- */
- 202: boolean;
- /**
- * Response is a simple object
- */
- 203: {
- [key: string]: unknown;
- };
-};
-
-export type TypesResponse = TypesResponses[keyof TypesResponses];
-
-export type UploadFileData = {
- body: unknown;
- path: {
- /**
- * api-version should be required in standalone clients
- */
- 'api-version': string;
- };
- query?: never;
- url: '/api/v{api-version}/upload';
-};
-
-export type UploadFileResponses = {
- 200: boolean;
-};
-
-export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses];
-
-export type FileResponseData = {
- body?: never;
- path: {
- id: string;
- /**
- * api-version should be required in standalone clients
- */
- 'api-version': string;
- };
- query?: never;
- url: '/api/v{api-version}/file/{id}';
-};
-
-export type FileResponseResponses = {
- /**
- * Success
- */
- 200: unknown;
-};
-
-export type ComplexTypesData = {
- body?: never;
- path?: never;
- query: {
- /**
- * Parameter containing object
- */
- parameterObject: {
- first?: {
- second?: {
- third?: string;
- };
- };
- };
- /**
- * Parameter containing reference
- */
- parameterReference: ModelWithString;
- };
- url: '/api/v{api-version}/complex';
-};
-
-export type ComplexTypesErrors = {
- /**
- * 400 `server` error
- */
- 400: unknown;
- /**
- * 500 server error
- */
- 500: unknown;
-};
-
-export type ComplexTypesResponses = {
- /**
- * Successful response
- */
- 200: Array;
-};
-
-export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses];
-
-export type MultipartResponseData = {
- body?: never;
- path?: never;
- query?: never;
- url: '/api/v{api-version}/multipart';
-};
-
-export type MultipartResponseResponses = {
- /**
- * OK
- */
- 200: {
- file?: Blob | File;
- metadata?: {
- foo?: string;
- bar?: string;
- };
- };
-};
-
-export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses];
-
-export type MultipartRequestData = {
- body?: {
- content?: Blob | File;
- data?: ModelWithString;
- };
- path?: never;
- query?: never;
- url: '/api/v{api-version}/multipart';
-};
-
-export type ComplexParamsData = {
- body?: {
- readonly key: string;
- name: string;
- enabled?: boolean;
- type: 'Monkey' | 'Horse' | 'Bird';
- listOfModels?: Array;
- listOfStrings?: Array;
- parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary;
- readonly user?: {
- readonly id?: number;
- readonly name?: string;
- };
- };
- path: {
- id: number;
- /**
- * api-version should be required in standalone clients
- */
- 'api-version': string;
- };
- query?: never;
- url: '/api/v{api-version}/complex/{id}';
-};
-
-export type ComplexParamsResponses = {
- /**
- * Success
- */
- 200: ModelWithString;
-};
-
-export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses];
-
-export type CallWithResultFromHeaderData = {
- body?: never;
- path?: never;
- query?: never;
- url: '/api/v{api-version}/header';
-};
-
-export type CallWithResultFromHeaderErrors = {
- /**
- * 400 server error
- */
- 400: unknown;
- /**
- * 500 server error
- */
- 500: unknown;
-};
-
-export type CallWithResultFromHeaderResponses = {
- /**
- * Successful response
- */
- 200: unknown;
-};
-
-export type TestErrorCodeData = {
- body?: never;
- path?: never;
- query: {
- /**
- * Status code to return
- */
- status: number;
- };
- url: '/api/v{api-version}/error';
-};
-
-export type TestErrorCodeErrors = {
- /**
- * Custom message: Internal Server Error
- */
- 500: unknown;
- /**
- * Custom message: Not Implemented
- */
- 501: unknown;
- /**
- * Custom message: Bad Gateway
- */
- 502: unknown;
- /**
- * Custom message: Service Unavailable
- */
- 503: unknown;
-};
-
-export type TestErrorCodeResponses = {
- /**
- * Custom message: Successful response
- */
- 200: unknown;
-};
-
-export type NonAsciiæøåÆøÅöôêÊ字符串Data = {
- body?: never;
- path?: never;
- query: {
- /**
- * Dummy input param
- */
- nonAsciiParamæøåÆØÅöôêÊ: number;
- };
- url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串';
-};
-
-export type NonAsciiæøåÆøÅöôêÊ字符串Responses = {
- /**
- * Successful response
- */
- 200: Array;
-};
-
-export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses];
-
-export type PutWithFormUrlEncodedData = {
- body: ArrayWithStrings;
- path?: never;
- query?: never;
- url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串';
-};
diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3/core/ApiError.ts.snap b/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3/core/ApiError.ts.snap
deleted file mode 100644
index 36675d288a..0000000000
--- a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3/core/ApiError.ts.snap
+++ /dev/null
@@ -1,21 +0,0 @@
-import type { ApiRequestOptions } from './ApiRequestOptions';
-import type { ApiResult } from './ApiResult';
-
-export class ApiError extends Error {
- public readonly url: string;
- public readonly status: number;
- public readonly statusText: string;
- public readonly body: unknown;
- public readonly request: ApiRequestOptions;
-
- constructor(request: ApiRequestOptions, response: ApiResult, message: string) {
- super(message);
-
- this.name = 'ApiError';
- this.url = response.url;
- this.status = response.status;
- this.statusText = response.statusText;
- this.body = response.body;
- this.request = request;
- }
-}
\ No newline at end of file
diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3/core/ApiRequestOptions.ts.snap b/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3/core/ApiRequestOptions.ts.snap
deleted file mode 100644
index 939a0aa4c8..0000000000
--- a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3/core/ApiRequestOptions.ts.snap
+++ /dev/null
@@ -1,21 +0,0 @@
-export type ApiRequestOptions = {
- readonly body?: any;
- readonly cookies?: Record;
- readonly errors?: Record;
- readonly formData?: Record | any[] | Blob | File;
- readonly headers?: Record;
- readonly mediaType?: string;
- readonly method:
- | 'DELETE'
- | 'GET'
- | 'HEAD'
- | 'OPTIONS'
- | 'PATCH'
- | 'POST'
- | 'PUT';
- readonly path?: Record;
- readonly query?: Record;
- readonly responseHeader?: string;
- readonly responseTransformer?: (data: unknown) => Promise;
- readonly url: string;
-};
\ No newline at end of file
diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3/core/ApiResult.ts.snap b/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3/core/ApiResult.ts.snap
deleted file mode 100644
index 4c58e39138..0000000000
--- a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3/core/ApiResult.ts.snap
+++ /dev/null
@@ -1,7 +0,0 @@
-export type ApiResult = {
- readonly body: TData;
- readonly ok: boolean;
- readonly status: number;
- readonly statusText: string;
- readonly url: string;
-};
\ No newline at end of file
diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3/core/CancelablePromise.ts.snap b/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3/core/CancelablePromise.ts.snap
deleted file mode 100644
index d95c755e0a..0000000000
--- a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3/core/CancelablePromise.ts.snap
+++ /dev/null
@@ -1,126 +0,0 @@
-export class CancelError extends Error {
- constructor(message: string) {
- super(message);
- this.name = 'CancelError';
- }
-
- public get isCancelled(): boolean {
- return true;
- }
-}
-
-export interface OnCancel {
- readonly isResolved: boolean;
- readonly isRejected: boolean;
- readonly isCancelled: boolean;
-
- (cancelHandler: () => void): void;
-}
-
-export class CancelablePromise implements Promise {
- private _isResolved: boolean;
- private _isRejected: boolean;
- private _isCancelled: boolean;
- readonly cancelHandlers: (() => void)[];
- readonly promise: Promise;
- private _resolve?: (value: T | PromiseLike) => void;
- private _reject?: (reason?: unknown) => void;
-
- constructor(
- executor: (
- resolve: (value: T | PromiseLike) => void,
- reject: (reason?: unknown) => void,
- onCancel: OnCancel
- ) => void
- ) {
- this._isResolved = false;
- this._isRejected = false;
- this._isCancelled = false;
- this.cancelHandlers = [];
- this.promise = new Promise((resolve, reject) => {
- this._resolve = resolve;
- this._reject = reject;
-
- const onResolve = (value: T | PromiseLike): void => {
- if (this._isResolved || this._isRejected || this._isCancelled) {
- return;
- }
- this._isResolved = true;
- if (this._resolve) this._resolve(value);
- };
-
- const onReject = (reason?: unknown): void => {
- if (this._isResolved || this._isRejected || this._isCancelled) {
- return;
- }
- this._isRejected = true;
- if (this._reject) this._reject(reason);
- };
-
- const onCancel = (cancelHandler: () => void): void => {
- if (this._isResolved || this._isRejected || this._isCancelled) {
- return;
- }
- this.cancelHandlers.push(cancelHandler);
- };
-
- Object.defineProperty(onCancel, 'isResolved', {
- get: (): boolean => this._isResolved,
- });
-
- Object.defineProperty(onCancel, 'isRejected', {
- get: (): boolean => this._isRejected,
- });
-
- Object.defineProperty(onCancel, 'isCancelled', {
- get: (): boolean => this._isCancelled,
- });
-
- return executor(onResolve, onReject, onCancel as OnCancel);
- });
- }
-
- get [Symbol.toStringTag](): string {
- return "Cancellable Promise";
- }
-
- public then(
- onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null,
- onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null
- ): Promise {
- return this.promise.then(onFulfilled, onRejected);
- }
-
- public catch(
- onRejected?: ((reason: unknown) => TResult | PromiseLike) | null
- ): Promise {
- return this.promise.catch(onRejected);
- }
-
- public finally(onFinally?: (() => void) | null): Promise {
- return this.promise.finally(onFinally);
- }
-
- public cancel(): void {
- if (this._isResolved || this._isRejected || this._isCancelled) {
- return;
- }
- this._isCancelled = true;
- if (this.cancelHandlers.length) {
- try {
- for (const cancelHandler of this.cancelHandlers) {
- cancelHandler();
- }
- } catch (error) {
- console.warn('Cancellation threw an error', error);
- return;
- }
- }
- this.cancelHandlers.length = 0;
- if (this._reject) this._reject(new CancelError('Request aborted'));
- }
-
- public get isCancelled(): boolean {
- return this._isCancelled;
- }
-}
\ No newline at end of file
diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3/core/OpenAPI.ts.snap b/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3/core/OpenAPI.ts.snap
deleted file mode 100644
index 144e257447..0000000000
--- a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3/core/OpenAPI.ts.snap
+++ /dev/null
@@ -1,56 +0,0 @@
-import type { ApiRequestOptions } from './ApiRequestOptions';
-
-type Headers = Record;
-type Middleware = (value: T) => T | Promise;
-type Resolver = (options: ApiRequestOptions) => Promise;
-
-export class Interceptors {
- _fns: Middleware[];
-
- constructor() {
- this._fns = [];
- }
-
- eject(fn: Middleware): void {
- const index = this._fns.indexOf(fn);
- if (index !== -1) {
- this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)];
- }
- }
-
- use(fn: Middleware): void {
- this._fns = [...this._fns, fn];
- }
-}
-
-export type OpenAPIConfig = {
- BASE: string;
- CREDENTIALS: 'include' | 'omit' | 'same-origin';
- ENCODE_PATH?: ((path: string) => string) | undefined;
- HEADERS?: Headers | Resolver | undefined;
- PASSWORD?: string | Resolver | undefined;
- TOKEN?: string | Resolver | undefined;
- USERNAME?: string | Resolver | undefined;
- VERSION: string;
- WITH_CREDENTIALS: boolean;
- interceptors: {
- request: Interceptors;
- response: Interceptors;
- };
-};
-
-export const OpenAPI: OpenAPIConfig = {
- BASE: 'http://localhost:3000/base',
- CREDENTIALS: 'include',
- ENCODE_PATH: undefined,
- HEADERS: undefined,
- PASSWORD: undefined,
- TOKEN: undefined,
- USERNAME: undefined,
- VERSION: '1.0',
- WITH_CREDENTIALS: false,
- interceptors: {
- request: new Interceptors(),
- response: new Interceptors(),
- },
-};
\ No newline at end of file
diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3/core/request.ts.snap b/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3/core/request.ts.snap
deleted file mode 100644
index 5458a2899d..0000000000
--- a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3/core/request.ts.snap
+++ /dev/null
@@ -1,350 +0,0 @@
-import { ApiError } from './ApiError';
-import type { ApiRequestOptions } from './ApiRequestOptions';
-import type { ApiResult } from './ApiResult';
-import { CancelablePromise } from './CancelablePromise';
-import type { OnCancel } from './CancelablePromise';
-import type { OpenAPIConfig } from './OpenAPI';
-
-export const isString = (value: unknown): value is string => {
- return typeof value === 'string';
-};
-
-export const isStringWithValue = (value: unknown): value is string => {
- return isString(value) && value !== '';
-};
-
-export const isBlob = (value: any): value is Blob => {
- return value instanceof Blob;
-};
-
-export const isFormData = (value: unknown): value is FormData => {
- return value instanceof FormData;
-};
-
-export const base64 = (str: string): string => {
- try {
- return btoa(str);
- } catch (err) {
- // @ts-ignore
- return Buffer.from(str).toString('base64');
- }
-};
-
-export const getQueryString = (params: Record): string => {
- const qs: string[] = [];
-
- const append = (key: string, value: unknown) => {
- qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
- };
-
- const encodePair = (key: string, value: unknown) => {
- if (value === undefined || value === null) {
- return;
- }
-
- if (value instanceof Date) {
- append(key, value.toISOString());
- } else if (Array.isArray(value)) {
- value.forEach(v => encodePair(key, v));
- } else if (typeof value === 'object') {
- Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v));
- } else {
- append(key, value);
- }
- };
-
- Object.entries(params).forEach(([key, value]) => encodePair(key, value));
-
- return qs.length ? `?${qs.join('&')}` : '';
-};
-
-const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => {
- const encoder = config.ENCODE_PATH || encodeURI;
-
- const path = options.url
- .replace('{api-version}', config.VERSION)
- .replace(/{(.*?)}/g, (substring: string, group: string) => {
- if (options.path?.hasOwnProperty(group)) {
- return encoder(String(options.path[group]));
- }
- return substring;
- });
-
- const url = config.BASE + path;
- return options.query ? url + getQueryString(options.query) : url;
-};
-
-export const getFormData = (options: ApiRequestOptions): FormData | undefined => {
- if (options.formData) {
- const formData = new FormData();
-
- const process = (key: string, value: unknown) => {
- if (isString(value) || isBlob(value)) {
- formData.append(key, value);
- } else {
- formData.append(key, JSON.stringify(value));
- }
- };
-
- Object.entries(options.formData)
- .filter(([, value]) => value !== undefined && value !== null)
- .forEach(([key, value]) => {
- if (Array.isArray(value)) {
- value.forEach(v => process(key, v));
- } else {
- process(key, value);
- }
- });
-
- return formData;
- }
- return undefined;
-};
-
-type Resolver = (options: ApiRequestOptions) => Promise;
-
-export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => {
- if (typeof resolver === 'function') {
- return (resolver as Resolver)(options);
- }
- return resolver;
-};
-
-export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise => {
- const [token, username, password, additionalHeaders] = await Promise.all([
- // @ts-ignore
- resolve(options, config.TOKEN),
- // @ts-ignore
- resolve(options, config.USERNAME),
- // @ts-ignore
- resolve(options, config.PASSWORD),
- // @ts-ignore
- resolve(options, config.HEADERS),
- ]);
-
- const headers = Object.entries({
- Accept: 'application/json',
- ...additionalHeaders,
- ...options.headers,
- })
- .filter(([, value]) => value !== undefined && value !== null)
- .reduce((headers, [key, value]) => ({
- ...headers,
- [key]: String(value),
- }), {} as Record);
-
- if (isStringWithValue(token)) {
- headers['Authorization'] = `Bearer ${token}`;
- }
-
- if (isStringWithValue(username) && isStringWithValue(password)) {
- const credentials = base64(`${username}:${password}`);
- headers['Authorization'] = `Basic ${credentials}`;
- }
-
- if (options.body !== undefined) {
- if (options.mediaType) {
- headers['Content-Type'] = options.mediaType;
- } else if (isBlob(options.body)) {
- headers['Content-Type'] = options.body.type || 'application/octet-stream';
- } else if (isString(options.body)) {
- headers['Content-Type'] = 'text/plain';
- } else if (!isFormData(options.body)) {
- headers['Content-Type'] = 'application/json';
- }
- }
-
- return new Headers(headers);
-};
-
-export const getRequestBody = (options: ApiRequestOptions): unknown => {
- if (options.body !== undefined) {
- if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) {
- return JSON.stringify(options.body);
- } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) {
- return options.body;
- } else {
- return JSON.stringify(options.body);
- }
- }
- return undefined;
-};
-
-export const sendRequest = async (
- config: OpenAPIConfig,
- options: ApiRequestOptions,
- url: string,
- body: any,
- formData: FormData | undefined,
- headers: Headers,
- onCancel: OnCancel
-): Promise => {
- const controller = new AbortController();
-
- let request: RequestInit = {
- headers,
- body: body ?? formData,
- method: options.method,
- signal: controller.signal,
- };
-
- if (config.WITH_CREDENTIALS) {
- request.credentials = config.CREDENTIALS;
- }
-
- for (const fn of config.interceptors.request._fns) {
- request = await fn(request);
- }
-
- onCancel(() => controller.abort());
-
- return await fetch(url, request);
-};
-
-export const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => {
- if (responseHeader) {
- const content = response.headers.get(responseHeader);
- if (isString(content)) {
- return content;
- }
- }
- return undefined;
-};
-
-export const getResponseBody = async (response: Response): Promise => {
- if (response.status !== 204) {
- try {
- const contentType = response.headers.get('Content-Type');
- if (contentType) {
- const binaryTypes = ['application/octet-stream', 'application/pdf', 'application/zip', 'audio/', 'image/', 'video/'];
- if (contentType.includes('application/json') || contentType.includes('+json')) {
- return await response.json();
- } else if (binaryTypes.some(type => contentType.includes(type))) {
- return await response.blob();
- } else if (contentType.includes('multipart/form-data')) {
- return await response.formData();
- } else if (contentType.includes('text/')) {
- return await response.text();
- }
- }
- } catch (error) {
- console.error(error);
- }
- }
- return undefined;
-};
-
-export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => {
- const errors: Record = {
- 400: 'Bad Request',
- 401: 'Unauthorized',
- 402: 'Payment Required',
- 403: 'Forbidden',
- 404: 'Not Found',
- 405: 'Method Not Allowed',
- 406: 'Not Acceptable',
- 407: 'Proxy Authentication Required',
- 408: 'Request Timeout',
- 409: 'Conflict',
- 410: 'Gone',
- 411: 'Length Required',
- 412: 'Precondition Failed',
- 413: 'Payload Too Large',
- 414: 'URI Too Long',
- 415: 'Unsupported Media Type',
- 416: 'Range Not Satisfiable',
- 417: 'Expectation Failed',
- 418: 'Im a teapot',
- 421: 'Misdirected Request',
- 422: 'Unprocessable Content',
- 423: 'Locked',
- 424: 'Failed Dependency',
- 425: 'Too Early',
- 426: 'Upgrade Required',
- 428: 'Precondition Required',
- 429: 'Too Many Requests',
- 431: 'Request Header Fields Too Large',
- 451: 'Unavailable For Legal Reasons',
- 500: 'Internal Server Error',
- 501: 'Not Implemented',
- 502: 'Bad Gateway',
- 503: 'Service Unavailable',
- 504: 'Gateway Timeout',
- 505: 'HTTP Version Not Supported',
- 506: 'Variant Also Negotiates',
- 507: 'Insufficient Storage',
- 508: 'Loop Detected',
- 510: 'Not Extended',
- 511: 'Network Authentication Required',
- ...options.errors,
- }
-
- const error = errors[result.status];
- if (error) {
- throw new ApiError(options, result, error);
- }
-
- if (!result.ok) {
- const errorStatus = result.status ?? 'unknown';
- const errorStatusText = result.statusText ?? 'unknown';
- const errorBody = (() => {
- try {
- return JSON.stringify(result.body, null, 2);
- } catch (e) {
- return undefined;
- }
- })();
-
- throw new ApiError(options, result,
- `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}`
- );
- }
-};
-
-/**
- * Request method
- * @param config The OpenAPI configuration object
- * @param options The request options from the service
- * @returns CancelablePromise
- * @throws ApiError
- */
-export const request = (config: OpenAPIConfig, options: ApiRequestOptions): CancelablePromise => {
- return new CancelablePromise(async (resolve, reject, onCancel) => {
- try {
- const url = getUrl(config, options);
- const formData = getFormData(options);
- const body = getRequestBody(options);
- const headers = await getHeaders(config, options);
-
- if (!onCancel.isCancelled) {
- let response = await sendRequest(config, options, url, body, formData, headers, onCancel);
-
- for (const fn of config.interceptors.response._fns) {
- response = await fn(response);
- }
-
- const responseBody = await getResponseBody(response);
- const responseHeader = getResponseHeader(response, options.responseHeader);
-
- let transformedBody = responseBody;
- if (options.responseTransformer && response.ok) {
- transformedBody = await options.responseTransformer(responseBody)
- }
-
- const result: ApiResult = {
- url,
- ok: response.ok,
- status: response.status,
- statusText: response.statusText,
- body: responseHeader ?? transformedBody,
- };
-
- catchErrorCodes(options, result);
-
- resolve(result.body);
- }
- } catch (error) {
- reject(error);
- }
- });
-};
\ No newline at end of file
diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3/index.ts.snap b/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3/index.ts.snap
deleted file mode 100644
index 50a1dd734c..0000000000
--- a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3/index.ts.snap
+++ /dev/null
@@ -1,6 +0,0 @@
-// This file is auto-generated by @hey-api/openapi-ts
-export { ApiError } from './core/ApiError';
-export { CancelablePromise, CancelError } from './core/CancelablePromise';
-export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI';
-export * from './sdk.gen';
-export * from './types.gen';
\ No newline at end of file
diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3/sdk.gen.ts.snap b/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3/sdk.gen.ts.snap
deleted file mode 100644
index 4ef5fc4318..0000000000
--- a/packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3/sdk.gen.ts.snap
+++ /dev/null
@@ -1,890 +0,0 @@
-// This file is auto-generated by @hey-api/openapi-ts
-
-import type { CancelablePromise } from './core/CancelablePromise';
-import { OpenAPI } from './core/OpenAPI';
-import { request as __request } from './core/request';
-import type { CollectionFormatData, ComplexTypesData, ComplexTypesResponse, ComplexParamsData, ComplexParamsResponse, PatchApiNoTagResponse, ImportData, ImportResponse, FooWowResponse, GetApiSimpleOperationData, GetApiSimpleOperationResponse, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DeprecatedCallData, CallWithDescriptionsData, TestErrorCodeData, TestErrorCodeResponse, FileResponseData, FileResponseResponse, PostApiFormDataData, CallWithResultFromHeaderResponse, MultipartRequestData, MultipartResponseResponse, DummyAResponse, DummyBResponse, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData, DeleteFooData3, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiRequestBodyData, CallWithResponseResponse, CallWithDuplicateResponsesResponse, CallWithResponsesResponse, ApiVVersionODataControllerCountResponse, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from './types.gen';
-
-export class CollectionFormat {
- /**
- * @param data The data for the request.
- * @param data.parameterArrayCsv This is an array parameter that is sent as csv format (comma-separated values)
- * @param data.parameterArraySsv This is an array parameter that is sent as ssv format (space-separated values)
- * @param data.parameterArrayTsv This is an array parameter that is sent as tsv format (tab-separated values)
- * @param data.parameterArrayPipes This is an array parameter that is sent as pipes format (pipe-separated values)
- * @param data.parameterArrayMulti This is an array parameter that is sent as multi format (multiple parameter instances)
- * @throws ApiError
- */
- public static collectionFormat(data: CollectionFormatData): CancelablePromise {
- return __request(OpenAPI, {
- method: 'GET',
- url: '/api/v{api-version}/collectionFormat',
- query: {
- parameterArrayCSV: data.parameterArrayCsv,
- parameterArraySSV: data.parameterArraySsv,
- parameterArrayTSV: data.parameterArrayTsv,
- parameterArrayPipes: data.parameterArrayPipes,
- parameterArrayMulti: data.parameterArrayMulti
- }
- });
- }
-}
-
-export class Complex {
- /**
- * @param data The data for the request.
- * @param data.parameterObject Parameter containing object
- * @param data.parameterReference Parameter containing reference
- * @returns ModelWithString Successful response
- * @throws ApiError
- */
- public static complexTypes(data: ComplexTypesData): CancelablePromise {
- return __request(OpenAPI, {
- method: 'GET',
- url: '/api/v{api-version}/complex',
- query: {
- parameterObject: data.parameterObject,
- parameterReference: data.parameterReference
- },
- errors: {
- 400: '400 `server` error',
- 500: '500 server error'
- }
- });
- }
-
- /**
- * @param data The data for the request.
- * @param data.id
- * @param data.requestBody
- * @returns ModelWithString Success
- * @throws ApiError
- */
- public static complexParams(data: ComplexParamsData): CancelablePromise {
- return __request(OpenAPI, {
- method: 'PUT',
- url: '/api/v{api-version}/complex/{id}',
- path: {
- id: data.id
- },
- body: data.requestBody,
- mediaType: 'application/json-patch+json'
- });
- }
-}
-
-export class Default {
- /**
- * @throws ApiError
- */
- public static export(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'GET',
- url: '/api/v{api-version}/no+tag'
- });
- }
-
- /**
- * @returns unknown OK
- * @throws ApiError
- */
- public static patchApiNoTag(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'PATCH',
- url: '/api/v{api-version}/no+tag'
- });
- }
-
- /**
- * @param data The data for the request.
- * @param data.requestBody
- * @returns Model_From_Zendesk Success
- * @returns ModelWithReadOnlyAndWriteOnly Default success response
- * @throws ApiError
- */
- public static import(data: ImportData): CancelablePromise {
- return __request(OpenAPI, {
- method: 'POST',
- url: '/api/v{api-version}/no+tag',
- body: data.requestBody,
- mediaType: 'application/json'
- });
- }
-
- /**
- * @returns unknown OK
- * @throws ApiError
- */
- public static fooWow(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'PUT',
- url: '/api/v{api-version}/no+tag'
- });
- }
-
- /**
- * @param data The data for the request.
- * @param data.fooParam foo in method
- * @returns number Response is a simple number
- * @throws ApiError
- */
- public static getApiSimpleOperation(data: GetApiSimpleOperationData): CancelablePromise {
- return __request(OpenAPI, {
- method: 'GET',
- url: '/api/v{api-version}/simple:operation',
- path: {
- foo_param: data.fooParam
- },
- errors: {
- default: 'Default error response'
- }
- });
- }
-}
-
-export class Defaults {
- /**
- * @param data The data for the request.
- * @param data.parameterString This is a simple string with default value
- * @param data.parameterNumber This is a simple number with default value
- * @param data.parameterBoolean This is a simple boolean with default value
- * @param data.parameterEnum This is a simple enum with default value
- * @param data.parameterModel This is a simple model with default value
- * @throws ApiError
- */
- public static callWithDefaultParameters(data: CallWithDefaultParametersData = {}): CancelablePromise {
- return __request(OpenAPI, {
- method: 'GET',
- url: '/api/v{api-version}/defaults',
- query: {
- parameterString: data.parameterString,
- parameterNumber: data.parameterNumber,
- parameterBoolean: data.parameterBoolean,
- parameterEnum: data.parameterEnum,
- parameterModel: data.parameterModel
- }
- });
- }
-
- /**
- * @param data The data for the request.
- * @param data.parameterString This is a simple string that is optional with default value
- * @param data.parameterNumber This is a simple number that is optional with default value
- * @param data.parameterBoolean This is a simple boolean that is optional with default value
- * @param data.parameterEnum This is a simple enum that is optional with default value
- * @param data.parameterModel This is a simple model that is optional with default value
- * @throws ApiError
- */
- public static callWithDefaultOptionalParameters(data: CallWithDefaultOptionalParametersData = {}): CancelablePromise {
- return __request(OpenAPI, {
- method: 'POST',
- url: '/api/v{api-version}/defaults',
- query: {
- parameterString: data.parameterString,
- parameterNumber: data.parameterNumber,
- parameterBoolean: data.parameterBoolean,
- parameterEnum: data.parameterEnum,
- parameterModel: data.parameterModel
- }
- });
- }
-
- /**
- * @param data The data for the request.
- * @param data.parameterStringWithNoDefault This is a string with no default
- * @param data.parameterOptionalStringWithDefault This is a optional string with default
- * @param data.parameterOptionalStringWithEmptyDefault This is a optional string with empty default
- * @param data.parameterOptionalStringWithNoDefault This is a optional string with no default
- * @param data.parameterStringWithDefault This is a string with default
- * @param data.parameterStringWithEmptyDefault This is a string with empty default
- * @param data.parameterStringNullableWithNoDefault This is a string that can be null with no default
- * @param data.parameterStringNullableWithDefault This is a string that can be null with default
- * @throws ApiError
- */
- public static callToTestOrderOfParams(data: CallToTestOrderOfParamsData): CancelablePromise {
- return __request(OpenAPI, {
- method: 'PUT',
- url: '/api/v{api-version}/defaults',
- query: {
- parameterOptionalStringWithDefault: data.parameterOptionalStringWithDefault,
- parameterOptionalStringWithEmptyDefault: data.parameterOptionalStringWithEmptyDefault,
- parameterOptionalStringWithNoDefault: data.parameterOptionalStringWithNoDefault,
- parameterStringWithDefault: data.parameterStringWithDefault,
- parameterStringWithEmptyDefault: data.parameterStringWithEmptyDefault,
- parameterStringWithNoDefault: data.parameterStringWithNoDefault,
- parameterStringNullableWithNoDefault: data.parameterStringNullableWithNoDefault,
- parameterStringNullableWithDefault: data.parameterStringNullableWithDefault
- }
- });
- }
-}
-
-export class Deprecated {
- /**
- * @deprecated
- * @param data The data for the request.
- * @param data.parameter This parameter is deprecated
- * @throws ApiError
- */
- public static deprecatedCall(data: DeprecatedCallData): CancelablePromise {
- return __request(OpenAPI, {
- method: 'POST',
- url: '/api/v{api-version}/parameters/deprecated',
- headers: {
- parameter: data.parameter
- }
- });
- }
-}
-
-export class Descriptions {
- /**
- * @param data The data for the request.
- * @param data.parameterWithBreaks Testing multiline comments in string: First line
- * Second line
- *
- * Fourth line
- * @param data.parameterWithBackticks Testing backticks in string: `backticks` and ```multiple backticks``` should work
- * @param data.parameterWithSlashes Testing slashes in string: \backwards\\\ and /forwards/// should work
- * @param data.parameterWithExpressionPlaceholders Testing expression placeholders in string: ${expression} should work
- * @param data.parameterWithQuotes Testing quotes in string: 'single quote''' and "double quotes""" should work
- * @param data.parameterWithReservedCharacters Testing reserved characters in string: * inline * and ** inline ** should work
- * @throws ApiError
- */
- public static callWithDescriptions(data: CallWithDescriptionsData = {}): CancelablePromise {
- return __request(OpenAPI, {
- method: 'POST',
- url: '/api/v{api-version}/descriptions/',
- query: {
- parameterWithBreaks: data.parameterWithBreaks,
- parameterWithBackticks: data.parameterWithBackticks,
- parameterWithSlashes: data.parameterWithSlashes,
- parameterWithExpressionPlaceholders: data.parameterWithExpressionPlaceholders,
- parameterWithQuotes: data.parameterWithQuotes,
- parameterWithReservedCharacters: data.parameterWithReservedCharacters
- }
- });
- }
-}
-
-export class Duplicate {
- /**
- * @throws ApiError
- */
- public static duplicateName(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'GET',
- url: '/api/v{api-version}/duplicate'
- });
- }
-
- /**
- * @throws ApiError
- */
- public static duplicateName1(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'POST',
- url: '/api/v{api-version}/duplicate'
- });
- }
-
- /**
- * @throws ApiError
- */
- public static duplicateName2(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'PUT',
- url: '/api/v{api-version}/duplicate'
- });
- }
-
- /**
- * @throws ApiError
- */
- public static duplicateName3(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'DELETE',
- url: '/api/v{api-version}/duplicate'
- });
- }
-}
-
-export class Error {
- /**
- * @param data The data for the request.
- * @param data.status Status code to return
- * @returns unknown Custom message: Successful response
- * @throws ApiError
- */
- public static testErrorCode(data: TestErrorCodeData): CancelablePromise {
- return __request(OpenAPI, {
- method: 'POST',
- url: '/api/v{api-version}/error',
- query: {
- status: data.status
- },
- errors: {
- 500: 'Custom message: Internal Server Error',
- 501: 'Custom message: Not Implemented',
- 502: 'Custom message: Bad Gateway',
- 503: 'Custom message: Service Unavailable'
- }
- });
- }
-}
-
-export class FileResponse {
- /**
- * @param data The data for the request.
- * @param data.id
- * @returns binary Success
- * @throws ApiError
- */
- public static fileResponse(data: FileResponseData): CancelablePromise {
- return __request(OpenAPI, {
- method: 'GET',
- url: '/api/v{api-version}/file/{id}',
- path: {
- id: data.id
- }
- });
- }
-}
-
-export class FormData {
- /**
- * @param data The data for the request.
- * @param data.parameter This is a reusable parameter
- * @param data.formData A reusable request body
- * @throws ApiError
- */
- public static postApiFormData(data: PostApiFormDataData = {}): CancelablePromise {
- return __request(OpenAPI, {
- method: 'POST',
- url: '/api/v{api-version}/formData/',
- query: {
- parameter: data.parameter
- },
- formData: data.formData,
- mediaType: 'multipart/form-data'
- });
- }
-}
-
-export class Header {
- /**
- * @returns string Successful response
- * @throws ApiError
- */
- public static callWithResultFromHeader(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'POST',
- url: '/api/v{api-version}/header',
- responseHeader: 'operation-location',
- errors: {
- 400: '400 server error',
- 500: '500 server error'
- }
- });
- }
-}
-
-export class Multipart {
- /**
- * @param data The data for the request.
- * @param data.formData
- * @throws ApiError
- */
- public static multipartRequest(data: MultipartRequestData = {}): CancelablePromise {
- return __request(OpenAPI, {
- method: 'POST',
- url: '/api/v{api-version}/multipart',
- formData: data.formData,
- mediaType: 'multipart/form-data'
- });
- }
-
- /**
- * @returns unknown OK
- * @throws ApiError
- */
- public static multipartResponse(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'GET',
- url: '/api/v{api-version}/multipart'
- });
- }
-}
-
-export class MultipleTags1 {
- /**
- * @returns _400
- * @throws ApiError
- */
- public static dummyA(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'GET',
- url: '/api/v{api-version}/multiple-tags/a'
- });
- }
-
- /**
- * @returns void Success
- * @throws ApiError
- */
- public static dummyB(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'GET',
- url: '/api/v{api-version}/multiple-tags/b'
- });
- }
-}
-
-export class MultipleTags2 {
- /**
- * @returns _400
- * @throws ApiError
- */
- public static dummyA(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'GET',
- url: '/api/v{api-version}/multiple-tags/a'
- });
- }
-
- /**
- * @returns void Success
- * @throws ApiError
- */
- public static dummyB(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'GET',
- url: '/api/v{api-version}/multiple-tags/b'
- });
- }
-}
-
-export class MultipleTags3 {
- /**
- * @returns void Success
- * @throws ApiError
- */
- public static dummyB(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'GET',
- url: '/api/v{api-version}/multiple-tags/b'
- });
- }
-}
-
-export class NoContent {
- /**
- * @returns void Success
- * @throws ApiError
- */
- public static callWithNoContentResponse(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'GET',
- url: '/api/v{api-version}/no-content'
- });
- }
-
- /**
- * @returns number Response is a simple number
- * @returns void Success
- * @throws ApiError
- */
- public static callWithResponseAndNoContentResponse(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'GET',
- url: '/api/v{api-version}/multiple-tags/response-and-no-content'
- });
- }
-}
-
-export class NonAsciiÆøåÆøÅöôêÊ {
- /**
- * @param data The data for the request.
- * @param data.nonAsciiParamæøåÆøÅöôêÊ Dummy input param
- * @returns NonAsciiStringæøåÆØÅöôêÊ字符串 Successful response
- * @throws ApiError
- */
- public static nonAsciiæøåÆøÅöôêÊ字符串(data: NonAsciiæøåÆøÅöôêÊ字符串Data): CancelablePromise {
- return __request(OpenAPI, {
- method: 'POST',
- url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串',
- query: {
- 'nonAsciiParamæøåÆØÅöôêÊ': data.nonAsciiParamæøåÆøÅöôêÊ
- }
- });
- }
-
- /**
- * Login User
- * @param data The data for the request.
- * @param data.formData
- * @throws ApiError
- */
- public static putWithFormUrlEncoded(data: PutWithFormUrlEncodedData): CancelablePromise {
- return __request(OpenAPI, {
- method: 'PUT',
- url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串',
- formData: data.formData,
- mediaType: 'application/x-www-form-urlencoded'
- });
- }
-}
-
-export class Parameters {
- /**
- * @param data The data for the request.
- * @param data.fooParam foo in method
- * @param data.barParam bar in method
- * @param data.xFooBar Parameter with illegal characters
- * @throws ApiError
- */
- public static deleteFoo(data: DeleteFooData3): CancelablePromise {
- return __request(OpenAPI, {
- method: 'DELETE',
- url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}',
- path: {
- foo_param: data.fooParam,
- BarParam: data.barParam
- },
- headers: {
- 'x-Foo-Bar': data.xFooBar
- }
- });
- }
-
- /**
- * @param data The data for the request.
- * @param data.parameterHeader This is the parameter that goes into the header
- * @param data.fooAllOfEnum
- * @param data.cursor This is the parameter that goes into the query params
- * @param data.parameterCookie This is the parameter that goes into the cookie
- * @param data.parameterPath This is the parameter that goes into the path
- * @param data.requestBody This is the parameter that goes into the body
- * @param data.fooRefEnum
- * @throws ApiError
- */
- public static callWithParameters(data: CallWithParametersData): CancelablePromise {
- return __request(OpenAPI, {
- method: 'POST',
- url: '/api/v{api-version}/parameters/{parameterPath}',
- path: {
- parameterPath: data.parameterPath
- },
- cookies: {
- parameterCookie: data.parameterCookie
- },
- headers: {
- parameterHeader: data.parameterHeader
- },
- query: {
- foo_ref_enum: data.fooRefEnum,
- foo_all_of_enum: data.fooAllOfEnum,
- cursor: data.cursor
- },
- body: data.requestBody,
- mediaType: 'application/json'
- });
- }
-
- /**
- * @param data The data for the request.
- * @param data.parameterHeader This is the parameter that goes into the request header
- * @param data.parameterQuery This is the parameter that goes into the request query params
- * @param data.parameterCookie This is the parameter that goes into the cookie
- * @param data.requestBody This is the parameter that goes into the body
- * @param data.parameterPath1 This is the parameter that goes into the path
- * @param data.parameterPath2 This is the parameter that goes into the path
- * @param data.parameterPath3 This is the parameter that goes into the path
- * @param data._default This is the parameter with a reserved keyword
- * @throws ApiError
- */
- public static callWithWeirdParameterNames(data: CallWithWeirdParameterNamesData): CancelablePromise {
- return __request(OpenAPI, {
- method: 'POST',
- url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}',
- path: {
- 'parameter.path.1': data.parameterPath1,
- 'parameter-path-2': data.parameterPath2,
- 'PARAMETER-PATH-3': data.parameterPath3
- },
- cookies: {
- 'PARAMETER-COOKIE': data.parameterCookie
- },
- headers: {
- 'parameter.header': data.parameterHeader
- },
- query: {
- default: data._default,
- 'parameter-query': data.parameterQuery
- },
- body: data.requestBody,
- mediaType: 'application/json'
- });
- }
-
- /**
- * @param data The data for the request.
- * @param data.requestBody This is a required parameter
- * @param data.page This is an optional parameter
- * @throws ApiError
- */
- public static getCallWithOptionalParam(data: GetCallWithOptionalParamData): CancelablePromise {
- return __request(OpenAPI, {
- method: 'GET',
- url: '/api/v{api-version}/parameters/',
- query: {
- page: data.page
- },
- body: data.requestBody,
- mediaType: 'application/json'
- });
- }
-
- /**
- * @param data The data for the request.
- * @param data.parameter This is a required parameter
- * @param data.requestBody This is an optional parameter
- * @returns number Response is a simple number
- * @returns void Success
- * @throws ApiError
- */
- public static postCallWithOptionalParam(data: PostCallWithOptionalParamData): CancelablePromise {
- return __request(OpenAPI, {
- method: 'POST',
- url: '/api/v{api-version}/parameters/',
- query: {
- parameter: data.parameter
- },
- body: data.requestBody,
- mediaType: 'application/json'
- });
- }
-}
-
-export class RequestBody {
- /**
- * @param data The data for the request.
- * @param data.parameter This is a reusable parameter
- * @param data.foo A reusable request body
- * @throws ApiError
- */
- public static postApiRequestBody(data: PostApiRequestBodyData = {}): CancelablePromise {
- return __request(OpenAPI, {
- method: 'POST',
- url: '/api/v{api-version}/requestBody/',
- query: {
- parameter: data.parameter
- },
- body: data.foo,
- mediaType: 'application/json'
- });
- }
-}
-
-export class Response {
- /**
- * @returns number Response is a simple number
- * @returns void Success
- * @throws ApiError
- */
- public static callWithResponseAndNoContentResponse(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'GET',
- url: '/api/v{api-version}/multiple-tags/response-and-no-content'
- });
- }
-
- /**
- * @returns import
- * @throws ApiError
- */
- public static callWithResponse(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'GET',
- url: '/api/v{api-version}/response'
- });
- }
-
- /**
- * @returns unknown Message for 200 response
- * @returns ModelWithString Message for 201 response
- * @returns ModelWithString Message for 202 response
- * @throws ApiError
- */
- public static callWithDuplicateResponses(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'POST',
- url: '/api/v{api-version}/response',
- errors: {
- 500: 'Message for 500 error',
- 501: 'Message for 501 error',
- 502: 'Message for 502 error',
- '4XX': 'Message for 4XX errors',
- default: 'Default error response'
- }
- });
- }
-
- /**
- * @returns unknown Message for 200 response
- * @returns ModelThatExtends Message for 201 response
- * @returns ModelThatExtendsExtends Message for 202 response
- * @throws ApiError
- */
- public static callWithResponses(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'PUT',
- url: '/api/v{api-version}/response',
- errors: {
- 500: 'Message for 500 error',
- 501: 'Message for 501 error',
- 502: 'Message for 502 error',
- default: 'Message for default response'
- }
- });
- }
-}
-
-export class Simple {
- /**
- * @returns Model_From_Zendesk Success
- * @throws ApiError
- */
- public static apiVVersionODataControllerCount(): CancelablePromise {
- return __request(OpenAPI, {
- method: 'GET',
- url: '/api/v{api-version}/simple/$count'
- });
- }
-
- /**
- * @throws ApiError
- */
- public static getCallWithoutParametersAndResponse(): CancelablePromise