tangled
alpha
login
or
join now
mokkenstorm.dev
/
openapi-ts
0
fork
atom
fork of hey-api/openapi-ts because I need some additional things
0
fork
atom
overview
issues
pulls
pipelines
refactor: client plugin use dsl
Lubos
3 months ago
f659b061
c01801f1
+2644
-2474
178 changed files
expand all
collapse all
unified
split
dev
openapi-ts.config.ts
examples
openapi-ts-fastify
src
client
client.gen.ts
openapi-ts-openai
src
client
client.gen.ts
openapi-ts-pinia-colada
src
client
client.gen.ts
openapi-ts-tanstack-vue-query
src
client
client.gen.ts
packages
openapi-ts
src
plugins
@hey-api
client-core
client.ts
createClientConfig.ts
schemas
plugin.ts
transformers
expressions.ts
plugin.ts
ts-dsl
array.ts
as.ts
attr.ts
base.ts
binary.ts
call.ts
class.ts
expr.ts
field.ts
func.ts
getter.ts
index.ts
init.ts
literal.ts
method.ts
mixins
apply.ts
as.ts
doc.ts
expr.ts
hint.ts
note.ts
type-expr.ts
object.ts
setter.ts
toExpr.ts
toStmt.ts
type
func.ts
object.ts
var.ts
openapi-ts-tests
main
test
__snapshots__
2.0.x
plugins
@angular
common
default
client.gen.ts
default-class
client.gen.ts
@hey-api
client-fetch
sdk-nested-classes
client.gen.ts
sdk-nested-classes-instance
client.gen.ts
schemas
default
schemas.gen.ts
sdk
default
client.gen.ts
throwOnError
client.gen.ts
@pinia
colada
fetch
client.gen.ts
@tanstack
angular-query-experimental
axios
client.gen.ts
fetch
client.gen.ts
react-query
axios
client.gen.ts
fetch
client.gen.ts
solid-query
axios
client.gen.ts
fetch
client.gen.ts
svelte-query
axios
client.gen.ts
fetch
client.gen.ts
vue-query
axios
client.gen.ts
fetch
client.gen.ts
servers
client.gen.ts
servers-base-path
client.gen.ts
3.0.x
plugins
@angular
common
default
client.gen.ts
default-class
client.gen.ts
@hey-api
client-fetch
sdk-nested-classes
client.gen.ts
sdk-nested-classes-instance
client.gen.ts
schemas
default
schemas.gen.ts
sdk
default
client.gen.ts
throwOnError
client.gen.ts
@pinia
colada
fetch
client.gen.ts
@tanstack
angular-query-experimental
axios
client.gen.ts
fetch
client.gen.ts
react-query
axios
client.gen.ts
fetch
client.gen.ts
solid-query
axios
client.gen.ts
fetch
client.gen.ts
svelte-query
axios
client.gen.ts
fetch
client.gen.ts
vue-query
axios
client.gen.ts
fetch
client.gen.ts
servers
client.gen.ts
transformers-all-of
transformers.gen.ts
transformers-any-of-null
transformers.gen.ts
transformers-recursive
transformers.gen.ts
3.1.x
clients
@hey-api
client-angular
base-url-number
client.gen.ts
base-url-strict
client.gen.ts
base-url-string
client.gen.ts
clean-false
client.gen.ts
default
client.gen.ts
import-file-extension-ts
client.gen.ts
sdk-client-optional
client.gen.ts
sdk-client-required
client.gen.ts
tsconfig-nodenext-sdk
client.gen.ts
client-axios
base-url-number
client.gen.ts
base-url-strict
client.gen.ts
base-url-string
client.gen.ts
clean-false
client.gen.ts
default
client.gen.ts
import-file-extension-ts
client.gen.ts
sdk-client-optional
client.gen.ts
sdk-client-required
client.gen.ts
tsconfig-nodenext-sdk
client.gen.ts
client-fetch
base-url-number
client.gen.ts
base-url-strict
client.gen.ts
base-url-string
client.gen.ts
clean-false
client.gen.ts
default
client.gen.ts
import-file-extension-ts
client.gen.ts
sdk-client-optional
client.gen.ts
sdk-client-required
client.gen.ts
tsconfig-nodenext-sdk
client.gen.ts
client-ky
base-url-number
client.gen.ts
base-url-strict
client.gen.ts
base-url-string
client.gen.ts
clean-false
client.gen.ts
default
client.gen.ts
import-file-extension-ts
client.gen.ts
sdk-client-optional
client.gen.ts
sdk-client-required
client.gen.ts
tsconfig-nodenext-sdk
client.gen.ts
client-next
base-url-number
client.gen.ts
base-url-strict
client.gen.ts
base-url-string
client.gen.ts
clean-false
client.gen.ts
default
client.gen.ts
import-file-extension-ts
client.gen.ts
sdk-client-optional
client.gen.ts
sdk-client-required
client.gen.ts
tsconfig-nodenext-sdk
client.gen.ts
client-nuxt
base-url-number
client.gen.ts
base-url-strict
client.gen.ts
base-url-string
client.gen.ts
clean-false
client.gen.ts
default
client.gen.ts
import-file-extension-ts
client.gen.ts
sdk-client-optional
client.gen.ts
sdk-client-required
client.gen.ts
tsconfig-nodenext-sdk
client.gen.ts
client-ofetch
base-url-number
client.gen.ts
base-url-strict
client.gen.ts
base-url-string
client.gen.ts
clean-false
client.gen.ts
default
client.gen.ts
import-file-extension-ts
client.gen.ts
sdk-client-optional
client.gen.ts
sdk-client-required
client.gen.ts
tsconfig-nodenext-sdk
client.gen.ts
client-custom
base-url-number
custom-client.gen.ts
base-url-strict
custom-client.gen.ts
base-url-string
custom-client.gen.ts
bundle
custom-client.gen.ts
default
custom-client.gen.ts
sdk-client-optional
custom-client.gen.ts
sdk-client-required
custom-client.gen.ts
my-client
base-url-number
custom.gen.ts
base-url-strict
custom.gen.ts
base-url-string
custom.gen.ts
bundle
custom.gen.ts
default
custom.gen.ts
sdk-client-optional
custom.gen.ts
sdk-client-required
custom.gen.ts
plugins
@angular
common
default
client.gen.ts
default-class
client.gen.ts
@hey-api
schemas
default
schemas.gen.ts
sdk
default
client.gen.ts
throwOnError
client.gen.ts
@pinia
colada
fetch
client.gen.ts
@tanstack
angular-query-experimental
axios
client.gen.ts
fetch
client.gen.ts
react-query
axios
client.gen.ts
fetch
client.gen.ts
solid-query
axios
client.gen.ts
fetch
client.gen.ts
svelte-query
axios
client.gen.ts
fetch
client.gen.ts
vue-query
axios
client.gen.ts
fetch
client.gen.ts
servers
client.gen.ts
transformers-all-of
transformers.gen.ts
transformers-any-of-null
transformers.gen.ts
transformers-recursive
transformers.gen.ts
+4
-4
dev/openapi-ts.config.ts
···
40
40
// 'circular.yaml',
41
41
// 'dutchie.json',
42
42
// 'invalid',
43
43
-
'full.yaml',
43
43
+
// 'full.yaml',
44
44
// 'openai.yaml',
45
45
// 'opencode.yaml',
46
46
// 'pagination-ref.yaml',
47
47
// 'sdk-instance.yaml',
48
48
// 'string-with-format.yaml',
49
49
-
// 'transformers.json',
49
49
+
'transformers.json',
50
50
// 'type-format.yaml',
51
51
// 'validators.yaml',
52
52
// 'validators-circular-ref.json',
···
216
216
{
217
217
// baseUrl: false,
218
218
// exportFromIndex: true,
219
219
-
name: '@hey-api/client-nuxt',
219
219
+
name: '@hey-api/client-fetch',
220
220
// runtimeConfigPath: path.resolve(__dirname, 'hey-api.ts'),
221
221
// runtimeConfigPath: './src/hey-api.ts',
222
222
// strictBaseUrl: true,
···
292
292
{
293
293
// bigInt: true,
294
294
dates: true,
295
295
-
// name: '@hey-api/transformers',
295
295
+
name: '@hey-api/transformers',
296
296
},
297
297
{
298
298
// name: 'fastify',
+1
-3
examples/openapi-ts-fastify/src/client/client.gen.ts
···
21
21
) => Config<Required<ClientOptions> & T>;
22
22
23
23
export const client = createClient(
24
24
-
createConfig<ClientOptions2>({
25
25
-
baseUrl: 'http://petstore.swagger.io/v1',
26
26
-
}),
24
24
+
createConfig<ClientOptions2>({ baseUrl: 'http://petstore.swagger.io/v1' }),
27
25
);
+1
-3
examples/openapi-ts-openai/src/client/client.gen.ts
···
21
21
) => Config<Required<ClientOptions> & T>;
22
22
23
23
export const client = createClient(
24
24
-
createConfig<ClientOptions2>({
25
25
-
baseUrl: 'https://api.openai.com/v1',
26
26
-
}),
24
24
+
createConfig<ClientOptions2>({ baseUrl: 'https://api.openai.com/v1' }),
27
25
);
+1
-3
examples/openapi-ts-pinia-colada/src/client/client.gen.ts
···
16
16
) => Config<Required<ClientOptions> & T>
17
17
18
18
export const client = createClient(
19
19
-
createConfig<ClientOptions2>({
20
20
-
baseUrl: 'https://petstore3.swagger.io/api/v3'
21
21
-
})
19
19
+
createConfig<ClientOptions2>({ baseUrl: 'https://petstore3.swagger.io/api/v3' })
22
20
)
+1
-3
examples/openapi-ts-tanstack-vue-query/src/client/client.gen.ts
···
16
16
) => Config<Required<ClientOptions> & T>
17
17
18
18
export const client = createClient(
19
19
-
createConfig<ClientOptions2>({
20
20
-
baseUrl: 'https://petstore3.swagger.io/api/v3'
21
21
-
})
19
19
+
createConfig<ClientOptions2>({ baseUrl: 'https://petstore3.swagger.io/api/v3' })
22
20
)
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default-class/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'https://api.example.com/v1'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "https://api.example.com/v1" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'https://api.example.com/v1'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "https://api.example.com/v1" }));
+348
-273
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/schemas/default/schemas.gen.ts
···
1
1
// This file is auto-generated by @hey-api/openapi-ts
2
2
3
3
export const ExternalRefASchema = {
4
4
-
description: 'External ref to shared model (A)',
5
5
-
'$ref': '#/definitions/external-shared_ExternalSharedModel'
4
4
+
description: "External ref to shared model (A)",
5
5
+
'$ref': "#/definitions/external-shared_ExternalSharedModel"
6
6
} as const;
7
7
8
8
export const ExternalRefBSchema = {
9
9
-
description: 'External ref to shared model (B)',
10
10
-
'$ref': '#/definitions/external-shared_ExternalSharedModel'
9
9
+
description: "External ref to shared model (B)",
10
10
+
'$ref': "#/definitions/external-shared_ExternalSharedModel"
11
11
} as const;
12
12
13
13
export const CommentWithBreaksSchema = {
14
14
-
description: `Testing multiline comments in string: First line
15
15
-
Second line
16
16
-
17
17
-
Fourth line`,
18
18
-
type: 'integer'
14
14
+
description: "Testing multiline comments in string: First line\nSecond line\n\nFourth line",
15
15
+
type: "integer"
19
16
} as const;
20
17
21
18
export const CommentWithBackticksSchema = {
22
22
-
description: 'Testing backticks in string: `backticks` and ```multiple backticks``` should work',
23
23
-
type: 'integer'
19
19
+
description: "Testing backticks in string: `backticks` and ```multiple backticks``` should work",
20
20
+
type: "integer"
24
21
} as const;
25
22
26
23
export const CommentWithBackticksAndQuotesSchema = {
27
27
-
description: `Testing backticks and quotes in string: \`backticks\`, 'quotes', "double quotes" and \`\`\`multiple backticks\`\`\` should work`,
28
28
-
type: 'integer'
24
24
+
description: "Testing backticks and quotes in string: `backticks`, 'quotes', \"double quotes\" and ```multiple backticks``` should work",
25
25
+
type: "integer"
29
26
} as const;
30
27
31
28
export const CommentWithSlashesSchema = {
32
32
-
description: 'Testing slashes in string: \\backwards\\\\\\ and /forwards/// should work',
33
33
-
type: 'integer'
29
29
+
description: "Testing slashes in string: \\backwards\\\\\\ and /forwards/// should work",
30
30
+
type: "integer"
34
31
} as const;
35
32
36
33
export const CommentWithExpressionPlaceholdersSchema = {
37
37
-
description: 'Testing expression placeholders in string: ${expression} should work',
38
38
-
type: 'integer'
34
34
+
description: "Testing expression placeholders in string: ${expression} should work",
35
35
+
type: "integer"
39
36
} as const;
40
37
41
38
export const CommentWithQuotesSchema = {
42
42
-
description: `Testing quotes in string: 'single quote''' and "double quotes""" should work`,
43
43
-
type: 'integer'
39
39
+
description: "Testing quotes in string: 'single quote''' and \"double quotes\"\"\" should work",
40
40
+
type: "integer"
44
41
} as const;
45
42
46
43
export const CommentWithReservedCharactersSchema = {
47
47
-
description: 'Testing reserved characters in string: /* inline */ and /** inline **/ should work',
48
48
-
type: 'integer'
44
44
+
description: "Testing reserved characters in string: /* inline */ and /** inline **/ should work",
45
45
+
type: "integer"
49
46
} as const;
50
47
51
48
export const SimpleIntegerSchema = {
52
52
-
description: 'This is a simple number',
53
53
-
type: 'integer'
49
49
+
description: "This is a simple number",
50
50
+
type: "integer"
54
51
} as const;
55
52
56
53
export const SimpleBooleanSchema = {
57
57
-
description: 'This is a simple boolean',
58
58
-
type: 'boolean'
54
54
+
description: "This is a simple boolean",
55
55
+
type: "boolean"
59
56
} as const;
60
57
61
58
export const SimpleStringSchema = {
62
62
-
description: 'This is a simple string',
63
63
-
type: 'string'
59
59
+
description: "This is a simple string",
60
60
+
type: "string"
64
61
} as const;
65
62
66
63
export const NonAsciiStringæøåÆØÅöôêÊ字符串Schema = {
67
67
-
description: 'A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串)',
68
68
-
type: 'string'
64
64
+
description: "A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串)",
65
65
+
type: "string"
69
66
} as const;
70
67
71
68
export const SimpleFileSchema = {
72
72
-
description: 'This is a simple file',
73
73
-
format: 'binary',
74
74
-
type: 'string'
69
69
+
description: "This is a simple file",
70
70
+
format: "binary",
71
71
+
type: "string"
75
72
} as const;
76
73
77
74
export const SimpleReferenceSchema = {
78
78
-
description: 'This is a simple reference',
79
79
-
'$ref': '#/definitions/ModelWithString'
75
75
+
description: "This is a simple reference",
76
76
+
'$ref': "#/definitions/ModelWithString"
80
77
} as const;
81
78
82
79
export const SimpleStringWithPatternSchema = {
83
83
-
description: 'This is a simple string',
84
84
-
type: 'string',
80
80
+
description: "This is a simple string",
81
81
+
type: "string",
85
82
maxLength: 64,
86
86
-
pattern: '^[a-zA-Z0-9_]*$'
83
83
+
pattern: "^[a-zA-Z0-9_]*$"
87
84
} as const;
88
85
89
86
export const EnumWithStringsSchema = {
90
90
-
description: 'This is a simple enum with strings',
91
91
-
enum: ['Success', 'Warning', 'Error', "'Single Quote'", '"Double Quotes"', 'Non-ascii: øæåôöØÆÅÔÖ字符串']
87
87
+
description: "This is a simple enum with strings",
88
88
+
enum: [
89
89
+
"Success",
90
90
+
"Warning",
91
91
+
"Error",
92
92
+
"'Single Quote'",
93
93
+
"\"Double Quotes\"",
94
94
+
"Non-ascii: øæåôöØÆÅÔÖ字符串"
95
95
+
]
92
96
} as const;
93
97
94
98
export const EnumWithNumbersSchema = {
95
95
-
description: 'This is a simple enum with numbers',
96
96
-
enum: [1, 2, 3, 1.1, 1.2, 1.3, 100, 200, 300, -100, -200, -300, -1.1, -1.2, -1.3]
99
99
+
description: "This is a simple enum with numbers",
100
100
+
enum: [
101
101
+
1,
102
102
+
2,
103
103
+
3,
104
104
+
1.1,
105
105
+
1.2,
106
106
+
1.3,
107
107
+
100,
108
108
+
200,
109
109
+
300,
110
110
+
-100,
111
111
+
-200,
112
112
+
-300,
113
113
+
-1.1,
114
114
+
-1.2,
115
115
+
-1.3
116
116
+
]
97
117
} as const;
98
118
99
119
export const EnumFromDescriptionSchema = {
100
100
-
description: 'Success=1,Warning=2,Error=3',
101
101
-
type: 'number'
120
120
+
description: "Success=1,Warning=2,Error=3",
121
121
+
type: "number"
102
122
} as const;
103
123
104
124
export const EnumWithExtensionsSchema = {
105
105
-
description: 'This is a simple enum with numbers',
106
106
-
enum: [200, 400, 500],
107
107
-
'x-enum-varnames': ['CUSTOM_SUCCESS', 'CUSTOM_WARNING', 'CUSTOM_ERROR'],
108
108
-
'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']
125
125
+
description: "This is a simple enum with numbers",
126
126
+
enum: [
127
127
+
200,
128
128
+
400,
129
129
+
500
130
130
+
],
131
131
+
'x-enum-varnames': [
132
132
+
"CUSTOM_SUCCESS",
133
133
+
"CUSTOM_WARNING",
134
134
+
"CUSTOM_ERROR"
135
135
+
],
136
136
+
'x-enum-descriptions': [
137
137
+
"Used when the status of something is successful",
138
138
+
"Used when the status of something has a warning",
139
139
+
"Used when the status of something has an error"
140
140
+
]
109
141
} as const;
110
142
111
143
export const ArrayWithNumbersSchema = {
112
112
-
description: 'This is a simple array with numbers',
113
113
-
type: 'array',
144
144
+
description: "This is a simple array with numbers",
145
145
+
type: "array",
114
146
items: {
115
115
-
type: 'integer'
147
147
+
type: "integer"
116
148
}
117
149
} as const;
118
150
119
151
export const ArrayWithBooleansSchema = {
120
120
-
description: 'This is a simple array with booleans',
121
121
-
type: 'array',
152
152
+
description: "This is a simple array with booleans",
153
153
+
type: "array",
122
154
items: {
123
123
-
type: 'boolean'
155
155
+
type: "boolean"
124
156
}
125
157
} as const;
126
158
127
159
export const ArrayWithStringsSchema = {
128
128
-
description: 'This is a simple array with strings',
129
129
-
type: 'array',
160
160
+
description: "This is a simple array with strings",
161
161
+
type: "array",
130
162
items: {
131
131
-
type: 'string'
163
163
+
type: "string"
132
164
}
133
165
} as const;
134
166
135
167
export const ArrayWithReferencesSchema = {
136
136
-
description: 'This is a simple array with references',
137
137
-
type: 'array',
168
168
+
description: "This is a simple array with references",
169
169
+
type: "array",
138
170
items: {
139
139
-
'$ref': '#/definitions/ModelWithString'
171
171
+
'$ref': "#/definitions/ModelWithString"
140
172
}
141
173
} as const;
142
174
143
175
export const ArrayWithArraySchema = {
144
144
-
description: 'This is a simple array containing an array',
145
145
-
type: 'array',
176
176
+
description: "This is a simple array containing an array",
177
177
+
type: "array",
146
178
items: {
147
147
-
type: 'array',
179
179
+
type: "array",
148
180
items: {
149
149
-
'$ref': '#/definitions/ModelWithString'
181
181
+
'$ref': "#/definitions/ModelWithString"
150
182
}
151
183
}
152
184
} as const;
153
185
154
186
export const ArrayWithPropertiesSchema = {
155
155
-
description: 'This is a simple array with properties',
156
156
-
type: 'array',
187
187
+
description: "This is a simple array with properties",
188
188
+
type: "array",
157
189
items: {
158
158
-
type: 'object',
190
190
+
type: "object",
159
191
properties: {
160
192
foo: {
161
161
-
type: 'string'
193
193
+
type: "string"
162
194
},
163
195
bar: {
164
164
-
type: 'string'
196
196
+
type: "string"
165
197
}
166
198
}
167
199
}
168
200
} as const;
169
201
170
202
export const DictionaryWithStringSchema = {
171
171
-
description: 'This is a string dictionary',
172
172
-
type: 'object',
203
203
+
description: "This is a string dictionary",
204
204
+
type: "object",
173
205
additionalProperties: {
174
174
-
type: 'string'
206
206
+
type: "string"
175
207
}
176
208
} as const;
177
209
178
210
export const DictionaryWithReferenceSchema = {
179
179
-
description: 'This is a string reference',
180
180
-
type: 'object',
211
211
+
description: "This is a string reference",
212
212
+
type: "object",
181
213
additionalProperties: {
182
182
-
'$ref': '#/definitions/ModelWithString'
214
214
+
'$ref': "#/definitions/ModelWithString"
183
215
}
184
216
} as const;
185
217
186
218
export const DictionaryWithArraySchema = {
187
187
-
description: 'This is a complex dictionary',
188
188
-
type: 'object',
219
219
+
description: "This is a complex dictionary",
220
220
+
type: "object",
189
221
additionalProperties: {
190
190
-
type: 'array',
222
222
+
type: "array",
191
223
items: {
192
192
-
'$ref': '#/definitions/ModelWithString'
224
224
+
'$ref': "#/definitions/ModelWithString"
193
225
}
194
226
}
195
227
} as const;
196
228
197
229
export const DictionaryWithDictionarySchema = {
198
198
-
description: 'This is a string dictionary',
199
199
-
type: 'object',
230
230
+
description: "This is a string dictionary",
231
231
+
type: "object",
200
232
additionalProperties: {
201
201
-
type: 'object',
233
233
+
type: "object",
202
234
additionalProperties: {
203
203
-
type: 'string'
235
235
+
type: "string"
204
236
}
205
237
}
206
238
} as const;
207
239
208
240
export const DictionaryWithPropertiesSchema = {
209
209
-
description: 'This is a complex dictionary',
210
210
-
type: 'object',
241
241
+
description: "This is a complex dictionary",
242
242
+
type: "object",
211
243
additionalProperties: {
212
212
-
type: 'object',
244
244
+
type: "object",
213
245
properties: {
214
246
foo: {
215
215
-
type: 'string'
247
247
+
type: "string"
216
248
},
217
249
bar: {
218
218
-
type: 'string'
250
250
+
type: "string"
219
251
}
220
252
}
221
253
}
222
254
} as const;
223
255
224
256
export const DateSchema = {
225
225
-
description: 'This is a type-only model that defines Date as a string',
226
226
-
type: 'string'
257
257
+
description: "This is a type-only model that defines Date as a string",
258
258
+
type: "string"
227
259
} as const;
228
260
229
261
export const ModelWithIntegerSchema = {
230
230
-
description: 'This is a model with one number property',
231
231
-
type: 'object',
262
262
+
description: "This is a model with one number property",
263
263
+
type: "object",
232
264
properties: {
233
265
prop: {
234
234
-
description: 'This is a simple number property',
235
235
-
type: 'integer'
266
266
+
description: "This is a simple number property",
267
267
+
type: "integer"
236
268
}
237
269
}
238
270
} as const;
239
271
240
272
export const ModelWithBooleanSchema = {
241
241
-
description: 'This is a model with one boolean property',
242
242
-
type: 'object',
273
273
+
description: "This is a model with one boolean property",
274
274
+
type: "object",
243
275
properties: {
244
276
prop: {
245
245
-
description: 'This is a simple boolean property',
246
246
-
type: 'boolean'
277
277
+
description: "This is a simple boolean property",
278
278
+
type: "boolean"
247
279
}
248
280
}
249
281
} as const;
250
282
251
283
export const ModelWithStringSchema = {
252
252
-
description: 'This is a model with one string property',
253
253
-
type: 'object',
284
284
+
description: "This is a model with one string property",
285
285
+
type: "object",
254
286
properties: {
255
287
prop: {
256
256
-
description: 'This is a simple string property',
257
257
-
type: 'string'
288
288
+
description: "This is a simple string property",
289
289
+
type: "string"
258
290
}
259
291
}
260
292
} as const;
261
293
262
294
export const ModelWithStringErrorSchema = {
263
263
-
description: 'This is a model with one string property',
264
264
-
type: 'object',
295
295
+
description: "This is a model with one string property",
296
296
+
type: "object",
265
297
properties: {
266
298
prop: {
267
267
-
description: 'This is a simple string property',
268
268
-
type: 'string'
299
299
+
description: "This is a simple string property",
300
300
+
type: "string"
269
301
}
270
302
}
271
303
} as const;
272
304
273
305
export const ModelWithNullableStringSchema = {
274
274
-
description: 'This is a model with one string property',
275
275
-
type: 'object',
276
276
-
required: ['nullableRequiredProp'],
306
306
+
description: "This is a model with one string property",
307
307
+
type: "object",
308
308
+
required: [
309
309
+
"nullableRequiredProp"
310
310
+
],
277
311
properties: {
278
312
nullableProp: {
279
279
-
description: 'This is a simple string property',
280
280
-
type: 'string',
313
313
+
description: "This is a simple string property",
314
314
+
type: "string",
281
315
'x-nullable': true
282
316
},
283
317
nullableRequiredProp: {
284
284
-
description: 'This is a simple string property',
285
285
-
type: 'string',
318
318
+
description: "This is a simple string property",
319
319
+
type: "string",
286
320
'x-nullable': true
287
321
}
288
322
}
289
323
} as const;
290
324
291
325
export const ModelWithEnumSchema = {
292
292
-
description: 'This is a model with one enum',
293
293
-
type: 'object',
326
326
+
description: "This is a model with one enum",
327
327
+
type: "object",
294
328
properties: {
295
329
test: {
296
296
-
description: 'This is a simple enum with strings',
297
297
-
enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串']
330
330
+
description: "This is a simple enum with strings",
331
331
+
enum: [
332
332
+
"Success",
333
333
+
"Warning",
334
334
+
"Error",
335
335
+
"ØÆÅ字符串"
336
336
+
]
298
337
},
299
338
statusCode: {
300
300
-
description: 'These are the HTTP error code enums',
301
301
-
enum: ['100', '200 FOO', '300 FOO_BAR', '400 foo-bar', '500 foo.bar', '600 foo&bar']
339
339
+
description: "These are the HTTP error code enums",
340
340
+
enum: [
341
341
+
"100",
342
342
+
"200 FOO",
343
343
+
"300 FOO_BAR",
344
344
+
"400 foo-bar",
345
345
+
"500 foo.bar",
346
346
+
"600 foo&bar"
347
347
+
]
302
348
},
303
349
bool: {
304
304
-
description: 'Simple boolean enum',
305
305
-
type: 'boolean',
306
306
-
enum: [true]
350
350
+
description: "Simple boolean enum",
351
351
+
type: "boolean",
352
352
+
enum: [
353
353
+
true
354
354
+
]
307
355
}
308
356
}
309
357
} as const;
310
358
311
359
export const ModelWithEnumFromDescriptionSchema = {
312
312
-
description: 'This is a model with one enum',
313
313
-
type: 'object',
360
360
+
description: "This is a model with one enum",
361
361
+
type: "object",
314
362
properties: {
315
363
test: {
316
316
-
type: 'integer',
317
317
-
description: 'Success=1,Warning=2,Error=3'
364
364
+
type: "integer",
365
365
+
description: "Success=1,Warning=2,Error=3"
318
366
}
319
367
}
320
368
} as const;
321
369
322
370
export const ModelWithNestedEnumsSchema = {
323
323
-
description: 'This is a model with nested enums',
324
324
-
type: 'object',
371
371
+
description: "This is a model with nested enums",
372
372
+
type: "object",
325
373
properties: {
326
374
dictionaryWithEnum: {
327
327
-
type: 'object',
375
375
+
type: "object",
328
376
additionalProperties: {
329
329
-
enum: ['Success', 'Warning', 'Error']
377
377
+
enum: [
378
378
+
"Success",
379
379
+
"Warning",
380
380
+
"Error"
381
381
+
]
330
382
}
331
383
},
332
384
dictionaryWithEnumFromDescription: {
333
333
-
type: 'object',
385
385
+
type: "object",
334
386
additionalProperties: {
335
335
-
type: 'integer',
336
336
-
description: 'Success=1,Warning=2,Error=3'
387
387
+
type: "integer",
388
388
+
description: "Success=1,Warning=2,Error=3"
337
389
}
338
390
},
339
391
arrayWithEnum: {
340
340
-
type: 'array',
392
392
+
type: "array",
341
393
items: {
342
342
-
enum: ['Success', 'Warning', 'Error']
394
394
+
enum: [
395
395
+
"Success",
396
396
+
"Warning",
397
397
+
"Error"
398
398
+
]
343
399
}
344
400
},
345
401
arrayWithDescription: {
346
346
-
type: 'array',
402
402
+
type: "array",
347
403
items: {
348
348
-
type: 'integer',
349
349
-
description: 'Success=1,Warning=2,Error=3'
404
404
+
type: "integer",
405
405
+
description: "Success=1,Warning=2,Error=3"
350
406
}
351
407
}
352
408
}
353
409
} as const;
354
410
355
411
export const ModelWithReferenceSchema = {
356
356
-
description: 'This is a model with one property containing a reference',
357
357
-
type: 'object',
412
412
+
description: "This is a model with one property containing a reference",
413
413
+
type: "object",
358
414
properties: {
359
415
prop: {
360
360
-
'$ref': '#/definitions/ModelWithProperties'
416
416
+
'$ref': "#/definitions/ModelWithProperties"
361
417
}
362
418
}
363
419
} as const;
364
420
365
421
export const ModelWithArraySchema = {
366
366
-
description: 'This is a model with one property containing an array',
367
367
-
type: 'object',
422
422
+
description: "This is a model with one property containing an array",
423
423
+
type: "object",
368
424
properties: {
369
425
prop: {
370
370
-
type: 'array',
426
426
+
type: "array",
371
427
items: {
372
372
-
'$ref': '#/definitions/ModelWithString'
428
428
+
'$ref': "#/definitions/ModelWithString"
373
429
}
374
430
},
375
431
propWithFile: {
376
376
-
type: 'array',
432
432
+
type: "array",
377
433
items: {
378
378
-
format: 'binary',
379
379
-
type: 'string'
434
434
+
format: "binary",
435
435
+
type: "string"
380
436
}
381
437
},
382
438
propWithNumber: {
383
383
-
type: 'array',
439
439
+
type: "array",
384
440
items: {
385
385
-
type: 'number'
441
441
+
type: "number"
386
442
}
387
443
}
388
444
}
389
445
} as const;
390
446
391
447
export const ModelWithDictionarySchema = {
392
392
-
description: 'This is a model with one property containing a dictionary',
393
393
-
type: 'object',
448
448
+
description: "This is a model with one property containing a dictionary",
449
449
+
type: "object",
394
450
properties: {
395
451
prop: {
396
396
-
type: 'object',
452
452
+
type: "object",
397
453
additionalProperties: {
398
398
-
type: 'string'
454
454
+
type: "string"
399
455
}
400
456
}
401
457
}
402
458
} as const;
403
459
404
460
export const ModelWithCircularReferenceSchema = {
405
405
-
description: 'This is a model with one property containing a circular reference',
406
406
-
type: 'object',
461
461
+
description: "This is a model with one property containing a circular reference",
462
462
+
type: "object",
407
463
properties: {
408
464
prop: {
409
409
-
'$ref': '#/definitions/ModelWithCircularReference'
465
465
+
'$ref': "#/definitions/ModelWithCircularReference"
410
466
}
411
467
}
412
468
} as const;
413
469
414
470
export const ModelWithPropertiesSchema = {
415
415
-
description: 'This is a model with one nested property',
416
416
-
type: 'object',
417
417
-
required: ['required', 'requiredAndReadOnly'],
471
471
+
description: "This is a model with one nested property",
472
472
+
type: "object",
473
473
+
required: [
474
474
+
"required",
475
475
+
"requiredAndReadOnly"
476
476
+
],
418
477
properties: {
419
478
required: {
420
420
-
type: 'string'
479
479
+
type: "string"
421
480
},
422
481
requiredAndReadOnly: {
423
423
-
type: 'string',
482
482
+
type: "string",
424
483
readOnly: true
425
484
},
426
485
string: {
427
427
-
type: 'string'
486
486
+
type: "string"
428
487
},
429
488
number: {
430
430
-
type: 'number'
489
489
+
type: "number"
431
490
},
432
491
boolean: {
433
433
-
type: 'boolean'
492
492
+
type: "boolean"
434
493
},
435
494
reference: {
436
436
-
'$ref': '#/definitions/ModelWithString'
495
495
+
'$ref': "#/definitions/ModelWithString"
437
496
},
438
497
'property with space': {
439
439
-
type: 'string'
498
498
+
type: "string"
440
499
},
441
500
default: {
442
442
-
type: 'string'
501
501
+
type: "string"
443
502
},
444
503
try: {
445
445
-
type: 'string'
504
504
+
type: "string"
446
505
},
447
506
'@namespace.string': {
448
448
-
type: 'string',
507
507
+
type: "string",
449
508
readOnly: true
450
509
},
451
510
'@namespace.integer': {
452
452
-
type: 'integer',
511
511
+
type: "integer",
453
512
readOnly: true
454
513
}
455
514
}
456
515
} as const;
457
516
458
517
export const ModelWithNestedPropertiesSchema = {
459
459
-
description: 'This is a model with one nested property',
460
460
-
type: 'object',
461
461
-
required: ['first'],
518
518
+
description: "This is a model with one nested property",
519
519
+
type: "object",
520
520
+
required: [
521
521
+
"first"
522
522
+
],
462
523
properties: {
463
524
first: {
464
464
-
type: 'object',
465
465
-
required: ['second'],
525
525
+
type: "object",
526
526
+
required: [
527
527
+
"second"
528
528
+
],
466
529
readOnly: true,
467
530
properties: {
468
531
second: {
469
469
-
type: 'object',
470
470
-
required: ['third'],
532
532
+
type: "object",
533
533
+
required: [
534
534
+
"third"
535
535
+
],
471
536
readOnly: true,
472
537
properties: {
473
538
third: {
474
474
-
type: 'string',
539
539
+
type: "string",
475
540
readOnly: true
476
541
}
477
542
}
···
482
547
} as const;
483
548
484
549
export const ModelWithDuplicatePropertiesSchema = {
485
485
-
description: 'This is a model with duplicated properties',
486
486
-
type: 'object',
550
550
+
description: "This is a model with duplicated properties",
551
551
+
type: "object",
487
552
properties: {
488
553
prop: {
489
489
-
'$ref': '#/definitions/ModelWithString'
554
554
+
'$ref': "#/definitions/ModelWithString"
490
555
}
491
556
}
492
557
} as const;
493
558
494
559
export const ModelWithOrderedPropertiesSchema = {
495
495
-
description: 'This is a model with ordered properties',
496
496
-
type: 'object',
560
560
+
description: "This is a model with ordered properties",
561
561
+
type: "object",
497
562
properties: {
498
563
zebra: {
499
499
-
type: 'string'
564
564
+
type: "string"
500
565
},
501
566
apple: {
502
502
-
type: 'string'
567
567
+
type: "string"
503
568
},
504
569
hawaii: {
505
505
-
type: 'string'
570
570
+
type: "string"
506
571
}
507
572
}
508
573
} as const;
509
574
510
575
export const ModelWithDuplicateImportsSchema = {
511
511
-
description: 'This is a model with duplicated imports',
512
512
-
type: 'object',
576
576
+
description: "This is a model with duplicated imports",
577
577
+
type: "object",
513
578
properties: {
514
579
propA: {
515
515
-
'$ref': '#/definitions/ModelWithString'
580
580
+
'$ref': "#/definitions/ModelWithString"
516
581
},
517
582
propB: {
518
518
-
'$ref': '#/definitions/ModelWithString'
583
583
+
'$ref': "#/definitions/ModelWithString"
519
584
},
520
585
propC: {
521
521
-
'$ref': '#/definitions/ModelWithString'
586
586
+
'$ref': "#/definitions/ModelWithString"
522
587
}
523
588
}
524
589
} as const;
525
590
526
591
export const ModelThatExtendsSchema = {
527
527
-
description: 'This is a model that extends another model',
528
528
-
type: 'object',
592
592
+
description: "This is a model that extends another model",
593
593
+
type: "object",
529
594
allOf: [
530
595
{
531
531
-
'$ref': '#/definitions/ModelWithString'
596
596
+
'$ref': "#/definitions/ModelWithString"
532
597
},
533
598
{
534
534
-
type: 'object',
599
599
+
type: "object",
535
600
properties: {
536
601
propExtendsA: {
537
537
-
type: 'string'
602
602
+
type: "string"
538
603
},
539
604
propExtendsB: {
540
540
-
'$ref': '#/definitions/ModelWithString'
605
605
+
'$ref': "#/definitions/ModelWithString"
541
606
}
542
607
}
543
608
}
···
545
610
} as const;
546
611
547
612
export const ModelThatExtendsExtendsSchema = {
548
548
-
description: 'This is a model that extends another model',
549
549
-
type: 'object',
613
613
+
description: "This is a model that extends another model",
614
614
+
type: "object",
550
615
allOf: [
551
616
{
552
552
-
'$ref': '#/definitions/ModelWithString'
617
617
+
'$ref': "#/definitions/ModelWithString"
553
618
},
554
619
{
555
555
-
'$ref': '#/definitions/ModelThatExtends'
620
620
+
'$ref': "#/definitions/ModelThatExtends"
556
621
},
557
622
{
558
558
-
type: 'object',
623
623
+
type: "object",
559
624
properties: {
560
625
propExtendsC: {
561
561
-
type: 'string'
626
626
+
type: "string"
562
627
},
563
628
propExtendsD: {
564
564
-
'$ref': '#/definitions/ModelWithString'
629
629
+
'$ref': "#/definitions/ModelWithString"
565
630
}
566
631
}
567
632
}
···
569
634
} as const;
570
635
571
636
export const defaultSchema = {
572
572
-
type: 'object',
637
637
+
type: "object",
573
638
properties: {
574
639
name: {
575
575
-
type: 'string'
640
640
+
type: "string"
576
641
}
577
642
}
578
643
} as const;
579
644
580
645
export const ModelWithPatternSchema = {
581
581
-
description: 'This is a model that contains a some patterns',
582
582
-
type: 'object',
583
583
-
required: ['key', 'name'],
646
646
+
description: "This is a model that contains a some patterns",
647
647
+
type: "object",
648
648
+
required: [
649
649
+
"key",
650
650
+
"name"
651
651
+
],
584
652
properties: {
585
653
key: {
586
654
maxLength: 64,
587
587
-
pattern: '^[a-zA-Z0-9_]*$',
588
588
-
type: 'string'
655
655
+
pattern: "^[a-zA-Z0-9_]*$",
656
656
+
type: "string"
589
657
},
590
658
name: {
591
659
maxLength: 255,
592
592
-
type: 'string'
660
660
+
type: "string"
593
661
},
594
662
enabled: {
595
595
-
type: 'boolean',
663
663
+
type: "boolean",
596
664
readOnly: true
597
665
},
598
666
modified: {
599
599
-
type: 'string',
600
600
-
format: 'date-time',
667
667
+
type: "string",
668
668
+
format: "date-time",
601
669
readOnly: true
602
670
},
603
671
id: {
604
604
-
type: 'string',
605
605
-
pattern: '^\\d{2}-\\d{3}-\\d{4}$'
672
672
+
type: "string",
673
673
+
pattern: "^\\d{2}-\\d{3}-\\d{4}$"
606
674
},
607
675
text: {
608
608
-
type: 'string',
609
609
-
pattern: '^\\w+$'
676
676
+
type: "string",
677
677
+
pattern: "^\\w+$"
610
678
},
611
679
patternWithSingleQuotes: {
612
612
-
type: 'string',
680
680
+
type: "string",
613
681
pattern: "^[a-zA-Z0-9']*$"
614
682
},
615
683
patternWithNewline: {
616
616
-
type: 'string',
617
617
-
pattern: 'aaa\\nbbb'
684
684
+
type: "string",
685
685
+
pattern: "aaa\\nbbb"
618
686
},
619
687
patternWithBacktick: {
620
620
-
type: 'string',
621
621
-
pattern: 'aaa`bbb'
688
688
+
type: "string",
689
689
+
pattern: "aaa`bbb"
622
690
}
623
691
}
624
692
} as const;
625
693
626
694
export const parameter_ActivityParamsSchema = {
627
627
-
type: 'object',
695
695
+
type: "object",
628
696
properties: {
629
697
description: {
630
630
-
type: 'string'
698
698
+
type: "string"
631
699
},
632
700
graduate_id: {
633
633
-
type: 'integer'
701
701
+
type: "integer"
634
702
},
635
703
organization_id: {
636
636
-
type: 'integer'
704
704
+
type: "integer"
637
705
},
638
706
parent_activity: {
639
639
-
type: 'integer'
707
707
+
type: "integer"
640
708
},
641
709
post_id: {
642
642
-
type: 'integer'
710
710
+
type: "integer"
643
711
}
644
712
}
645
713
} as const;
646
714
647
715
export const response_PostActivityResponseSchema = {
648
648
-
type: 'object',
716
716
+
type: "object",
649
717
properties: {
650
718
description: {
651
651
-
type: 'string'
719
719
+
type: "string"
652
720
},
653
721
graduate_id: {
654
654
-
type: 'integer'
722
722
+
type: "integer"
655
723
},
656
724
organization_id: {
657
657
-
type: 'integer'
725
725
+
type: "integer"
658
726
},
659
727
parent_activity_id: {
660
660
-
type: 'integer'
728
728
+
type: "integer"
661
729
},
662
730
post_id: {
663
663
-
type: 'integer'
731
731
+
type: "integer"
664
732
}
665
733
}
666
734
} as const;
667
735
668
736
export const failure_FailureSchema = {
669
669
-
type: 'object',
737
737
+
type: "object",
670
738
properties: {
671
739
error: {
672
672
-
type: 'string'
740
740
+
type: "string"
673
741
},
674
742
message: {
675
675
-
type: 'string'
743
743
+
type: "string"
676
744
},
677
745
reference_code: {
678
678
-
type: 'string'
746
746
+
type: "string"
679
747
}
680
748
}
681
749
} as const;
682
750
683
751
export const external_shared_ExternalSharedModelSchema = {
684
684
-
type: 'object',
752
752
+
type: "object",
685
753
properties: {
686
754
id: {
687
687
-
type: 'string'
755
755
+
type: "string"
688
756
},
689
757
name: {
690
690
-
type: 'string'
758
758
+
type: "string"
691
759
}
692
760
},
693
693
-
required: ['id']
761
761
+
required: [
762
762
+
"id"
763
763
+
]
694
764
} as const;
695
765
696
766
export const ModelWithReferenceWritableSchema = {
697
697
-
description: 'This is a model with one property containing a reference',
698
698
-
type: 'object',
767
767
+
description: "This is a model with one property containing a reference",
768
768
+
type: "object",
699
769
properties: {
700
770
prop: {
701
701
-
'$ref': '#/definitions/ModelWithPropertiesWritable'
771
771
+
'$ref': "#/definitions/ModelWithPropertiesWritable"
702
772
}
703
773
}
704
774
} as const;
705
775
706
776
export const ModelWithPropertiesWritableSchema = {
707
707
-
description: 'This is a model with one nested property',
708
708
-
type: 'object',
709
709
-
required: ['required'],
777
777
+
description: "This is a model with one nested property",
778
778
+
type: "object",
779
779
+
required: [
780
780
+
"required"
781
781
+
],
710
782
properties: {
711
783
required: {
712
712
-
type: 'string'
784
784
+
type: "string"
713
785
},
714
786
string: {
715
715
-
type: 'string'
787
787
+
type: "string"
716
788
},
717
789
number: {
718
718
-
type: 'number'
790
790
+
type: "number"
719
791
},
720
792
boolean: {
721
721
-
type: 'boolean'
793
793
+
type: "boolean"
722
794
},
723
795
reference: {
724
724
-
'$ref': '#/definitions/ModelWithString'
796
796
+
'$ref': "#/definitions/ModelWithString"
725
797
},
726
798
'property with space': {
727
727
-
type: 'string'
799
799
+
type: "string"
728
800
},
729
801
default: {
730
730
-
type: 'string'
802
802
+
type: "string"
731
803
},
732
804
try: {
733
733
-
type: 'string'
805
805
+
type: "string"
734
806
}
735
807
}
736
808
} as const;
737
809
738
810
export const ModelWithPatternWritableSchema = {
739
739
-
description: 'This is a model that contains a some patterns',
740
740
-
type: 'object',
741
741
-
required: ['key', 'name'],
811
811
+
description: "This is a model that contains a some patterns",
812
812
+
type: "object",
813
813
+
required: [
814
814
+
"key",
815
815
+
"name"
816
816
+
],
742
817
properties: {
743
818
key: {
744
819
maxLength: 64,
745
745
-
pattern: '^[a-zA-Z0-9_]*$',
746
746
-
type: 'string'
820
820
+
pattern: "^[a-zA-Z0-9_]*$",
821
821
+
type: "string"
747
822
},
748
823
name: {
749
824
maxLength: 255,
750
750
-
type: 'string'
825
825
+
type: "string"
751
826
},
752
827
id: {
753
753
-
type: 'string',
754
754
-
pattern: '^\\d{2}-\\d{3}-\\d{4}$'
828
828
+
type: "string",
829
829
+
pattern: "^\\d{2}-\\d{3}-\\d{4}$"
755
830
},
756
831
text: {
757
757
-
type: 'string',
758
758
-
pattern: '^\\w+$'
832
832
+
type: "string",
833
833
+
pattern: "^\\w+$"
759
834
},
760
835
patternWithSingleQuotes: {
761
761
-
type: 'string',
836
836
+
type: "string",
762
837
pattern: "^[a-zA-Z0-9']*$"
763
838
},
764
839
patternWithNewline: {
765
765
-
type: 'string',
766
766
-
pattern: 'aaa\\nbbb'
840
840
+
type: "string",
841
841
+
pattern: "aaa\\nbbb"
767
842
},
768
843
patternWithBacktick: {
769
769
-
type: 'string',
770
770
-
pattern: 'aaa`bbb'
844
844
+
type: "string",
845
845
+
pattern: "aaa`bbb"
771
846
}
772
847
}
773
848
} as const;
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/default/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base',
18
18
-
throwOnError: true
19
19
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base", throwOnError: true }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/fetch/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseURL: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/axios/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseURL: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/fetch/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/axios/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseURL: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/fetch/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/axios/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseURL: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/axios/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseURL: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/fetch/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers-base-path/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: '/v1'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "/v1" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'https://foo.com/v1'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "https://foo.com/v1" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@angular/common/default-class/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@angular/common/default/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'https://api.example.com/v1'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "https://api.example.com/v1" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'https://api.example.com/v1'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "https://api.example.com/v1" }));
+851
-695
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/schemas/default/schemas.gen.ts
···
1
1
// This file is auto-generated by @hey-api/openapi-ts
2
2
3
3
export const _400Schema = {
4
4
-
description: 'Model with number-only name',
5
5
-
type: 'string'
4
4
+
description: "Model with number-only name",
5
5
+
type: "string"
6
6
} as const;
7
7
8
8
export const ExternalRefASchema = {
9
9
-
description: 'External ref to shared model (A)',
10
10
-
'$ref': '#/components/schemas/external-shared_ExternalSharedModel'
9
9
+
description: "External ref to shared model (A)",
10
10
+
'$ref': "#/components/schemas/external-shared_ExternalSharedModel"
11
11
} as const;
12
12
13
13
export const ExternalRefBSchema = {
14
14
-
description: 'External ref to shared model (B)',
15
15
-
'$ref': '#/components/schemas/external-shared_ExternalSharedModel'
14
14
+
description: "External ref to shared model (B)",
15
15
+
'$ref': "#/components/schemas/external-shared_ExternalSharedModel"
16
16
} as const;
17
17
18
18
export const camelCaseCommentWithBreaksSchema = {
19
19
-
description: `Testing multiline comments in string: First line
20
20
-
Second line
21
21
-
22
22
-
Fourth line`,
23
23
-
type: 'integer'
19
19
+
description: "Testing multiline comments in string: First line\nSecond line\n\nFourth line",
20
20
+
type: "integer"
24
21
} as const;
25
22
26
23
export const CommentWithBreaksSchema = {
27
27
-
description: `Testing multiline comments in string: First line
28
28
-
Second line
29
29
-
30
30
-
Fourth line`,
31
31
-
type: 'integer'
24
24
+
description: "Testing multiline comments in string: First line\nSecond line\n\nFourth line",
25
25
+
type: "integer"
32
26
} as const;
33
27
34
28
export const CommentWithBackticksSchema = {
35
35
-
description: 'Testing backticks in string: `backticks` and ```multiple backticks``` should work',
36
36
-
type: 'integer'
29
29
+
description: "Testing backticks in string: `backticks` and ```multiple backticks``` should work",
30
30
+
type: "integer"
37
31
} as const;
38
32
39
33
export const CommentWithBackticksAndQuotesSchema = {
40
40
-
description: `Testing backticks and quotes in string: \`backticks\`, 'quotes', "double quotes" and \`\`\`multiple backticks\`\`\` should work`,
41
41
-
type: 'integer'
34
34
+
description: "Testing backticks and quotes in string: `backticks`, 'quotes', \"double quotes\" and ```multiple backticks``` should work",
35
35
+
type: "integer"
42
36
} as const;
43
37
44
38
export const CommentWithSlashesSchema = {
45
45
-
description: 'Testing slashes in string: \\backwards\\\\\\ and /forwards/// should work',
46
46
-
type: 'integer'
39
39
+
description: "Testing slashes in string: \\backwards\\\\\\ and /forwards/// should work",
40
40
+
type: "integer"
47
41
} as const;
48
42
49
43
export const CommentWithExpressionPlaceholdersSchema = {
50
50
-
description: 'Testing expression placeholders in string: ${expression} should work',
51
51
-
type: 'integer'
44
44
+
description: "Testing expression placeholders in string: ${expression} should work",
45
45
+
type: "integer"
52
46
} as const;
53
47
54
48
export const CommentWithQuotesSchema = {
55
55
-
description: `Testing quotes in string: 'single quote''' and "double quotes""" should work`,
56
56
-
type: 'integer'
49
49
+
description: "Testing quotes in string: 'single quote''' and \"double quotes\"\"\" should work",
50
50
+
type: "integer"
57
51
} as const;
58
52
59
53
export const CommentWithReservedCharactersSchema = {
60
60
-
description: 'Testing reserved characters in string: /* inline */ and /** inline **/ should work',
61
61
-
type: 'integer'
54
54
+
description: "Testing reserved characters in string: /* inline */ and /** inline **/ should work",
55
55
+
type: "integer"
62
56
} as const;
63
57
64
58
export const SimpleIntegerSchema = {
65
65
-
description: 'This is a simple number',
66
66
-
type: 'integer'
59
59
+
description: "This is a simple number",
60
60
+
type: "integer"
67
61
} as const;
68
62
69
63
export const SimpleBooleanSchema = {
70
70
-
description: 'This is a simple boolean',
71
71
-
type: 'boolean'
64
64
+
description: "This is a simple boolean",
65
65
+
type: "boolean"
72
66
} as const;
73
67
74
68
export const SimpleStringSchema = {
75
75
-
description: 'This is a simple string',
76
76
-
type: 'string'
69
69
+
description: "This is a simple string",
70
70
+
type: "string"
77
71
} as const;
78
72
79
73
export const NonAsciiStringæøåÆØÅöôêÊ字符串Schema = {
80
80
-
description: 'A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串)',
81
81
-
type: 'string'
74
74
+
description: "A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串)",
75
75
+
type: "string"
82
76
} as const;
83
77
84
78
export const SimpleFileSchema = {
85
85
-
description: 'This is a simple file',
86
86
-
format: 'binary',
87
87
-
type: 'string'
79
79
+
description: "This is a simple file",
80
80
+
format: "binary",
81
81
+
type: "string"
88
82
} as const;
89
83
90
84
export const SimpleReferenceSchema = {
91
91
-
description: 'This is a simple reference',
85
85
+
description: "This is a simple reference",
92
86
allOf: [
93
87
{
94
94
-
'$ref': '#/components/schemas/ModelWithString'
88
88
+
'$ref': "#/components/schemas/ModelWithString"
95
89
}
96
90
]
97
91
} as const;
98
92
99
93
export const SimpleStringWithPatternSchema = {
100
100
-
description: 'This is a simple string',
101
101
-
type: 'string',
94
94
+
description: "This is a simple string",
95
95
+
type: "string",
102
96
nullable: true,
103
97
maxLength: 64,
104
104
-
pattern: '^[a-zA-Z0-9_]*$'
98
98
+
pattern: "^[a-zA-Z0-9_]*$"
105
99
} as const;
106
100
107
101
export const EnumWithStringsSchema = {
108
108
-
description: 'This is a simple enum with strings',
109
109
-
enum: ['Success', 'Warning', 'Error', "'Single Quote'", '"Double Quotes"', 'Non-ascii: øæåôöØÆÅÔÖ字符串']
102
102
+
description: "This is a simple enum with strings",
103
103
+
enum: [
104
104
+
"Success",
105
105
+
"Warning",
106
106
+
"Error",
107
107
+
"'Single Quote'",
108
108
+
"\"Double Quotes\"",
109
109
+
"Non-ascii: øæåôöØÆÅÔÖ字符串"
110
110
+
]
110
111
} as const;
111
112
112
113
export const EnumWithReplacedCharactersSchema = {
113
113
-
enum: ["'Single Quote'", '"Double Quotes"', 'øæåôöØÆÅÔÖ字符串', 3.1, ''],
114
114
-
type: 'string'
114
114
+
enum: [
115
115
+
"'Single Quote'",
116
116
+
"\"Double Quotes\"",
117
117
+
"øæåôöØÆÅÔÖ字符串",
118
118
+
3.1,
119
119
+
""
120
120
+
],
121
121
+
type: "string"
115
122
} as const;
116
123
117
124
export const EnumWithNumbersSchema = {
118
118
-
description: 'This is a simple enum with numbers',
119
119
-
enum: [1, 2, 3, 1.1, 1.2, 1.3, 100, 200, 300, -100, -200, -300, -1.1, -1.2, -1.3],
125
125
+
description: "This is a simple enum with numbers",
126
126
+
enum: [
127
127
+
1,
128
128
+
2,
129
129
+
3,
130
130
+
1.1,
131
131
+
1.2,
132
132
+
1.3,
133
133
+
100,
134
134
+
200,
135
135
+
300,
136
136
+
-100,
137
137
+
-200,
138
138
+
-300,
139
139
+
-1.1,
140
140
+
-1.2,
141
141
+
-1.3
142
142
+
],
120
143
default: 200
121
144
} as const;
122
145
123
146
export const EnumFromDescriptionSchema = {
124
124
-
description: 'Success=1,Warning=2,Error=3',
125
125
-
type: 'number'
147
147
+
description: "Success=1,Warning=2,Error=3",
148
148
+
type: "number"
126
149
} as const;
127
150
128
151
export const EnumWithExtensionsSchema = {
129
129
-
description: 'This is a simple enum with numbers',
130
130
-
enum: [200, 400, 500],
131
131
-
'x-enum-varnames': ['CUSTOM_SUCCESS', 'CUSTOM_WARNING', 'CUSTOM_ERROR'],
132
132
-
'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']
152
152
+
description: "This is a simple enum with numbers",
153
153
+
enum: [
154
154
+
200,
155
155
+
400,
156
156
+
500
157
157
+
],
158
158
+
'x-enum-varnames': [
159
159
+
"CUSTOM_SUCCESS",
160
160
+
"CUSTOM_WARNING",
161
161
+
"CUSTOM_ERROR"
162
162
+
],
163
163
+
'x-enum-descriptions': [
164
164
+
"Used when the status of something is successful",
165
165
+
"Used when the status of something has a warning",
166
166
+
"Used when the status of something has an error"
167
167
+
]
133
168
} as const;
134
169
135
170
export const EnumWithXEnumNamesSchema = {
136
136
-
enum: [0, 1, 2],
137
137
-
'x-enumNames': ['zero', 'one', 'two']
171
171
+
enum: [
172
172
+
0,
173
173
+
1,
174
174
+
2
175
175
+
],
176
176
+
'x-enumNames': [
177
177
+
"zero",
178
178
+
"one",
179
179
+
"two"
180
180
+
]
138
181
} as const;
139
182
140
183
export const ArrayWithNumbersSchema = {
141
141
-
description: 'This is a simple array with numbers',
142
142
-
type: 'array',
184
184
+
description: "This is a simple array with numbers",
185
185
+
type: "array",
143
186
items: {
144
144
-
type: 'integer'
187
187
+
type: "integer"
145
188
}
146
189
} as const;
147
190
148
191
export const ArrayWithBooleansSchema = {
149
149
-
description: 'This is a simple array with booleans',
150
150
-
type: 'array',
192
192
+
description: "This is a simple array with booleans",
193
193
+
type: "array",
151
194
items: {
152
152
-
type: 'boolean'
195
195
+
type: "boolean"
153
196
}
154
197
} as const;
155
198
156
199
export const ArrayWithStringsSchema = {
157
157
-
description: 'This is a simple array with strings',
158
158
-
type: 'array',
200
200
+
description: "This is a simple array with strings",
201
201
+
type: "array",
159
202
items: {
160
160
-
type: 'string'
203
203
+
type: "string"
161
204
},
162
162
-
default: ['test']
205
205
+
default: [
206
206
+
"test"
207
207
+
]
163
208
} as const;
164
209
165
210
export const ArrayWithReferencesSchema = {
166
166
-
description: 'This is a simple array with references',
167
167
-
type: 'array',
211
211
+
description: "This is a simple array with references",
212
212
+
type: "array",
168
213
items: {
169
169
-
'$ref': '#/components/schemas/ModelWithString'
214
214
+
'$ref': "#/components/schemas/ModelWithString"
170
215
}
171
216
} as const;
172
217
173
218
export const ArrayWithArraySchema = {
174
174
-
description: 'This is a simple array containing an array',
175
175
-
type: 'array',
219
219
+
description: "This is a simple array containing an array",
220
220
+
type: "array",
176
221
items: {
177
177
-
type: 'array',
222
222
+
type: "array",
178
223
items: {
179
179
-
'$ref': '#/components/schemas/ModelWithString'
224
224
+
'$ref': "#/components/schemas/ModelWithString"
180
225
}
181
226
}
182
227
} as const;
183
228
184
229
export const ArrayWithPropertiesSchema = {
185
185
-
description: 'This is a simple array with properties',
186
186
-
type: 'array',
230
230
+
description: "This is a simple array with properties",
231
231
+
type: "array",
187
232
items: {
188
188
-
type: 'object',
233
233
+
type: "object",
189
234
properties: {
190
235
'16x16': {
191
191
-
'$ref': '#/components/schemas/camelCaseCommentWithBreaks'
236
236
+
'$ref': "#/components/schemas/camelCaseCommentWithBreaks"
192
237
},
193
238
bar: {
194
194
-
type: 'string'
239
239
+
type: "string"
195
240
}
196
241
}
197
242
}
198
243
} as const;
199
244
200
245
export const ArrayWithAnyOfPropertiesSchema = {
201
201
-
description: 'This is a simple array with any of properties',
202
202
-
type: 'array',
246
246
+
description: "This is a simple array with any of properties",
247
247
+
type: "array",
203
248
items: {
204
249
anyOf: [
205
250
{
206
206
-
type: 'object',
251
251
+
type: "object",
207
252
properties: {
208
253
foo: {
209
209
-
type: 'string',
210
210
-
default: 'test'
254
254
+
type: "string",
255
255
+
default: "test"
211
256
}
212
257
}
213
258
},
214
259
{
215
215
-
type: 'object',
260
260
+
type: "object",
216
261
properties: {
217
262
bar: {
218
218
-
type: 'string'
263
263
+
type: "string"
219
264
}
220
265
}
221
266
}
···
224
269
} as const;
225
270
226
271
export const AnyOfAnyAndNullSchema = {
227
227
-
type: 'object',
272
272
+
type: "object",
228
273
properties: {
229
274
data: {
230
275
anyOf: [
···
238
283
} as const;
239
284
240
285
export const AnyOfArraysSchema = {
241
241
-
description: 'This is a simple array with any of properties',
242
242
-
type: 'object',
286
286
+
description: "This is a simple array with any of properties",
287
287
+
type: "object",
243
288
properties: {
244
289
results: {
245
290
items: {
246
291
anyOf: [
247
292
{
248
248
-
type: 'object',
293
293
+
type: "object",
249
294
properties: {
250
295
foo: {
251
251
-
type: 'string'
296
296
+
type: "string"
252
297
}
253
298
}
254
299
},
255
300
{
256
256
-
type: 'object',
301
301
+
type: "object",
257
302
properties: {
258
303
bar: {
259
259
-
type: 'string'
304
304
+
type: "string"
260
305
}
261
306
}
262
307
}
263
308
]
264
309
},
265
265
-
type: 'array'
310
310
+
type: "array"
266
311
}
267
312
}
268
313
} as const;
269
314
270
315
export const DictionaryWithStringSchema = {
271
271
-
description: 'This is a string dictionary',
272
272
-
type: 'object',
316
316
+
description: "This is a string dictionary",
317
317
+
type: "object",
273
318
additionalProperties: {
274
274
-
type: 'string'
319
319
+
type: "string"
275
320
}
276
321
} as const;
277
322
278
323
export const DictionaryWithPropertiesAndAdditionalPropertiesSchema = {
279
279
-
type: 'object',
324
324
+
type: "object",
280
325
properties: {
281
326
foo: {
282
282
-
type: 'number'
327
327
+
type: "number"
283
328
},
284
329
bar: {
285
285
-
type: 'boolean'
330
330
+
type: "boolean"
286
331
}
287
332
},
288
333
additionalProperties: {
289
289
-
type: 'string'
334
334
+
type: "string"
290
335
}
291
336
} as const;
292
337
293
338
export const DictionaryWithReferenceSchema = {
294
294
-
description: 'This is a string reference',
295
295
-
type: 'object',
339
339
+
description: "This is a string reference",
340
340
+
type: "object",
296
341
additionalProperties: {
297
297
-
'$ref': '#/components/schemas/ModelWithString'
342
342
+
'$ref': "#/components/schemas/ModelWithString"
298
343
}
299
344
} as const;
300
345
301
346
export const DictionaryWithArraySchema = {
302
302
-
description: 'This is a complex dictionary',
303
303
-
type: 'object',
347
347
+
description: "This is a complex dictionary",
348
348
+
type: "object",
304
349
additionalProperties: {
305
305
-
type: 'array',
350
350
+
type: "array",
306
351
items: {
307
307
-
'$ref': '#/components/schemas/ModelWithString'
352
352
+
'$ref': "#/components/schemas/ModelWithString"
308
353
}
309
354
}
310
355
} as const;
311
356
312
357
export const DictionaryWithDictionarySchema = {
313
313
-
description: 'This is a string dictionary',
314
314
-
type: 'object',
358
358
+
description: "This is a string dictionary",
359
359
+
type: "object",
315
360
additionalProperties: {
316
316
-
type: 'object',
361
361
+
type: "object",
317
362
additionalProperties: {
318
318
-
type: 'string'
363
363
+
type: "string"
319
364
}
320
365
}
321
366
} as const;
322
367
323
368
export const DictionaryWithPropertiesSchema = {
324
324
-
description: 'This is a complex dictionary',
325
325
-
type: 'object',
369
369
+
description: "This is a complex dictionary",
370
370
+
type: "object",
326
371
additionalProperties: {
327
327
-
type: 'object',
372
372
+
type: "object",
328
373
properties: {
329
374
foo: {
330
330
-
type: 'string'
375
375
+
type: "string"
331
376
},
332
377
bar: {
333
333
-
type: 'string'
378
378
+
type: "string"
334
379
}
335
380
}
336
381
}
337
382
} as const;
338
383
339
384
export const ModelWithIntegerSchema = {
340
340
-
description: 'This is a model with one number property',
341
341
-
type: 'object',
385
385
+
description: "This is a model with one number property",
386
386
+
type: "object",
342
387
properties: {
343
388
prop: {
344
344
-
description: 'This is a simple number property',
345
345
-
type: 'integer'
389
389
+
description: "This is a simple number property",
390
390
+
type: "integer"
346
391
}
347
392
}
348
393
} as const;
349
394
350
395
export const ModelWithBooleanSchema = {
351
351
-
description: 'This is a model with one boolean property',
352
352
-
type: 'object',
396
396
+
description: "This is a model with one boolean property",
397
397
+
type: "object",
353
398
properties: {
354
399
prop: {
355
355
-
description: 'This is a simple boolean property',
356
356
-
type: 'boolean'
400
400
+
description: "This is a simple boolean property",
401
401
+
type: "boolean"
357
402
}
358
403
}
359
404
} as const;
360
405
361
406
export const ModelWithStringSchema = {
362
362
-
description: 'This is a model with one string property',
363
363
-
type: 'object',
407
407
+
description: "This is a model with one string property",
408
408
+
type: "object",
364
409
properties: {
365
410
prop: {
366
366
-
description: 'This is a simple string property',
367
367
-
type: 'string'
411
411
+
description: "This is a simple string property",
412
412
+
type: "string"
368
413
}
369
414
}
370
415
} as const;
371
416
372
417
export const ModelWithStringErrorSchema = {
373
373
-
description: 'This is a model with one string property',
374
374
-
type: 'object',
418
418
+
description: "This is a model with one string property",
419
419
+
type: "object",
375
420
properties: {
376
421
prop: {
377
377
-
description: 'This is a simple string property',
378
378
-
type: 'string'
422
422
+
description: "This is a simple string property",
423
423
+
type: "string"
379
424
}
380
425
}
381
426
} as const;
382
427
383
428
export const Model_From_ZendeskSchema = {
384
384
-
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)`,
385
385
-
type: 'string'
429
429
+
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)",
430
430
+
type: "string"
386
431
} as const;
387
432
388
433
export const ModelWithNullableStringSchema = {
389
389
-
description: 'This is a model with one string property',
390
390
-
type: 'object',
391
391
-
required: ['nullableRequiredProp1', 'nullableRequiredProp2'],
434
434
+
description: "This is a model with one string property",
435
435
+
type: "object",
436
436
+
required: [
437
437
+
"nullableRequiredProp1",
438
438
+
"nullableRequiredProp2"
439
439
+
],
392
440
properties: {
393
441
nullableProp1: {
394
394
-
description: 'This is a simple string property',
395
395
-
type: 'string',
442
442
+
description: "This is a simple string property",
443
443
+
type: "string",
396
444
nullable: true
397
445
},
398
446
nullableRequiredProp1: {
399
399
-
description: 'This is a simple string property',
400
400
-
type: 'string',
447
447
+
description: "This is a simple string property",
448
448
+
type: "string",
401
449
nullable: true
402
450
},
403
451
nullableProp2: {
404
404
-
description: 'This is a simple string property',
452
452
+
description: "This is a simple string property",
405
453
nullable: true,
406
406
-
type: 'string'
454
454
+
type: "string"
407
455
},
408
456
nullableRequiredProp2: {
409
409
-
description: 'This is a simple string property',
457
457
+
description: "This is a simple string property",
410
458
nullable: true,
411
411
-
type: 'string'
459
459
+
type: "string"
412
460
},
413
461
'foo_bar-enum': {
414
414
-
description: 'This is a simple enum with strings',
415
415
-
enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串']
462
462
+
description: "This is a simple enum with strings",
463
463
+
enum: [
464
464
+
"Success",
465
465
+
"Warning",
466
466
+
"Error",
467
467
+
"ØÆÅ字符串"
468
468
+
]
416
469
}
417
470
}
418
471
} as const;
419
472
420
473
export const ModelWithEnumSchema = {
421
421
-
description: 'This is a model with one enum',
422
422
-
type: 'object',
474
474
+
description: "This is a model with one enum",
475
475
+
type: "object",
423
476
properties: {
424
477
'foo_bar-enum': {
425
425
-
description: 'This is a simple enum with strings',
426
426
-
enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串']
478
478
+
description: "This is a simple enum with strings",
479
479
+
enum: [
480
480
+
"Success",
481
481
+
"Warning",
482
482
+
"Error",
483
483
+
"ØÆÅ字符串"
484
484
+
]
427
485
},
428
486
statusCode: {
429
429
-
description: 'These are the HTTP error code enums',
430
430
-
enum: ['100', '200 FOO', '300 FOO_BAR', '400 foo-bar', '500 foo.bar', '600 foo&bar']
487
487
+
description: "These are the HTTP error code enums",
488
488
+
enum: [
489
489
+
"100",
490
490
+
"200 FOO",
491
491
+
"300 FOO_BAR",
492
492
+
"400 foo-bar",
493
493
+
"500 foo.bar",
494
494
+
"600 foo&bar"
495
495
+
]
431
496
},
432
497
bool: {
433
433
-
description: 'Simple boolean enum',
434
434
-
type: 'boolean',
435
435
-
enum: [true]
498
498
+
description: "Simple boolean enum",
499
499
+
type: "boolean",
500
500
+
enum: [
501
501
+
true
502
502
+
]
436
503
}
437
504
}
438
505
} as const;
439
506
440
507
export const ModelWithEnumWithHyphenSchema = {
441
441
-
description: 'This is a model with one enum with escaped name',
442
442
-
type: 'object',
508
508
+
description: "This is a model with one enum with escaped name",
509
509
+
type: "object",
443
510
properties: {
444
511
'foo-bar-baz-qux': {
445
445
-
type: 'string',
446
446
-
enum: ['3.0'],
447
447
-
title: 'Foo-Bar-Baz-Qux',
448
448
-
default: '3.0'
512
512
+
type: "string",
513
513
+
enum: [
514
514
+
"3.0"
515
515
+
],
516
516
+
title: "Foo-Bar-Baz-Qux",
517
517
+
default: "3.0"
449
518
}
450
519
}
451
520
} as const;
452
521
453
522
export const ModelWithEnumFromDescriptionSchema = {
454
454
-
description: 'This is a model with one enum',
455
455
-
type: 'object',
523
523
+
description: "This is a model with one enum",
524
524
+
type: "object",
456
525
properties: {
457
526
test: {
458
458
-
type: 'integer',
459
459
-
description: 'Success=1,Warning=2,Error=3'
527
527
+
type: "integer",
528
528
+
description: "Success=1,Warning=2,Error=3"
460
529
}
461
530
}
462
531
} as const;
463
532
464
533
export const ModelWithNestedEnumsSchema = {
465
465
-
description: 'This is a model with nested enums',
466
466
-
type: 'object',
534
534
+
description: "This is a model with nested enums",
535
535
+
type: "object",
467
536
properties: {
468
537
dictionaryWithEnum: {
469
469
-
type: 'object',
538
538
+
type: "object",
470
539
additionalProperties: {
471
471
-
enum: ['Success', 'Warning', 'Error']
540
540
+
enum: [
541
541
+
"Success",
542
542
+
"Warning",
543
543
+
"Error"
544
544
+
]
472
545
}
473
546
},
474
547
dictionaryWithEnumFromDescription: {
475
475
-
type: 'object',
548
548
+
type: "object",
476
549
additionalProperties: {
477
477
-
type: 'integer',
478
478
-
description: 'Success=1,Warning=2,Error=3'
550
550
+
type: "integer",
551
551
+
description: "Success=1,Warning=2,Error=3"
479
552
}
480
553
},
481
554
arrayWithEnum: {
482
482
-
type: 'array',
555
555
+
type: "array",
483
556
items: {
484
484
-
enum: ['Success', 'Warning', 'Error']
557
557
+
enum: [
558
558
+
"Success",
559
559
+
"Warning",
560
560
+
"Error"
561
561
+
]
485
562
}
486
563
},
487
564
arrayWithDescription: {
488
488
-
type: 'array',
565
565
+
type: "array",
489
566
items: {
490
490
-
type: 'integer',
491
491
-
description: 'Success=1,Warning=2,Error=3'
567
567
+
type: "integer",
568
568
+
description: "Success=1,Warning=2,Error=3"
492
569
}
493
570
},
494
571
'foo_bar-enum': {
495
495
-
description: 'This is a simple enum with strings',
496
496
-
enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串']
572
572
+
description: "This is a simple enum with strings",
573
573
+
enum: [
574
574
+
"Success",
575
575
+
"Warning",
576
576
+
"Error",
577
577
+
"ØÆÅ字符串"
578
578
+
]
497
579
}
498
580
}
499
581
} as const;
500
582
501
583
export const ModelWithReferenceSchema = {
502
502
-
description: 'This is a model with one property containing a reference',
503
503
-
type: 'object',
584
584
+
description: "This is a model with one property containing a reference",
585
585
+
type: "object",
504
586
properties: {
505
587
prop: {
506
506
-
'$ref': '#/components/schemas/ModelWithProperties'
588
588
+
'$ref': "#/components/schemas/ModelWithProperties"
507
589
}
508
590
}
509
591
} as const;
510
592
511
593
export const ModelWithArrayReadOnlyAndWriteOnlySchema = {
512
512
-
description: 'This is a model with one property containing an array',
513
513
-
type: 'object',
594
594
+
description: "This is a model with one property containing an array",
595
595
+
type: "object",
514
596
properties: {
515
597
prop: {
516
516
-
type: 'array',
598
598
+
type: "array",
517
599
items: {
518
518
-
'$ref': '#/components/schemas/ModelWithReadOnlyAndWriteOnly'
600
600
+
'$ref': "#/components/schemas/ModelWithReadOnlyAndWriteOnly"
519
601
}
520
602
},
521
603
propWithFile: {
522
522
-
type: 'array',
604
604
+
type: "array",
523
605
items: {
524
524
-
format: 'binary',
525
525
-
type: 'string'
606
606
+
format: "binary",
607
607
+
type: "string"
526
608
}
527
609
},
528
610
propWithNumber: {
529
529
-
type: 'array',
611
611
+
type: "array",
530
612
items: {
531
531
-
type: 'number'
613
613
+
type: "number"
532
614
}
533
615
}
534
616
}
535
617
} as const;
536
618
537
619
export const ModelWithArraySchema = {
538
538
-
description: 'This is a model with one property containing an array',
539
539
-
type: 'object',
620
620
+
description: "This is a model with one property containing an array",
621
621
+
type: "object",
540
622
properties: {
541
623
prop: {
542
542
-
type: 'array',
624
624
+
type: "array",
543
625
items: {
544
544
-
'$ref': '#/components/schemas/ModelWithString'
626
626
+
'$ref': "#/components/schemas/ModelWithString"
545
627
}
546
628
},
547
629
propWithFile: {
548
548
-
type: 'array',
630
630
+
type: "array",
549
631
items: {
550
550
-
format: 'binary',
551
551
-
type: 'string'
632
632
+
format: "binary",
633
633
+
type: "string"
552
634
}
553
635
},
554
636
propWithNumber: {
555
555
-
type: 'array',
637
637
+
type: "array",
556
638
items: {
557
557
-
type: 'number'
639
639
+
type: "number"
558
640
}
559
641
}
560
642
}
561
643
} as const;
562
644
563
645
export const ModelWithDictionarySchema = {
564
564
-
description: 'This is a model with one property containing a dictionary',
565
565
-
type: 'object',
646
646
+
description: "This is a model with one property containing a dictionary",
647
647
+
type: "object",
566
648
properties: {
567
649
prop: {
568
568
-
type: 'object',
650
650
+
type: "object",
569
651
additionalProperties: {
570
570
-
type: 'string'
652
652
+
type: "string"
571
653
}
572
654
}
573
655
}
···
575
657
576
658
export const DeprecatedModelSchema = {
577
659
deprecated: true,
578
578
-
description: 'This is a deprecated model with a deprecated property',
579
579
-
type: 'object',
660
660
+
description: "This is a deprecated model with a deprecated property",
661
661
+
type: "object",
580
662
properties: {
581
663
prop: {
582
664
deprecated: true,
583
583
-
description: 'This is a deprecated property',
584
584
-
type: 'string'
665
665
+
description: "This is a deprecated property",
666
666
+
type: "string"
585
667
}
586
668
}
587
669
} as const;
588
670
589
671
export const ModelWithCircularReferenceSchema = {
590
590
-
description: 'This is a model with one property containing a circular reference',
591
591
-
type: 'object',
672
672
+
description: "This is a model with one property containing a circular reference",
673
673
+
type: "object",
592
674
properties: {
593
675
prop: {
594
594
-
'$ref': '#/components/schemas/ModelWithCircularReference'
676
676
+
'$ref': "#/components/schemas/ModelWithCircularReference"
595
677
}
596
678
}
597
679
} as const;
598
680
599
681
export const CompositionWithOneOfSchema = {
600
682
description: "This is a model with one property with a 'one of' relationship",
601
601
-
type: 'object',
683
683
+
type: "object",
602
684
properties: {
603
685
propA: {
604
604
-
type: 'object',
686
686
+
type: "object",
605
687
oneOf: [
606
688
{
607
607
-
'$ref': '#/components/schemas/ModelWithString'
689
689
+
'$ref': "#/components/schemas/ModelWithString"
608
690
},
609
691
{
610
610
-
'$ref': '#/components/schemas/ModelWithEnum'
692
692
+
'$ref': "#/components/schemas/ModelWithEnum"
611
693
},
612
694
{
613
613
-
'$ref': '#/components/schemas/ModelWithArray'
695
695
+
'$ref': "#/components/schemas/ModelWithArray"
614
696
},
615
697
{
616
616
-
'$ref': '#/components/schemas/ModelWithDictionary'
698
698
+
'$ref': "#/components/schemas/ModelWithDictionary"
617
699
}
618
700
]
619
701
}
···
622
704
623
705
export const CompositionWithOneOfAnonymousSchema = {
624
706
description: "This is a model with one property with a 'one of' relationship where the options are not $ref",
625
625
-
type: 'object',
707
707
+
type: "object",
626
708
properties: {
627
709
propA: {
628
628
-
type: 'object',
710
710
+
type: "object",
629
711
oneOf: [
630
712
{
631
631
-
description: 'Anonymous object type',
632
632
-
type: 'object',
713
713
+
description: "Anonymous object type",
714
714
+
type: "object",
633
715
properties: {
634
716
propA: {
635
635
-
type: 'string'
717
717
+
type: "string"
636
718
}
637
719
}
638
720
},
639
721
{
640
640
-
description: 'Anonymous string type',
641
641
-
type: 'string'
722
722
+
description: "Anonymous string type",
723
723
+
type: "string"
642
724
},
643
725
{
644
644
-
description: 'Anonymous integer type',
645
645
-
type: 'integer'
726
726
+
description: "Anonymous integer type",
727
727
+
type: "integer"
646
728
}
647
729
]
648
730
}
···
650
732
} as const;
651
733
652
734
export const ModelCircleSchema = {
653
653
-
description: 'Circle',
654
654
-
type: 'object',
655
655
-
required: ['kind'],
735
735
+
description: "Circle",
736
736
+
type: "object",
737
737
+
required: [
738
738
+
"kind"
739
739
+
],
656
740
properties: {
657
741
kind: {
658
658
-
type: 'string'
742
742
+
type: "string"
659
743
},
660
744
radius: {
661
661
-
type: 'number'
745
745
+
type: "number"
662
746
}
663
747
}
664
748
} as const;
665
749
666
750
export const ModelSquareSchema = {
667
667
-
description: 'Square',
668
668
-
type: 'object',
669
669
-
required: ['kind'],
751
751
+
description: "Square",
752
752
+
type: "object",
753
753
+
required: [
754
754
+
"kind"
755
755
+
],
670
756
properties: {
671
757
kind: {
672
672
-
type: 'string'
758
758
+
type: "string"
673
759
},
674
760
sideLength: {
675
675
-
type: 'number'
761
761
+
type: "number"
676
762
}
677
763
}
678
764
} as const;
679
765
680
766
export const CompositionWithOneOfDiscriminatorSchema = {
681
767
description: "This is a model with one property with a 'one of' relationship where the options are not $ref",
682
682
-
type: 'object',
768
768
+
type: "object",
683
769
oneOf: [
684
770
{
685
685
-
'$ref': '#/components/schemas/ModelCircle'
771
771
+
'$ref': "#/components/schemas/ModelCircle"
686
772
},
687
773
{
688
688
-
'$ref': '#/components/schemas/ModelSquare'
774
774
+
'$ref': "#/components/schemas/ModelSquare"
689
775
}
690
776
],
691
777
discriminator: {
692
692
-
propertyName: 'kind',
778
778
+
propertyName: "kind",
693
779
mapping: {
694
694
-
circle: '#/components/schemas/ModelCircle',
695
695
-
square: '#/components/schemas/ModelSquare'
780
780
+
circle: "#/components/schemas/ModelCircle",
781
781
+
square: "#/components/schemas/ModelSquare"
696
782
}
697
783
}
698
784
} as const;
699
785
700
786
export const CompositionWithAnyOfSchema = {
701
787
description: "This is a model with one property with a 'any of' relationship",
702
702
-
type: 'object',
788
788
+
type: "object",
703
789
properties: {
704
790
propA: {
705
705
-
type: 'object',
791
791
+
type: "object",
706
792
anyOf: [
707
793
{
708
708
-
'$ref': '#/components/schemas/ModelWithString'
794
794
+
'$ref': "#/components/schemas/ModelWithString"
709
795
},
710
796
{
711
711
-
'$ref': '#/components/schemas/ModelWithEnum'
797
797
+
'$ref': "#/components/schemas/ModelWithEnum"
712
798
},
713
799
{
714
714
-
'$ref': '#/components/schemas/ModelWithArray'
800
800
+
'$ref': "#/components/schemas/ModelWithArray"
715
801
},
716
802
{
717
717
-
'$ref': '#/components/schemas/ModelWithDictionary'
803
803
+
'$ref': "#/components/schemas/ModelWithDictionary"
718
804
}
719
805
]
720
806
}
···
723
809
724
810
export const CompositionWithAnyOfAnonymousSchema = {
725
811
description: "This is a model with one property with a 'any of' relationship where the options are not $ref",
726
726
-
type: 'object',
812
812
+
type: "object",
727
813
properties: {
728
814
propA: {
729
729
-
type: 'object',
815
815
+
type: "object",
730
816
anyOf: [
731
817
{
732
732
-
description: 'Anonymous object type',
733
733
-
type: 'object',
818
818
+
description: "Anonymous object type",
819
819
+
type: "object",
734
820
properties: {
735
821
propA: {
736
736
-
type: 'string'
822
822
+
type: "string"
737
823
}
738
824
}
739
825
},
740
826
{
741
741
-
description: 'Anonymous string type',
742
742
-
type: 'string'
827
827
+
description: "Anonymous string type",
828
828
+
type: "string"
743
829
},
744
830
{
745
745
-
description: 'Anonymous integer type',
746
746
-
type: 'integer'
831
831
+
description: "Anonymous integer type",
832
832
+
type: "integer"
747
833
}
748
834
]
749
835
}
···
752
838
753
839
export const CompositionWithNestedAnyAndTypeNullSchema = {
754
840
description: "This is a model with nested 'any of' property with a type null",
755
755
-
type: 'object',
841
841
+
type: "object",
756
842
properties: {
757
843
propA: {
758
758
-
type: 'object',
844
844
+
type: "object",
759
845
anyOf: [
760
846
{
761
847
items: {
762
848
nullable: true,
763
849
allOf: [
764
850
{
765
765
-
'$ref': '#/components/schemas/ModelWithDictionary'
851
851
+
'$ref': "#/components/schemas/ModelWithDictionary"
766
852
}
767
853
]
768
854
},
769
769
-
type: 'array'
855
855
+
type: "array"
770
856
},
771
857
{
772
858
items: {
773
859
nullable: true,
774
860
allOf: [
775
861
{
776
776
-
'$ref': '#/components/schemas/ModelWithArray'
862
862
+
'$ref': "#/components/schemas/ModelWithArray"
777
863
}
778
864
]
779
865
},
780
780
-
type: 'array'
866
866
+
type: "array"
781
867
}
782
868
]
783
869
}
···
785
871
} as const;
786
872
787
873
export const _3e_num_1ПериодSchema = {
788
788
-
enum: ['Bird', 'Dog'],
789
789
-
type: 'string'
874
874
+
enum: [
875
875
+
"Bird",
876
876
+
"Dog"
877
877
+
],
878
878
+
type: "string"
790
879
} as const;
791
880
792
881
export const ConstValueSchema = {
793
793
-
enum: ['ConstValue'],
794
794
-
type: 'string'
882
882
+
enum: [
883
883
+
"ConstValue"
884
884
+
],
885
885
+
type: "string"
795
886
} as const;
796
887
797
888
export const CompositionWithNestedAnyOfAndNullSchema = {
798
889
description: "This is a model with one property with a 'any of' relationship where the options are not $ref",
799
799
-
type: 'object',
890
890
+
type: "object",
800
891
properties: {
801
892
propA: {
802
893
nullable: true,
···
805
896
items: {
806
897
anyOf: [
807
898
{
808
808
-
'$ref': '#/components/schemas/3e-num_1Период'
899
899
+
'$ref': "#/components/schemas/3e-num_1Период"
809
900
},
810
901
{
811
811
-
'$ref': '#/components/schemas/ConstValue'
902
902
+
'$ref': "#/components/schemas/ConstValue"
812
903
}
813
904
]
814
905
},
815
815
-
type: 'array'
906
906
+
type: "array"
816
907
}
817
908
],
818
818
-
title: 'Scopes'
909
909
+
title: "Scopes"
819
910
}
820
911
}
821
912
} as const;
822
913
823
914
export const CompositionWithOneOfAndNullableSchema = {
824
915
description: "This is a model with one property with a 'one of' relationship",
825
825
-
type: 'object',
916
916
+
type: "object",
826
917
properties: {
827
918
propA: {
828
919
nullable: true,
829
829
-
type: 'object',
920
920
+
type: "object",
830
921
oneOf: [
831
922
{
832
832
-
type: 'object',
923
923
+
type: "object",
833
924
properties: {
834
925
boolean: {
835
835
-
type: 'boolean'
926
926
+
type: "boolean"
836
927
}
837
928
}
838
929
},
839
930
{
840
840
-
'$ref': '#/components/schemas/ModelWithEnum'
931
931
+
'$ref': "#/components/schemas/ModelWithEnum"
841
932
},
842
933
{
843
843
-
'$ref': '#/components/schemas/ModelWithArray'
934
934
+
'$ref': "#/components/schemas/ModelWithArray"
844
935
},
845
936
{
846
846
-
'$ref': '#/components/schemas/ModelWithDictionary'
937
937
+
'$ref': "#/components/schemas/ModelWithDictionary"
847
938
}
848
939
]
849
940
}
···
851
942
} as const;
852
943
853
944
export const CompositionWithOneOfAndSimpleDictionarySchema = {
854
854
-
description: 'This is a model that contains a simple dictionary within composition',
855
855
-
type: 'object',
945
945
+
description: "This is a model that contains a simple dictionary within composition",
946
946
+
type: "object",
856
947
properties: {
857
948
propA: {
858
949
oneOf: [
859
950
{
860
860
-
type: 'boolean'
951
951
+
type: "boolean"
861
952
},
862
953
{
863
863
-
type: 'object',
954
954
+
type: "object",
864
955
additionalProperties: {
865
865
-
type: 'number'
956
956
+
type: "number"
866
957
}
867
958
}
868
959
]
···
871
962
} as const;
872
963
873
964
export const CompositionWithOneOfAndSimpleArrayDictionarySchema = {
874
874
-
description: 'This is a model that contains a dictionary of simple arrays within composition',
875
875
-
type: 'object',
965
965
+
description: "This is a model that contains a dictionary of simple arrays within composition",
966
966
+
type: "object",
876
967
properties: {
877
968
propA: {
878
969
oneOf: [
879
970
{
880
880
-
type: 'boolean'
971
971
+
type: "boolean"
881
972
},
882
973
{
883
883
-
type: 'object',
974
974
+
type: "object",
884
975
additionalProperties: {
885
885
-
type: 'array',
976
976
+
type: "array",
886
977
items: {
887
887
-
type: 'boolean'
978
978
+
type: "boolean"
888
979
}
889
980
}
890
981
}
···
894
985
} as const;
895
986
896
987
export const CompositionWithOneOfAndComplexArrayDictionarySchema = {
897
897
-
description: 'This is a model that contains a dictionary of complex arrays (composited) within composition',
898
898
-
type: 'object',
988
988
+
description: "This is a model that contains a dictionary of complex arrays (composited) within composition",
989
989
+
type: "object",
899
990
properties: {
900
991
propA: {
901
992
oneOf: [
902
993
{
903
903
-
type: 'boolean'
994
994
+
type: "boolean"
904
995
},
905
996
{
906
906
-
type: 'object',
997
997
+
type: "object",
907
998
additionalProperties: {
908
908
-
type: 'array',
999
999
+
type: "array",
909
1000
items: {
910
1001
oneOf: [
911
1002
{
912
912
-
type: 'number'
1003
1003
+
type: "number"
913
1004
},
914
1005
{
915
915
-
type: 'string'
1006
1006
+
type: "string"
916
1007
}
917
1008
]
918
1009
}
···
925
1016
926
1017
export const CompositionWithAllOfAndNullableSchema = {
927
1018
description: "This is a model with one property with a 'all of' relationship",
928
928
-
type: 'object',
1019
1019
+
type: "object",
929
1020
properties: {
930
1021
propA: {
931
1022
nullable: true,
932
932
-
type: 'object',
1023
1023
+
type: "object",
933
1024
allOf: [
934
1025
{
935
935
-
type: 'object',
1026
1026
+
type: "object",
936
1027
properties: {
937
1028
boolean: {
938
938
-
type: 'boolean'
1029
1029
+
type: "boolean"
939
1030
}
940
1031
}
941
1032
},
942
1033
{
943
943
-
'$ref': '#/components/schemas/ModelWithEnum'
1034
1034
+
'$ref': "#/components/schemas/ModelWithEnum"
944
1035
},
945
1036
{
946
946
-
'$ref': '#/components/schemas/ModelWithArray'
1037
1037
+
'$ref': "#/components/schemas/ModelWithArray"
947
1038
},
948
1039
{
949
949
-
'$ref': '#/components/schemas/ModelWithDictionary'
1040
1040
+
'$ref': "#/components/schemas/ModelWithDictionary"
950
1041
}
951
1042
]
952
1043
}
···
955
1046
956
1047
export const CompositionWithAnyOfAndNullableSchema = {
957
1048
description: "This is a model with one property with a 'any of' relationship",
958
958
-
type: 'object',
1049
1049
+
type: "object",
959
1050
properties: {
960
1051
propA: {
961
1052
nullable: true,
962
962
-
type: 'object',
1053
1053
+
type: "object",
963
1054
anyOf: [
964
1055
{
965
965
-
type: 'object',
1056
1056
+
type: "object",
966
1057
properties: {
967
1058
boolean: {
968
968
-
type: 'boolean'
1059
1059
+
type: "boolean"
969
1060
}
970
1061
}
971
1062
},
972
1063
{
973
973
-
'$ref': '#/components/schemas/ModelWithEnum'
1064
1064
+
'$ref': "#/components/schemas/ModelWithEnum"
974
1065
},
975
1066
{
976
976
-
'$ref': '#/components/schemas/ModelWithArray'
1067
1067
+
'$ref': "#/components/schemas/ModelWithArray"
977
1068
},
978
1069
{
979
979
-
'$ref': '#/components/schemas/ModelWithDictionary'
1070
1070
+
'$ref': "#/components/schemas/ModelWithDictionary"
980
1071
}
981
1072
]
982
1073
}
···
984
1075
} as const;
985
1076
986
1077
export const CompositionBaseModelSchema = {
987
987
-
description: 'This is a base model with two simple optional properties',
988
988
-
type: 'object',
1078
1078
+
description: "This is a base model with two simple optional properties",
1079
1079
+
type: "object",
989
1080
properties: {
990
1081
firstName: {
991
991
-
type: 'string'
1082
1082
+
type: "string"
992
1083
},
993
1084
lastname: {
994
994
-
type: 'string'
1085
1085
+
type: "string"
995
1086
}
996
1087
}
997
1088
} as const;
998
1089
999
1090
export const CompositionExtendedModelSchema = {
1000
1000
-
description: 'This is a model that extends the base model',
1001
1001
-
type: 'object',
1091
1091
+
description: "This is a model that extends the base model",
1092
1092
+
type: "object",
1002
1093
allOf: [
1003
1094
{
1004
1004
-
'$ref': '#/components/schemas/CompositionBaseModel'
1095
1095
+
'$ref': "#/components/schemas/CompositionBaseModel"
1005
1096
}
1006
1097
],
1007
1098
properties: {
1008
1099
age: {
1009
1009
-
type: 'number'
1100
1100
+
type: "number"
1010
1101
}
1011
1102
},
1012
1012
-
required: ['firstName', 'lastname', 'age']
1103
1103
+
required: [
1104
1104
+
"firstName",
1105
1105
+
"lastname",
1106
1106
+
"age"
1107
1107
+
]
1013
1108
} as const;
1014
1109
1015
1110
export const ModelWithPropertiesSchema = {
1016
1016
-
description: 'This is a model with one nested property',
1017
1017
-
type: 'object',
1018
1018
-
required: ['required', 'requiredAndReadOnly', 'requiredAndNullable'],
1111
1111
+
description: "This is a model with one nested property",
1112
1112
+
type: "object",
1113
1113
+
required: [
1114
1114
+
"required",
1115
1115
+
"requiredAndReadOnly",
1116
1116
+
"requiredAndNullable"
1117
1117
+
],
1019
1118
properties: {
1020
1119
required: {
1021
1021
-
type: 'string'
1120
1120
+
type: "string"
1022
1121
},
1023
1122
requiredAndReadOnly: {
1024
1024
-
type: 'string',
1123
1123
+
type: "string",
1025
1124
readOnly: true
1026
1125
},
1027
1126
requiredAndNullable: {
1028
1028
-
type: 'string',
1127
1127
+
type: "string",
1029
1128
nullable: true
1030
1129
},
1031
1130
string: {
1032
1032
-
type: 'string'
1131
1131
+
type: "string"
1033
1132
},
1034
1133
number: {
1035
1035
-
type: 'number'
1134
1134
+
type: "number"
1036
1135
},
1037
1136
boolean: {
1038
1038
-
type: 'boolean'
1137
1137
+
type: "boolean"
1039
1138
},
1040
1139
reference: {
1041
1041
-
'$ref': '#/components/schemas/ModelWithString'
1140
1140
+
'$ref': "#/components/schemas/ModelWithString"
1042
1141
},
1043
1142
'property with space': {
1044
1044
-
type: 'string'
1143
1143
+
type: "string"
1045
1144
},
1046
1145
default: {
1047
1047
-
type: 'string'
1146
1146
+
type: "string"
1048
1147
},
1049
1148
try: {
1050
1050
-
type: 'string'
1149
1149
+
type: "string"
1051
1150
},
1052
1151
'@namespace.string': {
1053
1053
-
type: 'string',
1152
1152
+
type: "string",
1054
1153
readOnly: true
1055
1154
},
1056
1155
'@namespace.integer': {
1057
1057
-
type: 'integer',
1156
1156
+
type: "integer",
1058
1157
readOnly: true
1059
1158
}
1060
1159
}
1061
1160
} as const;
1062
1161
1063
1162
export const ModelWithNestedPropertiesSchema = {
1064
1064
-
description: 'This is a model with one nested property',
1065
1065
-
type: 'object',
1066
1066
-
required: ['first'],
1163
1163
+
description: "This is a model with one nested property",
1164
1164
+
type: "object",
1165
1165
+
required: [
1166
1166
+
"first"
1167
1167
+
],
1067
1168
properties: {
1068
1169
first: {
1069
1069
-
type: 'object',
1070
1070
-
required: ['second'],
1170
1170
+
type: "object",
1171
1171
+
required: [
1172
1172
+
"second"
1173
1173
+
],
1071
1174
readOnly: true,
1072
1175
nullable: true,
1073
1176
properties: {
1074
1177
second: {
1075
1075
-
type: 'object',
1076
1076
-
required: ['third'],
1178
1178
+
type: "object",
1179
1179
+
required: [
1180
1180
+
"third"
1181
1181
+
],
1077
1182
readOnly: true,
1078
1183
nullable: true,
1079
1184
properties: {
1080
1185
third: {
1081
1081
-
type: 'string',
1186
1186
+
type: "string",
1082
1187
required: true,
1083
1188
readOnly: true,
1084
1189
nullable: true
···
1091
1196
} as const;
1092
1197
1093
1198
export const ModelWithDuplicatePropertiesSchema = {
1094
1094
-
description: 'This is a model with duplicated properties',
1095
1095
-
type: 'object',
1199
1199
+
description: "This is a model with duplicated properties",
1200
1200
+
type: "object",
1096
1201
properties: {
1097
1202
prop: {
1098
1098
-
'$ref': '#/components/schemas/ModelWithString'
1203
1203
+
'$ref': "#/components/schemas/ModelWithString"
1099
1204
}
1100
1205
}
1101
1206
} as const;
1102
1207
1103
1208
export const ModelWithOrderedPropertiesSchema = {
1104
1104
-
description: 'This is a model with ordered properties',
1105
1105
-
type: 'object',
1209
1209
+
description: "This is a model with ordered properties",
1210
1210
+
type: "object",
1106
1211
properties: {
1107
1212
zebra: {
1108
1108
-
type: 'string'
1213
1213
+
type: "string"
1109
1214
},
1110
1215
apple: {
1111
1111
-
type: 'string'
1216
1216
+
type: "string"
1112
1217
},
1113
1218
hawaii: {
1114
1114
-
type: 'string'
1219
1219
+
type: "string"
1115
1220
}
1116
1221
}
1117
1222
} as const;
1118
1223
1119
1224
export const ModelWithDuplicateImportsSchema = {
1120
1120
-
description: 'This is a model with duplicated imports',
1121
1121
-
type: 'object',
1225
1225
+
description: "This is a model with duplicated imports",
1226
1226
+
type: "object",
1122
1227
properties: {
1123
1228
propA: {
1124
1124
-
'$ref': '#/components/schemas/ModelWithString'
1229
1229
+
'$ref': "#/components/schemas/ModelWithString"
1125
1230
},
1126
1231
propB: {
1127
1127
-
'$ref': '#/components/schemas/ModelWithString'
1232
1232
+
'$ref': "#/components/schemas/ModelWithString"
1128
1233
},
1129
1234
propC: {
1130
1130
-
'$ref': '#/components/schemas/ModelWithString'
1235
1235
+
'$ref': "#/components/schemas/ModelWithString"
1131
1236
}
1132
1237
}
1133
1238
} as const;
1134
1239
1135
1240
export const ModelThatExtendsSchema = {
1136
1136
-
description: 'This is a model that extends another model',
1137
1137
-
type: 'object',
1241
1241
+
description: "This is a model that extends another model",
1242
1242
+
type: "object",
1138
1243
allOf: [
1139
1244
{
1140
1140
-
'$ref': '#/components/schemas/ModelWithString'
1245
1245
+
'$ref': "#/components/schemas/ModelWithString"
1141
1246
},
1142
1247
{
1143
1143
-
type: 'object',
1248
1248
+
type: "object",
1144
1249
properties: {
1145
1250
propExtendsA: {
1146
1146
-
type: 'string'
1251
1251
+
type: "string"
1147
1252
},
1148
1253
propExtendsB: {
1149
1149
-
'$ref': '#/components/schemas/ModelWithString'
1254
1254
+
'$ref': "#/components/schemas/ModelWithString"
1150
1255
}
1151
1256
}
1152
1257
}
···
1154
1259
} as const;
1155
1260
1156
1261
export const ModelThatExtendsExtendsSchema = {
1157
1157
-
description: 'This is a model that extends another model',
1158
1158
-
type: 'object',
1262
1262
+
description: "This is a model that extends another model",
1263
1263
+
type: "object",
1159
1264
allOf: [
1160
1265
{
1161
1161
-
'$ref': '#/components/schemas/ModelWithString'
1266
1266
+
'$ref': "#/components/schemas/ModelWithString"
1162
1267
},
1163
1268
{
1164
1164
-
'$ref': '#/components/schemas/ModelThatExtends'
1269
1269
+
'$ref': "#/components/schemas/ModelThatExtends"
1165
1270
},
1166
1271
{
1167
1167
-
type: 'object',
1272
1272
+
type: "object",
1168
1273
properties: {
1169
1274
propExtendsC: {
1170
1170
-
type: 'string'
1275
1275
+
type: "string"
1171
1276
},
1172
1277
propExtendsD: {
1173
1173
-
'$ref': '#/components/schemas/ModelWithString'
1278
1278
+
'$ref': "#/components/schemas/ModelWithString"
1174
1279
}
1175
1280
}
1176
1281
}
···
1178
1283
} as const;
1179
1284
1180
1285
export const ModelWithPatternSchema = {
1181
1181
-
description: 'This is a model that contains a some patterns',
1182
1182
-
type: 'object',
1183
1183
-
required: ['key', 'name'],
1286
1286
+
description: "This is a model that contains a some patterns",
1287
1287
+
type: "object",
1288
1288
+
required: [
1289
1289
+
"key",
1290
1290
+
"name"
1291
1291
+
],
1184
1292
properties: {
1185
1293
key: {
1186
1294
maxLength: 64,
1187
1187
-
pattern: '^[a-zA-Z0-9_]*$',
1188
1188
-
type: 'string'
1295
1295
+
pattern: "^[a-zA-Z0-9_]*$",
1296
1296
+
type: "string"
1189
1297
},
1190
1298
name: {
1191
1299
maxLength: 255,
1192
1192
-
type: 'string'
1300
1300
+
type: "string"
1193
1301
},
1194
1302
enabled: {
1195
1195
-
type: 'boolean',
1303
1303
+
type: "boolean",
1196
1304
readOnly: true
1197
1305
},
1198
1306
modified: {
1199
1199
-
type: 'string',
1200
1200
-
format: 'date-time',
1307
1307
+
type: "string",
1308
1308
+
format: "date-time",
1201
1309
readOnly: true
1202
1310
},
1203
1311
id: {
1204
1204
-
type: 'string',
1205
1205
-
pattern: '^\\d{2}-\\d{3}-\\d{4}$'
1312
1312
+
type: "string",
1313
1313
+
pattern: "^\\d{2}-\\d{3}-\\d{4}$"
1206
1314
},
1207
1315
text: {
1208
1208
-
type: 'string',
1209
1209
-
pattern: '^\\w+$'
1316
1316
+
type: "string",
1317
1317
+
pattern: "^\\w+$"
1210
1318
},
1211
1319
patternWithSingleQuotes: {
1212
1212
-
type: 'string',
1320
1320
+
type: "string",
1213
1321
pattern: "^[a-zA-Z0-9']*$"
1214
1322
},
1215
1323
patternWithNewline: {
1216
1216
-
type: 'string',
1217
1217
-
pattern: 'aaa\\nbbb'
1324
1324
+
type: "string",
1325
1325
+
pattern: "aaa\\nbbb"
1218
1326
},
1219
1327
patternWithBacktick: {
1220
1220
-
type: 'string',
1221
1221
-
pattern: 'aaa`bbb'
1328
1328
+
type: "string",
1329
1329
+
pattern: "aaa`bbb"
1222
1330
}
1223
1331
}
1224
1332
} as const;
1225
1333
1226
1334
export const FileSchema = {
1227
1227
-
required: ['mime'],
1228
1228
-
type: 'object',
1335
1335
+
required: [
1336
1336
+
"mime"
1337
1337
+
],
1338
1338
+
type: "object",
1229
1339
properties: {
1230
1340
id: {
1231
1231
-
title: 'Id',
1232
1232
-
type: 'string',
1341
1341
+
title: "Id",
1342
1342
+
type: "string",
1233
1343
readOnly: true,
1234
1344
minLength: 1
1235
1345
},
1236
1346
updated_at: {
1237
1237
-
title: 'Updated at',
1238
1238
-
type: 'string',
1239
1239
-
format: 'date-time',
1347
1347
+
title: "Updated at",
1348
1348
+
type: "string",
1349
1349
+
format: "date-time",
1240
1350
readOnly: true
1241
1351
},
1242
1352
created_at: {
1243
1243
-
title: 'Created at',
1244
1244
-
type: 'string',
1245
1245
-
format: 'date-time',
1353
1353
+
title: "Created at",
1354
1354
+
type: "string",
1355
1355
+
format: "date-time",
1246
1356
readOnly: true
1247
1357
},
1248
1358
mime: {
1249
1249
-
title: 'Mime',
1250
1250
-
type: 'string',
1359
1359
+
title: "Mime",
1360
1360
+
type: "string",
1251
1361
maxLength: 24,
1252
1362
minLength: 1
1253
1363
},
1254
1364
file: {
1255
1255
-
title: 'File',
1256
1256
-
type: 'string',
1365
1365
+
title: "File",
1366
1366
+
type: "string",
1257
1367
readOnly: true,
1258
1258
-
format: 'uri'
1368
1368
+
format: "uri"
1259
1369
}
1260
1370
}
1261
1371
} as const;
1262
1372
1263
1373
export const defaultSchema = {
1264
1264
-
type: 'object',
1374
1374
+
type: "object",
1265
1375
properties: {
1266
1376
name: {
1267
1267
-
type: 'string'
1377
1377
+
type: "string"
1268
1378
}
1269
1379
}
1270
1380
} as const;
1271
1381
1272
1382
export const PageableSchema = {
1273
1273
-
type: 'object',
1383
1383
+
type: "object",
1274
1384
properties: {
1275
1385
page: {
1276
1386
minimum: 0,
1277
1277
-
type: 'integer',
1278
1278
-
format: 'int32',
1387
1387
+
type: "integer",
1388
1388
+
format: "int32",
1279
1389
default: 0
1280
1390
},
1281
1391
size: {
1282
1392
minimum: 1,
1283
1283
-
type: 'integer',
1284
1284
-
format: 'int32'
1393
1393
+
type: "integer",
1394
1394
+
format: "int32"
1285
1395
},
1286
1396
sort: {
1287
1287
-
type: 'array',
1397
1397
+
type: "array",
1288
1398
items: {
1289
1289
-
type: 'string'
1399
1399
+
type: "string"
1290
1400
}
1291
1401
}
1292
1402
}
1293
1403
} as const;
1294
1404
1295
1405
export const FreeFormObjectWithoutAdditionalPropertiesSchema = {
1296
1296
-
description: 'This is a free-form object without additionalProperties.',
1297
1297
-
type: 'object'
1406
1406
+
description: "This is a free-form object without additionalProperties.",
1407
1407
+
type: "object"
1298
1408
} as const;
1299
1409
1300
1410
export const FreeFormObjectWithAdditionalPropertiesEqTrueSchema = {
1301
1301
-
description: 'This is a free-form object with additionalProperties: true.',
1302
1302
-
type: 'object',
1411
1411
+
description: "This is a free-form object with additionalProperties: true.",
1412
1412
+
type: "object",
1303
1413
additionalProperties: true
1304
1414
} as const;
1305
1415
1306
1416
export const FreeFormObjectWithAdditionalPropertiesEqEmptyObjectSchema = {
1307
1307
-
description: 'This is a free-form object with additionalProperties: {}.',
1308
1308
-
type: 'object',
1417
1417
+
description: "This is a free-form object with additionalProperties: {}.",
1418
1418
+
type: "object",
1309
1419
additionalProperties: {}
1310
1420
} as const;
1311
1421
1312
1422
export const ModelWithConstSchema = {
1313
1313
-
type: 'object',
1423
1423
+
type: "object",
1314
1424
properties: {
1315
1425
String: {
1316
1316
-
enum: ['String'],
1317
1317
-
type: 'string'
1426
1426
+
enum: [
1427
1427
+
"String"
1428
1428
+
],
1429
1429
+
type: "string"
1318
1430
},
1319
1431
number: {
1320
1320
-
enum: [0],
1321
1321
-
type: 'number'
1432
1432
+
enum: [
1433
1433
+
0
1434
1434
+
],
1435
1435
+
type: "number"
1322
1436
},
1323
1437
null: {
1324
1438
nullable: true
1325
1439
},
1326
1440
withType: {
1327
1327
-
enum: ['Some string'],
1328
1328
-
type: 'string'
1441
1441
+
enum: [
1442
1442
+
"Some string"
1443
1443
+
],
1444
1444
+
type: "string"
1329
1445
}
1330
1446
}
1331
1447
} as const;
1332
1448
1333
1449
export const ModelWithAdditionalPropertiesEqTrueSchema = {
1334
1334
-
description: 'This is a model with one property and additionalProperties: true',
1335
1335
-
type: 'object',
1450
1450
+
description: "This is a model with one property and additionalProperties: true",
1451
1451
+
type: "object",
1336
1452
properties: {
1337
1453
prop: {
1338
1338
-
description: 'This is a simple string property',
1339
1339
-
type: 'string'
1454
1454
+
description: "This is a simple string property",
1455
1455
+
type: "string"
1340
1456
}
1341
1457
},
1342
1458
additionalProperties: true
···
1351
1467
items: {
1352
1468
anyOf: [
1353
1469
{
1354
1354
-
type: 'string'
1470
1470
+
type: "string"
1355
1471
},
1356
1472
{
1357
1357
-
type: 'boolean'
1473
1473
+
type: "boolean"
1358
1474
}
1359
1475
]
1360
1476
},
1361
1361
-
type: 'array'
1477
1477
+
type: "array"
1362
1478
}
1363
1479
]
1364
1480
}
1365
1481
},
1366
1366
-
type: 'object'
1482
1482
+
type: "object"
1367
1483
} as const;
1368
1484
1369
1485
export const CompositionWithOneOfAndPropertiesSchema = {
1370
1370
-
type: 'object',
1486
1486
+
type: "object",
1371
1487
oneOf: [
1372
1488
{
1373
1373
-
type: 'object',
1374
1374
-
required: ['foo'],
1489
1489
+
type: "object",
1490
1490
+
required: [
1491
1491
+
"foo"
1492
1492
+
],
1375
1493
properties: {
1376
1494
foo: {
1377
1377
-
'$ref': '#/components/parameters/SimpleParameter'
1495
1495
+
'$ref': "#/components/parameters/SimpleParameter"
1378
1496
}
1379
1497
},
1380
1498
additionalProperties: false
1381
1499
},
1382
1500
{
1383
1383
-
type: 'object',
1384
1384
-
required: ['bar'],
1501
1501
+
type: "object",
1502
1502
+
required: [
1503
1503
+
"bar"
1504
1504
+
],
1385
1505
properties: {
1386
1506
bar: {
1387
1387
-
'$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串'
1507
1507
+
'$ref': "#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串"
1388
1508
}
1389
1509
},
1390
1510
additionalProperties: false
1391
1511
}
1392
1512
],
1393
1393
-
required: ['baz', 'qux'],
1513
1513
+
required: [
1514
1514
+
"baz",
1515
1515
+
"qux"
1516
1516
+
],
1394
1517
properties: {
1395
1518
baz: {
1396
1396
-
type: 'integer',
1397
1397
-
format: 'uint16',
1519
1519
+
type: "integer",
1520
1520
+
format: "uint16",
1398
1521
minimum: 0,
1399
1522
nullable: true
1400
1523
},
1401
1524
qux: {
1402
1402
-
type: 'integer',
1403
1403
-
format: 'uint8',
1525
1525
+
type: "integer",
1526
1526
+
format: "uint8",
1404
1527
minimum: 0
1405
1528
}
1406
1529
}
1407
1530
} as const;
1408
1531
1409
1532
export const NullableObjectSchema = {
1410
1410
-
description: 'An object that can be null',
1533
1533
+
description: "An object that can be null",
1411
1534
nullable: true,
1412
1412
-
type: 'object',
1535
1535
+
type: "object",
1413
1536
properties: {
1414
1537
foo: {
1415
1415
-
type: 'string'
1538
1538
+
type: "string"
1416
1539
}
1417
1540
},
1418
1541
default: null
1419
1542
} as const;
1420
1543
1421
1544
export const CharactersInDescriptionSchema = {
1422
1422
-
type: 'string',
1423
1423
-
description: 'Some % character'
1545
1545
+
type: "string",
1546
1546
+
description: "Some % character"
1424
1547
} as const;
1425
1548
1426
1549
export const ModelWithNullableObjectSchema = {
1427
1427
-
type: 'object',
1550
1550
+
type: "object",
1428
1551
properties: {
1429
1552
data: {
1430
1430
-
'$ref': '#/components/schemas/NullableObject'
1553
1553
+
'$ref': "#/components/schemas/NullableObject"
1431
1554
}
1432
1555
}
1433
1556
} as const;
···
1435
1558
export const ModelWithOneOfEnumSchema = {
1436
1559
oneOf: [
1437
1560
{
1438
1438
-
type: 'object',
1439
1439
-
required: ['foo'],
1561
1561
+
type: "object",
1562
1562
+
required: [
1563
1563
+
"foo"
1564
1564
+
],
1440
1565
properties: {
1441
1566
foo: {
1442
1442
-
type: 'string',
1443
1443
-
enum: ['Bar']
1567
1567
+
type: "string",
1568
1568
+
enum: [
1569
1569
+
"Bar"
1570
1570
+
]
1444
1571
}
1445
1572
}
1446
1573
},
1447
1574
{
1448
1448
-
type: 'object',
1449
1449
-
required: ['foo'],
1575
1575
+
type: "object",
1576
1576
+
required: [
1577
1577
+
"foo"
1578
1578
+
],
1450
1579
properties: {
1451
1580
foo: {
1452
1452
-
type: 'string',
1453
1453
-
enum: ['Baz']
1581
1581
+
type: "string",
1582
1582
+
enum: [
1583
1583
+
"Baz"
1584
1584
+
]
1454
1585
}
1455
1586
}
1456
1587
},
1457
1588
{
1458
1458
-
type: 'object',
1459
1459
-
required: ['foo'],
1589
1589
+
type: "object",
1590
1590
+
required: [
1591
1591
+
"foo"
1592
1592
+
],
1460
1593
properties: {
1461
1594
foo: {
1462
1462
-
type: 'string',
1463
1463
-
enum: ['Qux']
1595
1595
+
type: "string",
1596
1596
+
enum: [
1597
1597
+
"Qux"
1598
1598
+
]
1464
1599
}
1465
1600
}
1466
1601
},
1467
1602
{
1468
1468
-
type: 'object',
1469
1469
-
required: ['content', 'foo'],
1603
1603
+
type: "object",
1604
1604
+
required: [
1605
1605
+
"content",
1606
1606
+
"foo"
1607
1607
+
],
1470
1608
properties: {
1471
1609
content: {
1472
1472
-
type: 'string',
1473
1473
-
format: 'date-time'
1610
1610
+
type: "string",
1611
1611
+
format: "date-time"
1474
1612
},
1475
1613
foo: {
1476
1476
-
type: 'string',
1477
1477
-
enum: ['Quux']
1614
1614
+
type: "string",
1615
1615
+
enum: [
1616
1616
+
"Quux"
1617
1617
+
]
1478
1618
}
1479
1619
}
1480
1620
},
1481
1621
{
1482
1482
-
type: 'object',
1483
1483
-
required: ['content', 'foo'],
1622
1622
+
type: "object",
1623
1623
+
required: [
1624
1624
+
"content",
1625
1625
+
"foo"
1626
1626
+
],
1484
1627
properties: {
1485
1628
content: {
1486
1486
-
type: 'array',
1629
1629
+
type: "array",
1487
1630
items: {
1488
1488
-
type: 'string',
1489
1489
-
format: 'date-time'
1631
1631
+
type: "string",
1632
1632
+
format: "date-time"
1490
1633
},
1491
1634
maxItems: 2,
1492
1635
minItems: 2
1493
1636
},
1494
1637
foo: {
1495
1495
-
type: 'string',
1496
1496
-
enum: ['Corge']
1638
1638
+
type: "string",
1639
1639
+
enum: [
1640
1640
+
"Corge"
1641
1641
+
]
1497
1642
}
1498
1643
}
1499
1644
}
···
1501
1646
} as const;
1502
1647
1503
1648
export const ModelWithNestedArrayEnumsDataFooSchema = {
1504
1504
-
enum: ['foo', 'bar'],
1505
1505
-
type: 'string'
1649
1649
+
enum: [
1650
1650
+
"foo",
1651
1651
+
"bar"
1652
1652
+
],
1653
1653
+
type: "string"
1506
1654
} as const;
1507
1655
1508
1656
export const ModelWithNestedArrayEnumsDataBarSchema = {
1509
1509
-
enum: ['baz', 'qux'],
1510
1510
-
type: 'string'
1657
1657
+
enum: [
1658
1658
+
"baz",
1659
1659
+
"qux"
1660
1660
+
],
1661
1661
+
type: "string"
1511
1662
} as const;
1512
1663
1513
1664
export const ModelWithNestedArrayEnumsDataSchema = {
1514
1514
-
type: 'object',
1665
1665
+
type: "object",
1515
1666
properties: {
1516
1667
foo: {
1517
1517
-
type: 'array',
1668
1668
+
type: "array",
1518
1669
items: {
1519
1519
-
'$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo'
1670
1670
+
'$ref': "#/components/schemas/ModelWithNestedArrayEnumsDataFoo"
1520
1671
}
1521
1672
},
1522
1673
bar: {
1523
1523
-
type: 'array',
1674
1674
+
type: "array",
1524
1675
items: {
1525
1525
-
'$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataBar'
1676
1676
+
'$ref': "#/components/schemas/ModelWithNestedArrayEnumsDataBar"
1526
1677
}
1527
1678
}
1528
1679
}
1529
1680
} as const;
1530
1681
1531
1682
export const ModelWithNestedArrayEnumsSchema = {
1532
1532
-
type: 'object',
1683
1683
+
type: "object",
1533
1684
properties: {
1534
1685
array_strings: {
1535
1535
-
type: 'array',
1686
1686
+
type: "array",
1536
1687
items: {
1537
1537
-
type: 'string'
1688
1688
+
type: "string"
1538
1689
}
1539
1690
},
1540
1691
data: {
1541
1692
allOf: [
1542
1693
{
1543
1543
-
'$ref': '#/components/schemas/ModelWithNestedArrayEnumsData'
1694
1694
+
'$ref': "#/components/schemas/ModelWithNestedArrayEnumsData"
1544
1695
}
1545
1696
]
1546
1697
}
···
1548
1699
} as const;
1549
1700
1550
1701
export const ModelWithNestedCompositionEnumsSchema = {
1551
1551
-
type: 'object',
1702
1702
+
type: "object",
1552
1703
properties: {
1553
1704
foo: {
1554
1705
allOf: [
1555
1706
{
1556
1556
-
'$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo'
1707
1707
+
'$ref': "#/components/schemas/ModelWithNestedArrayEnumsDataFoo"
1557
1708
}
1558
1709
]
1559
1710
}
···
1561
1712
} as const;
1562
1713
1563
1714
export const ModelWithReadOnlyAndWriteOnlySchema = {
1564
1564
-
type: 'object',
1565
1565
-
required: ['foo', 'bar'],
1715
1715
+
type: "object",
1716
1716
+
required: [
1717
1717
+
"foo",
1718
1718
+
"bar"
1719
1719
+
],
1566
1720
properties: {
1567
1721
foo: {
1568
1568
-
type: 'string'
1722
1722
+
type: "string"
1569
1723
},
1570
1724
bar: {
1571
1725
readOnly: true,
1572
1572
-
type: 'string'
1726
1726
+
type: "string"
1573
1727
}
1574
1728
}
1575
1729
} as const;
1576
1730
1577
1731
export const ModelWithConstantSizeArraySchema = {
1578
1578
-
type: 'array',
1732
1732
+
type: "array",
1579
1733
items: {
1580
1580
-
type: 'number'
1734
1734
+
type: "number"
1581
1735
},
1582
1736
minItems: 2,
1583
1737
maxItems: 2
1584
1738
} as const;
1585
1739
1586
1740
export const ModelWithAnyOfConstantSizeArraySchema = {
1587
1587
-
type: 'array',
1741
1741
+
type: "array",
1588
1742
items: {
1589
1743
oneOf: [
1590
1744
{
1591
1591
-
type: 'number'
1745
1745
+
type: "number"
1592
1746
},
1593
1747
{
1594
1594
-
type: 'string'
1748
1748
+
type: "string"
1595
1749
}
1596
1750
]
1597
1751
},
···
1600
1754
} as const;
1601
1755
1602
1756
export const ModelWithPrefixItemsConstantSizeArraySchema = {
1603
1603
-
type: 'array',
1757
1757
+
type: "array",
1604
1758
items: {
1605
1759
oneOf: [
1606
1760
{
1607
1607
-
'$ref': '#/components/schemas/ModelWithInteger'
1761
1761
+
'$ref': "#/components/schemas/ModelWithInteger"
1608
1762
},
1609
1763
{
1610
1610
-
type: 'number'
1764
1764
+
type: "number"
1611
1765
},
1612
1766
{
1613
1613
-
type: 'string'
1767
1767
+
type: "string"
1614
1768
}
1615
1769
]
1616
1770
}
1617
1771
} as const;
1618
1772
1619
1773
export const ModelWithAnyOfConstantSizeArrayNullableSchema = {
1620
1620
-
type: 'array',
1774
1774
+
type: "array",
1621
1775
items: {
1622
1776
oneOf: [
1623
1777
{
1624
1624
-
type: 'number',
1778
1778
+
type: "number",
1625
1779
nullable: true
1626
1780
},
1627
1781
{
1628
1628
-
type: 'string'
1782
1782
+
type: "string"
1629
1783
}
1630
1784
]
1631
1785
},
···
1634
1788
} as const;
1635
1789
1636
1790
export const ModelWithAnyOfConstantSizeArrayWithNSizeAndOptionsSchema = {
1637
1637
-
type: 'array',
1791
1791
+
type: "array",
1638
1792
items: {
1639
1793
oneOf: [
1640
1794
{
1641
1641
-
type: 'number'
1795
1795
+
type: "number"
1642
1796
},
1643
1797
{
1644
1644
-
'$ref': '#/components/schemas/import'
1798
1798
+
'$ref': "#/components/schemas/import"
1645
1799
}
1646
1800
]
1647
1801
},
···
1650
1804
} as const;
1651
1805
1652
1806
export const ModelWithAnyOfConstantSizeArrayAndIntersectSchema = {
1653
1653
-
type: 'array',
1807
1807
+
type: "array",
1654
1808
items: {
1655
1809
allOf: [
1656
1810
{
1657
1657
-
type: 'number'
1811
1811
+
type: "number"
1658
1812
},
1659
1813
{
1660
1660
-
type: 'string'
1814
1814
+
type: "string"
1661
1815
}
1662
1816
]
1663
1817
},
···
1666
1820
} as const;
1667
1821
1668
1822
export const ModelWithNumericEnumUnionSchema = {
1669
1669
-
type: 'object',
1823
1823
+
type: "object",
1670
1824
properties: {
1671
1825
value: {
1672
1672
-
type: 'number',
1673
1673
-
description: 'Период',
1674
1674
-
enum: [-10, -1, 0, 1, 3, 6, 12]
1826
1826
+
type: "number",
1827
1827
+
description: "Период",
1828
1828
+
enum: [
1829
1829
+
-10,
1830
1830
+
-1,
1831
1831
+
0,
1832
1832
+
1,
1833
1833
+
3,
1834
1834
+
6,
1835
1835
+
12
1836
1836
+
]
1675
1837
}
1676
1838
}
1677
1839
} as const;
1678
1840
1679
1841
export const ModelWithBackticksInDescriptionSchema = {
1680
1680
-
description: 'Some description with `back ticks`',
1681
1681
-
type: 'object',
1842
1842
+
description: "Some description with `back ticks`",
1843
1843
+
type: "object",
1682
1844
properties: {
1683
1845
template: {
1684
1684
-
type: 'string',
1685
1685
-
description: `The template \`that\` should be used for parsing and importing the contents of the CSV file.
1686
1686
-
1687
1687
-
<br/><p>There is one placeholder currently supported:<ul> <li><b>\${x}</b> - refers to the n-th column in the CSV file, e.g. \${1}, \${2}, ...)</li></ul><p>Example of a correct JSON template:</p>
1688
1688
-
<pre>
1689
1689
-
[
1690
1690
-
{
1691
1691
-
"resourceType": "Asset",
1692
1692
-
"identifier": {
1693
1693
-
"name": "\${1}",
1694
1694
-
"domain": {
1695
1695
-
"name": "\${2}",
1696
1696
-
"community": {
1697
1697
-
"name": "Some Community"
1698
1698
-
}
1699
1699
-
}
1700
1700
-
},
1701
1701
-
"attributes" : {
1702
1702
-
"00000000-0000-0000-0000-000000003115" : [ {
1703
1703
-
"value" : "\${3}"
1704
1704
-
} ],
1705
1705
-
"00000000-0000-0000-0000-000000000222" : [ {
1706
1706
-
"value" : "\${4}"
1707
1707
-
} ]
1708
1708
-
}
1709
1709
-
}
1710
1710
-
]
1711
1711
-
</pre>`
1846
1846
+
type: "string",
1847
1847
+
description: "The template `that` should be used for parsing and importing the contents of the CSV file.\n\n<br/><p>There is one placeholder currently supported:<ul> <li><b>${x}</b> - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)</li></ul><p>Example of a correct JSON template:</p>\n<pre>\n[\n {\n \"resourceType\": \"Asset\",\n \"identifier\": {\n \"name\": \"${1}\",\n \"domain\": {\n \"name\": \"${2}\",\n \"community\": {\n \"name\": \"Some Community\"\n }\n }\n },\n \"attributes\" : {\n \"00000000-0000-0000-0000-000000003115\" : [ {\n \"value\" : \"${3}\"\n } ],\n \"00000000-0000-0000-0000-000000000222\" : [ {\n \"value\" : \"${4}\"\n } ]\n }\n }\n]\n</pre>"
1712
1848
}
1713
1849
}
1714
1850
} as const;
1715
1851
1716
1852
export const ModelWithOneOfAndPropertiesSchema = {
1717
1717
-
type: 'object',
1853
1853
+
type: "object",
1718
1854
oneOf: [
1719
1855
{
1720
1720
-
'$ref': '#/components/parameters/SimpleParameter'
1856
1856
+
'$ref': "#/components/parameters/SimpleParameter"
1721
1857
},
1722
1858
{
1723
1723
-
'$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串'
1859
1859
+
'$ref': "#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串"
1724
1860
}
1725
1861
],
1726
1726
-
required: ['baz', 'qux'],
1862
1862
+
required: [
1863
1863
+
"baz",
1864
1864
+
"qux"
1865
1865
+
],
1727
1866
properties: {
1728
1867
baz: {
1729
1729
-
type: 'integer',
1730
1730
-
format: 'uint16',
1868
1868
+
type: "integer",
1869
1869
+
format: "uint16",
1731
1870
minimum: 0,
1732
1871
nullable: true
1733
1872
},
1734
1873
qux: {
1735
1735
-
type: 'integer',
1736
1736
-
format: 'uint8',
1874
1874
+
type: "integer",
1875
1875
+
format: "uint8",
1737
1876
minimum: 0
1738
1877
}
1739
1878
}
1740
1879
} as const;
1741
1880
1742
1881
export const ParameterSimpleParameterUnusedSchema = {
1743
1743
-
description: 'Model used to test deduplication strategy (unused)',
1744
1744
-
type: 'string'
1882
1882
+
description: "Model used to test deduplication strategy (unused)",
1883
1883
+
type: "string"
1745
1884
} as const;
1746
1885
1747
1886
export const PostServiceWithEmptyTagResponseSchema = {
1748
1748
-
description: 'Model used to test deduplication strategy',
1749
1749
-
type: 'string'
1887
1887
+
description: "Model used to test deduplication strategy",
1888
1888
+
type: "string"
1750
1889
} as const;
1751
1890
1752
1891
export const PostServiceWithEmptyTagResponse2Schema = {
1753
1753
-
description: 'Model used to test deduplication strategy',
1754
1754
-
type: 'string'
1892
1892
+
description: "Model used to test deduplication strategy",
1893
1893
+
type: "string"
1755
1894
} as const;
1756
1895
1757
1896
export const DeleteFooDataSchema = {
1758
1758
-
description: 'Model used to test deduplication strategy',
1759
1759
-
type: 'string'
1897
1897
+
description: "Model used to test deduplication strategy",
1898
1898
+
type: "string"
1760
1899
} as const;
1761
1900
1762
1901
export const DeleteFooData2Schema = {
1763
1763
-
description: 'Model used to test deduplication strategy',
1764
1764
-
type: 'string'
1902
1902
+
description: "Model used to test deduplication strategy",
1903
1903
+
type: "string"
1765
1904
} as const;
1766
1905
1767
1906
export const importSchema = {
1768
1768
-
description: 'Model with restricted keyword name',
1769
1769
-
type: 'string'
1907
1907
+
description: "Model with restricted keyword name",
1908
1908
+
type: "string"
1770
1909
} as const;
1771
1910
1772
1911
export const SchemaWithFormRestrictedKeysSchema = {
1773
1912
properties: {
1774
1913
description: {
1775
1775
-
type: 'string'
1914
1914
+
type: "string"
1776
1915
},
1777
1916
'x-enum-descriptions': {
1778
1778
-
type: 'string'
1917
1917
+
type: "string"
1779
1918
},
1780
1919
'x-enum-varnames': {
1781
1781
-
type: 'string'
1920
1920
+
type: "string"
1782
1921
},
1783
1922
'x-enumNames': {
1784
1784
-
type: 'string'
1923
1923
+
type: "string"
1785
1924
},
1786
1925
title: {
1787
1787
-
type: 'string'
1926
1926
+
type: "string"
1788
1927
},
1789
1928
object: {
1790
1790
-
type: 'object',
1929
1929
+
type: "object",
1791
1930
properties: {
1792
1931
description: {
1793
1793
-
type: 'string'
1932
1932
+
type: "string"
1794
1933
},
1795
1934
'x-enum-descriptions': {
1796
1796
-
type: 'string'
1935
1935
+
type: "string"
1797
1936
},
1798
1937
'x-enum-varnames': {
1799
1799
-
type: 'string'
1938
1938
+
type: "string"
1800
1939
},
1801
1940
'x-enumNames': {
1802
1802
-
type: 'string'
1941
1941
+
type: "string"
1803
1942
},
1804
1943
title: {
1805
1805
-
type: 'string'
1944
1944
+
type: "string"
1806
1945
}
1807
1946
}
1808
1947
},
1809
1948
array: {
1810
1810
-
type: 'array',
1949
1949
+
type: "array",
1811
1950
items: {
1812
1812
-
type: 'object',
1951
1951
+
type: "object",
1813
1952
properties: {
1814
1953
description: {
1815
1815
-
type: 'string'
1954
1954
+
type: "string"
1816
1955
},
1817
1956
'x-enum-descriptions': {
1818
1818
-
type: 'string'
1957
1957
+
type: "string"
1819
1958
},
1820
1959
'x-enum-varnames': {
1821
1821
-
type: 'string'
1960
1960
+
type: "string"
1822
1961
},
1823
1962
'x-enumNames': {
1824
1824
-
type: 'string'
1963
1963
+
type: "string"
1825
1964
},
1826
1965
title: {
1827
1827
-
type: 'string'
1966
1966
+
type: "string"
1828
1967
}
1829
1968
}
1830
1969
}
···
1833
1972
} as const;
1834
1973
1835
1974
export const io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptionsSchema = {
1836
1836
-
description: 'This schema was giving PascalCase transformations a hard time',
1975
1975
+
description: "This schema was giving PascalCase transformations a hard time",
1837
1976
properties: {
1838
1977
preconditions: {
1839
1978
allOf: [
1840
1979
{
1841
1841
-
'$ref': '#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions'
1980
1980
+
'$ref': "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions"
1842
1981
}
1843
1982
],
1844
1844
-
description: 'Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.'
1983
1983
+
description: "Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned."
1845
1984
}
1846
1985
},
1847
1847
-
type: 'object'
1986
1986
+
type: "object"
1848
1987
} as const;
1849
1988
1850
1989
export const io_k8s_apimachinery_pkg_apis_meta_v1_PreconditionsSchema = {
1851
1851
-
description: 'This schema was giving PascalCase transformations a hard time',
1990
1990
+
description: "This schema was giving PascalCase transformations a hard time",
1852
1991
properties: {
1853
1992
resourceVersion: {
1854
1854
-
description: 'Specifies the target ResourceVersion',
1855
1855
-
type: 'string'
1993
1993
+
description: "Specifies the target ResourceVersion",
1994
1994
+
type: "string"
1856
1995
},
1857
1996
uid: {
1858
1858
-
description: 'Specifies the target UID.',
1859
1859
-
type: 'string'
1997
1997
+
description: "Specifies the target UID.",
1998
1998
+
type: "string"
1860
1999
}
1861
2000
},
1862
1862
-
type: 'object'
2001
2001
+
type: "object"
1863
2002
} as const;
1864
2003
1865
2004
export const AdditionalPropertiesUnknownIssueSchema = {
1866
1866
-
type: 'object',
2005
2005
+
type: "object",
1867
2006
additionalProperties: {
1868
2007
anyOf: [
1869
2008
{
1870
1870
-
type: 'string'
2009
2009
+
type: "string"
1871
2010
},
1872
2011
{
1873
1873
-
type: 'number'
2012
2012
+
type: "number"
1874
2013
}
1875
2014
]
1876
2015
}
1877
2016
} as const;
1878
2017
1879
2018
export const AdditionalPropertiesUnknownIssue2Schema = {
1880
1880
-
type: 'object',
2019
2019
+
type: "object",
1881
2020
additionalProperties: {
1882
2021
anyOf: [
1883
2022
{
1884
1884
-
type: 'string'
2023
2023
+
type: "string"
1885
2024
},
1886
2025
{
1887
1887
-
type: 'number'
2026
2026
+
type: "number"
1888
2027
}
1889
2028
]
1890
2029
}
1891
2030
} as const;
1892
2031
1893
2032
export const AdditionalPropertiesUnknownIssue3Schema = {
1894
1894
-
type: 'object',
2033
2033
+
type: "object",
1895
2034
allOf: [
1896
2035
{
1897
1897
-
type: 'string'
2036
2036
+
type: "string"
1898
2037
},
1899
2038
{
1900
1900
-
type: 'object',
1901
1901
-
required: ['entries'],
2039
2039
+
type: "object",
2040
2040
+
required: [
2041
2041
+
"entries"
2042
2042
+
],
1902
2043
properties: {
1903
2044
entries: {
1904
1904
-
type: 'object',
2045
2045
+
type: "object",
1905
2046
additionalProperties: {
1906
1906
-
'$ref': '#/components/schemas/AdditionalPropertiesUnknownIssue'
2047
2047
+
'$ref': "#/components/schemas/AdditionalPropertiesUnknownIssue"
1907
2048
}
1908
2049
}
1909
2050
}
···
1912
2053
} as const;
1913
2054
1914
2055
export const AdditionalPropertiesIntegerIssueSchema = {
1915
1915
-
type: 'object',
1916
1916
-
required: ['value'],
2056
2056
+
type: "object",
2057
2057
+
required: [
2058
2058
+
"value"
2059
2059
+
],
1917
2060
properties: {
1918
2061
value: {
1919
1919
-
type: 'integer'
2062
2062
+
type: "integer"
1920
2063
}
1921
2064
},
1922
2065
additionalProperties: {
1923
1923
-
type: 'integer'
2066
2066
+
type: "integer"
1924
2067
}
1925
2068
} as const;
1926
2069
···
1931
2074
{
1932
2075
oneOf: [
1933
2076
{
1934
1934
-
'$ref': '#/components/schemas/ConstValue'
2077
2077
+
'$ref': "#/components/schemas/ConstValue"
1935
2078
},
1936
2079
{
1937
1937
-
'$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]'
2080
2080
+
'$ref': "#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]"
1938
2081
}
1939
2082
]
1940
2083
},
1941
2084
{
1942
1942
-
'$ref': '#/components/schemas/3e-num_1Период'
2085
2085
+
'$ref': "#/components/schemas/3e-num_1Период"
1943
2086
}
1944
2087
]
1945
2088
},
1946
2089
{
1947
1947
-
'$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]'
2090
2090
+
'$ref': "#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]"
1948
2091
}
1949
2092
]
1950
2093
} as const;
1951
2094
1952
2095
export const Generic_Schema_Duplicate_Issue_1_System_Boolean_Schema = {
1953
1953
-
type: 'object',
2096
2096
+
type: "object",
1954
2097
properties: {
1955
2098
item: {
1956
1956
-
type: 'boolean'
2099
2099
+
type: "boolean"
1957
2100
},
1958
2101
error: {
1959
1959
-
type: 'string',
2102
2102
+
type: "string",
1960
2103
nullable: true
1961
2104
},
1962
2105
hasError: {
1963
1963
-
type: 'boolean',
2106
2106
+
type: "boolean",
1964
2107
readOnly: true
1965
2108
},
1966
2109
data: {
1967
1967
-
type: 'object',
2110
2110
+
type: "object",
1968
2111
additionalProperties: false
1969
2112
}
1970
2113
},
···
1972
2115
} as const;
1973
2116
1974
2117
export const Generic_Schema_Duplicate_Issue_1_System_String_Schema = {
1975
1975
-
type: 'object',
2118
2118
+
type: "object",
1976
2119
properties: {
1977
2120
item: {
1978
1978
-
type: 'string',
2121
2121
+
type: "string",
1979
2122
nullable: true
1980
2123
},
1981
2124
error: {
1982
1982
-
type: 'string',
2125
2125
+
type: "string",
1983
2126
nullable: true
1984
2127
},
1985
2128
hasError: {
1986
1986
-
type: 'boolean',
2129
2129
+
type: "boolean",
1987
2130
readOnly: true
1988
2131
}
1989
2132
},
···
1991
2134
} as const;
1992
2135
1993
2136
export const external_shared_ExternalSharedModelSchema = {
1994
1994
-
type: 'object',
2137
2137
+
type: "object",
1995
2138
properties: {
1996
2139
id: {
1997
1997
-
type: 'string'
2140
2140
+
type: "string"
1998
2141
},
1999
2142
name: {
2000
2000
-
type: 'string'
2143
2143
+
type: "string"
2001
2144
}
2002
2145
},
2003
2003
-
required: ['id']
2146
2146
+
required: [
2147
2147
+
"id"
2148
2148
+
]
2004
2149
} as const;
2005
2150
2006
2151
export const ModelWithReferenceWritableSchema = {
2007
2007
-
description: 'This is a model with one property containing a reference',
2008
2008
-
type: 'object',
2152
2152
+
description: "This is a model with one property containing a reference",
2153
2153
+
type: "object",
2009
2154
properties: {
2010
2155
prop: {
2011
2011
-
'$ref': '#/components/schemas/ModelWithPropertiesWritable'
2156
2156
+
'$ref': "#/components/schemas/ModelWithPropertiesWritable"
2012
2157
}
2013
2158
}
2014
2159
} as const;
2015
2160
2016
2161
export const ModelWithArrayReadOnlyAndWriteOnlyWritableSchema = {
2017
2017
-
description: 'This is a model with one property containing an array',
2018
2018
-
type: 'object',
2162
2162
+
description: "This is a model with one property containing an array",
2163
2163
+
type: "object",
2019
2164
properties: {
2020
2165
prop: {
2021
2021
-
type: 'array',
2166
2166
+
type: "array",
2022
2167
items: {
2023
2023
-
'$ref': '#/components/schemas/ModelWithReadOnlyAndWriteOnlyWritable'
2168
2168
+
'$ref': "#/components/schemas/ModelWithReadOnlyAndWriteOnlyWritable"
2024
2169
}
2025
2170
},
2026
2171
propWithFile: {
2027
2027
-
type: 'array',
2172
2172
+
type: "array",
2028
2173
items: {
2029
2029
-
format: 'binary',
2030
2030
-
type: 'string'
2174
2174
+
format: "binary",
2175
2175
+
type: "string"
2031
2176
}
2032
2177
},
2033
2178
propWithNumber: {
2034
2034
-
type: 'array',
2179
2179
+
type: "array",
2035
2180
items: {
2036
2036
-
type: 'number'
2181
2181
+
type: "number"
2037
2182
}
2038
2183
}
2039
2184
}
2040
2185
} as const;
2041
2186
2042
2187
export const ModelWithPropertiesWritableSchema = {
2043
2043
-
description: 'This is a model with one nested property',
2044
2044
-
type: 'object',
2045
2045
-
required: ['required', 'requiredAndNullable'],
2188
2188
+
description: "This is a model with one nested property",
2189
2189
+
type: "object",
2190
2190
+
required: [
2191
2191
+
"required",
2192
2192
+
"requiredAndNullable"
2193
2193
+
],
2046
2194
properties: {
2047
2195
required: {
2048
2048
-
type: 'string'
2196
2196
+
type: "string"
2049
2197
},
2050
2198
requiredAndNullable: {
2051
2051
-
type: 'string',
2199
2199
+
type: "string",
2052
2200
nullable: true
2053
2201
},
2054
2202
string: {
2055
2055
-
type: 'string'
2203
2203
+
type: "string"
2056
2204
},
2057
2205
number: {
2058
2058
-
type: 'number'
2206
2206
+
type: "number"
2059
2207
},
2060
2208
boolean: {
2061
2061
-
type: 'boolean'
2209
2209
+
type: "boolean"
2062
2210
},
2063
2211
reference: {
2064
2064
-
'$ref': '#/components/schemas/ModelWithString'
2212
2212
+
'$ref': "#/components/schemas/ModelWithString"
2065
2213
},
2066
2214
'property with space': {
2067
2067
-
type: 'string'
2215
2215
+
type: "string"
2068
2216
},
2069
2217
default: {
2070
2070
-
type: 'string'
2218
2218
+
type: "string"
2071
2219
},
2072
2220
try: {
2073
2073
-
type: 'string'
2221
2221
+
type: "string"
2074
2222
}
2075
2223
}
2076
2224
} as const;
2077
2225
2078
2226
export const ModelWithPatternWritableSchema = {
2079
2079
-
description: 'This is a model that contains a some patterns',
2080
2080
-
type: 'object',
2081
2081
-
required: ['key', 'name'],
2227
2227
+
description: "This is a model that contains a some patterns",
2228
2228
+
type: "object",
2229
2229
+
required: [
2230
2230
+
"key",
2231
2231
+
"name"
2232
2232
+
],
2082
2233
properties: {
2083
2234
key: {
2084
2235
maxLength: 64,
2085
2085
-
pattern: '^[a-zA-Z0-9_]*$',
2086
2086
-
type: 'string'
2236
2236
+
pattern: "^[a-zA-Z0-9_]*$",
2237
2237
+
type: "string"
2087
2238
},
2088
2239
name: {
2089
2240
maxLength: 255,
2090
2090
-
type: 'string'
2241
2241
+
type: "string"
2091
2242
},
2092
2243
id: {
2093
2093
-
type: 'string',
2094
2094
-
pattern: '^\\d{2}-\\d{3}-\\d{4}$'
2244
2244
+
type: "string",
2245
2245
+
pattern: "^\\d{2}-\\d{3}-\\d{4}$"
2095
2246
},
2096
2247
text: {
2097
2097
-
type: 'string',
2098
2098
-
pattern: '^\\w+$'
2248
2248
+
type: "string",
2249
2249
+
pattern: "^\\w+$"
2099
2250
},
2100
2251
patternWithSingleQuotes: {
2101
2101
-
type: 'string',
2252
2252
+
type: "string",
2102
2253
pattern: "^[a-zA-Z0-9']*$"
2103
2254
},
2104
2255
patternWithNewline: {
2105
2105
-
type: 'string',
2106
2106
-
pattern: 'aaa\\nbbb'
2256
2256
+
type: "string",
2257
2257
+
pattern: "aaa\\nbbb"
2107
2258
},
2108
2259
patternWithBacktick: {
2109
2109
-
type: 'string',
2110
2110
-
pattern: 'aaa`bbb'
2260
2260
+
type: "string",
2261
2261
+
pattern: "aaa`bbb"
2111
2262
}
2112
2263
}
2113
2264
} as const;
2114
2265
2115
2266
export const FileWritableSchema = {
2116
2116
-
required: ['mime'],
2117
2117
-
type: 'object',
2267
2267
+
required: [
2268
2268
+
"mime"
2269
2269
+
],
2270
2270
+
type: "object",
2118
2271
properties: {
2119
2272
mime: {
2120
2120
-
title: 'Mime',
2121
2121
-
type: 'string',
2273
2273
+
title: "Mime",
2274
2274
+
type: "string",
2122
2275
maxLength: 24,
2123
2276
minLength: 1
2124
2277
}
···
2126
2279
} as const;
2127
2280
2128
2281
export const ModelWithReadOnlyAndWriteOnlyWritableSchema = {
2129
2129
-
type: 'object',
2130
2130
-
required: ['foo', 'baz'],
2282
2282
+
type: "object",
2283
2283
+
required: [
2284
2284
+
"foo",
2285
2285
+
"baz"
2286
2286
+
],
2131
2287
properties: {
2132
2288
foo: {
2133
2133
-
type: 'string'
2289
2289
+
type: "string"
2134
2290
},
2135
2291
baz: {
2136
2136
-
type: 'string',
2292
2292
+
type: "string",
2137
2293
writeOnly: true
2138
2294
}
2139
2295
}
2140
2296
} as const;
2141
2297
2142
2298
export const ModelWithAnyOfConstantSizeArrayWithNSizeAndOptionsWritableSchema = {
2143
2143
-
type: 'array',
2299
2299
+
type: "array",
2144
2300
items: {
2145
2301
oneOf: [
2146
2302
{
2147
2147
-
type: 'number'
2303
2303
+
type: "number"
2148
2304
},
2149
2305
{
2150
2150
-
'$ref': '#/components/schemas/import'
2306
2306
+
'$ref': "#/components/schemas/import"
2151
2307
}
2152
2308
]
2153
2309
},
···
2156
2312
} as const;
2157
2313
2158
2314
export const AdditionalPropertiesUnknownIssueWritableSchema = {
2159
2159
-
type: 'object',
2315
2315
+
type: "object",
2160
2316
additionalProperties: {
2161
2317
anyOf: [
2162
2318
{
2163
2163
-
type: 'string'
2319
2319
+
type: "string"
2164
2320
},
2165
2321
{
2166
2166
-
type: 'number'
2322
2322
+
type: "number"
2167
2323
}
2168
2324
]
2169
2325
}
···
2176
2332
{
2177
2333
oneOf: [
2178
2334
{
2179
2179
-
'$ref': '#/components/schemas/ConstValue'
2335
2335
+
'$ref': "#/components/schemas/ConstValue"
2180
2336
},
2181
2337
{
2182
2182
-
'$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]'
2338
2338
+
'$ref': "#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]"
2183
2339
}
2184
2340
]
2185
2341
},
2186
2342
{
2187
2187
-
'$ref': '#/components/schemas/3e-num_1Период'
2343
2343
+
'$ref': "#/components/schemas/3e-num_1Период"
2188
2344
}
2189
2345
]
2190
2346
},
2191
2347
{
2192
2192
-
'$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]'
2348
2348
+
'$ref': "#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]"
2193
2349
}
2194
2350
]
2195
2351
} as const;
2196
2352
2197
2353
export const Generic_Schema_Duplicate_Issue_1_System_Boolean_WritableSchema = {
2198
2198
-
type: 'object',
2354
2354
+
type: "object",
2199
2355
properties: {
2200
2356
item: {
2201
2201
-
type: 'boolean'
2357
2357
+
type: "boolean"
2202
2358
},
2203
2359
error: {
2204
2204
-
type: 'string',
2360
2360
+
type: "string",
2205
2361
nullable: true
2206
2362
},
2207
2363
data: {
2208
2208
-
type: 'object',
2364
2364
+
type: "object",
2209
2365
additionalProperties: false
2210
2366
}
2211
2367
},
···
2213
2369
} as const;
2214
2370
2215
2371
export const Generic_Schema_Duplicate_Issue_1_System_String_WritableSchema = {
2216
2216
-
type: 'object',
2372
2372
+
type: "object",
2217
2373
properties: {
2218
2374
item: {
2219
2219
-
type: 'string',
2375
2375
+
type: "string",
2220
2376
nullable: true
2221
2377
},
2222
2378
error: {
2223
2223
-
type: 'string',
2379
2379
+
type: "string",
2224
2380
nullable: true
2225
2381
}
2226
2382
},
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/default/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base',
18
18
-
throwOnError: true
19
19
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base", throwOnError: true }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@pinia/colada/fetch/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseURL: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/axios/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseURL: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/fetch/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/axios/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseURL: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/fetch/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/axios/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseURL: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/axios/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseURL: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/fetch/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/servers/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'https://foo.com/v1'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "https://foo.com/v1" }));
+2
-6
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-all-of/transformers.gen.ts
···
3
3
import type { GetFooResponse } from './types.gen';
4
4
5
5
const fooSchemaResponseTransformer = (data: any) => {
6
6
-
data.foo = data.foo.map((item: any) => {
7
7
-
return barSchemaResponseTransformer(item);
8
8
-
});
6
6
+
data.foo = data.foo.map((item: any) => barSchemaResponseTransformer(item));
9
7
return data;
10
8
};
11
9
12
10
const barSchemaResponseTransformer = (data: any) => {
13
13
-
data.foo = data.foo.map((item: any) => {
14
14
-
return bazSchemaResponseTransformer(item);
15
15
-
});
11
11
+
data.foo = data.foo.map((item: any) => bazSchemaResponseTransformer(item));
16
12
return data;
17
13
};
18
14
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-any-of-null/transformers.gen.ts
···
16
16
};
17
17
18
18
export const getFooResponseTransformer = async (data: any): Promise<GetFooResponse> => {
19
19
-
data = data.map((item: any) => {
20
20
-
return fooSchemaResponseTransformer(item);
21
21
-
});
19
19
+
data = data.map((item: any) => fooSchemaResponseTransformer(item));
22
20
return data;
23
21
};
+2
-6
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-recursive/transformers.gen.ts
···
7
7
data.createdAt = new Date(data.createdAt);
8
8
}
9
9
if (data.children) {
10
10
-
data.children = data.children.map((item: any) => {
11
11
-
return treeNodeSchemaResponseTransformer(item);
12
12
-
});
10
10
+
data.children = data.children.map((item: any) => treeNodeSchemaResponseTransformer(item));
13
11
}
14
12
return data;
15
13
};
16
14
17
15
export const getTreeResponseTransformer = async (data: any): Promise<GetTreeResponse> => {
18
18
-
data = data.map((item: any) => {
19
19
-
return treeNodeSchemaResponseTransformer(item);
20
20
-
});
16
16
+
data = data.map((item: any) => treeNodeSchemaResponseTransformer(item));
21
17
return data;
22
18
};
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-number/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-strict/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-string/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'https://foo.com'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "https://foo.com" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/clean-false/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/default/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/import-file-extension-ts/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/sdk-client-optional/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/sdk-client-required/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/tsconfig-nodenext-sdk/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-number/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseURL: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-strict/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseURL: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-string/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseURL: 'https://foo.com'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseURL: "https://foo.com" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/clean-false/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseURL: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/default/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseURL: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/import-file-extension-ts/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseURL: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseURL: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/sdk-client-required/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseURL: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/tsconfig-nodenext-sdk/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseURL: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-number/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-strict/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-string/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'https://foo.com'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "https://foo.com" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/clean-false/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/default/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/import-file-extension-ts/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/tsconfig-nodenext-sdk/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-number/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-strict/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-string/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'https://foo.com'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "https://foo.com" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/clean-false/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/default/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/import-file-extension-ts/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/sdk-client-optional/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/sdk-client-required/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/tsconfig-nodenext-sdk/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-number/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-strict/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-string/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'https://foo.com'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "https://foo.com" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/clean-false/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/default/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/import-file-extension-ts/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/sdk-client-optional/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/sdk-client-required/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/tsconfig-nodenext-sdk/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-number/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseURL: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-strict/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseURL: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-string/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseURL: 'https://foo.com'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseURL: "https://foo.com" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/clean-false/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseURL: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/default/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseURL: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/import-file-extension-ts/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseURL: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseURL: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseURL: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/tsconfig-nodenext-sdk/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseURL: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/base-url-number/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/base-url-strict/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/base-url-string/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'https://foo.com'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "https://foo.com" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/clean-false/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/default/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/import-file-extension-ts/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/sdk-client-optional/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/sdk-client-required/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/tsconfig-nodenext-sdk/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/base-url-number/custom-client.gen.ts
···
14
14
*/
15
15
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
16
16
17
17
-
export const client = createClient(createConfig<ClientOptions2>({
18
18
-
baseUrl: 'http://localhost:3000/base'
19
19
-
}));
17
17
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/base-url-strict/custom-client.gen.ts
···
14
14
*/
15
15
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
16
16
17
17
-
export const client = createClient(createConfig<ClientOptions2>({
18
18
-
baseUrl: 'http://localhost:3000/base'
19
19
-
}));
17
17
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/base-url-string/custom-client.gen.ts
···
14
14
*/
15
15
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
16
16
17
17
-
export const client = createClient(createConfig<ClientOptions2>({
18
18
-
baseUrl: 'https://foo.com'
19
19
-
}));
17
17
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "https://foo.com" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/bundle/custom-client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/default/custom-client.gen.ts
···
14
14
*/
15
15
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
16
16
17
17
-
export const client = createClient(createConfig<ClientOptions2>({
18
18
-
baseUrl: 'http://localhost:3000/base'
19
19
-
}));
17
17
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/sdk-client-optional/custom-client.gen.ts
···
14
14
*/
15
15
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
16
16
17
17
-
export const client = createClient(createConfig<ClientOptions2>({
18
18
-
baseUrl: 'http://localhost:3000/base'
19
19
-
}));
17
17
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/sdk-client-required/custom-client.gen.ts
···
14
14
*/
15
15
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
16
16
17
17
-
export const client = createClient(createConfig<ClientOptions2>({
18
18
-
baseUrl: 'http://localhost:3000/base'
19
19
-
}));
17
17
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/base-url-number/custom.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/base-url-strict/custom.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/base-url-string/custom.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'https://foo.com'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "https://foo.com" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/bundle/custom.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/default/custom.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/sdk-client-optional/custom.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/sdk-client-required/custom.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@angular/common/default-class/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@angular/common/default/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+919
-700
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/schemas/default/schemas.gen.ts
···
1
1
// This file is auto-generated by @hey-api/openapi-ts
2
2
3
3
export const _400Schema = {
4
4
-
description: 'Model with number-only name',
5
5
-
type: 'string'
4
4
+
description: "Model with number-only name",
5
5
+
type: "string"
6
6
} as const;
7
7
8
8
export const ExternalRefASchema = {
9
9
-
description: 'External ref to shared model (A)',
10
10
-
'$ref': '#/components/schemas/external-shared_ExternalSharedModel'
9
9
+
description: "External ref to shared model (A)",
10
10
+
'$ref': "#/components/schemas/external-shared_ExternalSharedModel"
11
11
} as const;
12
12
13
13
export const ExternalRefBSchema = {
14
14
-
description: 'External ref to shared model (B)',
15
15
-
'$ref': '#/components/schemas/external-shared_ExternalSharedModel'
14
14
+
description: "External ref to shared model (B)",
15
15
+
'$ref': "#/components/schemas/external-shared_ExternalSharedModel"
16
16
} as const;
17
17
18
18
export const camelCaseCommentWithBreaksSchema = {
19
19
-
description: `Testing multiline comments in string: First line
20
20
-
Second line
21
21
-
22
22
-
Fourth line`,
23
23
-
type: 'integer'
19
19
+
description: "Testing multiline comments in string: First line\nSecond line\n\nFourth line",
20
20
+
type: "integer"
24
21
} as const;
25
22
26
23
export const CommentWithBreaksSchema = {
27
27
-
description: `Testing multiline comments in string: First line
28
28
-
Second line
29
29
-
30
30
-
Fourth line`,
31
31
-
type: 'integer'
24
24
+
description: "Testing multiline comments in string: First line\nSecond line\n\nFourth line",
25
25
+
type: "integer"
32
26
} as const;
33
27
34
28
export const CommentWithBackticksSchema = {
35
35
-
description: 'Testing backticks in string: `backticks` and ```multiple backticks``` should work',
36
36
-
type: 'integer'
29
29
+
description: "Testing backticks in string: `backticks` and ```multiple backticks``` should work",
30
30
+
type: "integer"
37
31
} as const;
38
32
39
33
export const CommentWithBackticksAndQuotesSchema = {
40
40
-
description: `Testing backticks and quotes in string: \`backticks\`, 'quotes', "double quotes" and \`\`\`multiple backticks\`\`\` should work`,
41
41
-
type: 'integer'
34
34
+
description: "Testing backticks and quotes in string: `backticks`, 'quotes', \"double quotes\" and ```multiple backticks``` should work",
35
35
+
type: "integer"
42
36
} as const;
43
37
44
38
export const CommentWithSlashesSchema = {
45
45
-
description: 'Testing slashes in string: \\backwards\\\\\\ and /forwards/// should work',
46
46
-
type: 'integer'
39
39
+
description: "Testing slashes in string: \\backwards\\\\\\ and /forwards/// should work",
40
40
+
type: "integer"
47
41
} as const;
48
42
49
43
export const CommentWithExpressionPlaceholdersSchema = {
50
50
-
description: 'Testing expression placeholders in string: ${expression} should work',
51
51
-
type: 'integer'
44
44
+
description: "Testing expression placeholders in string: ${expression} should work",
45
45
+
type: "integer"
52
46
} as const;
53
47
54
48
export const CommentWithQuotesSchema = {
55
55
-
description: `Testing quotes in string: 'single quote''' and "double quotes""" should work`,
56
56
-
type: 'integer'
49
49
+
description: "Testing quotes in string: 'single quote''' and \"double quotes\"\"\" should work",
50
50
+
type: "integer"
57
51
} as const;
58
52
59
53
export const CommentWithReservedCharactersSchema = {
60
60
-
description: 'Testing reserved characters in string: /* inline */ and /** inline **/ should work',
61
61
-
type: 'integer'
54
54
+
description: "Testing reserved characters in string: /* inline */ and /** inline **/ should work",
55
55
+
type: "integer"
62
56
} as const;
63
57
64
58
export const SimpleIntegerSchema = {
65
65
-
description: 'This is a simple number',
66
66
-
type: 'integer'
59
59
+
description: "This is a simple number",
60
60
+
type: "integer"
67
61
} as const;
68
62
69
63
export const SimpleBooleanSchema = {
70
70
-
description: 'This is a simple boolean',
71
71
-
type: 'boolean'
64
64
+
description: "This is a simple boolean",
65
65
+
type: "boolean"
72
66
} as const;
73
67
74
68
export const SimpleStringSchema = {
75
75
-
description: 'This is a simple string',
76
76
-
type: 'string'
69
69
+
description: "This is a simple string",
70
70
+
type: "string"
77
71
} as const;
78
72
79
73
export const NonAsciiStringæøåÆØÅöôêÊ字符串Schema = {
80
80
-
description: 'A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串)',
81
81
-
type: 'string'
74
74
+
description: "A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串)",
75
75
+
type: "string"
82
76
} as const;
83
77
84
78
export const SimpleFileSchema = {
85
85
-
description: 'This is a simple file',
86
86
-
format: 'binary',
87
87
-
type: 'string'
79
79
+
description: "This is a simple file",
80
80
+
format: "binary",
81
81
+
type: "string"
88
82
} as const;
89
83
90
84
export const SimpleReferenceSchema = {
91
91
-
description: 'This is a simple reference',
92
92
-
'$ref': '#/components/schemas/ModelWithString'
85
85
+
description: "This is a simple reference",
86
86
+
'$ref': "#/components/schemas/ModelWithString"
93
87
} as const;
94
88
95
89
export const SimpleStringWithPatternSchema = {
96
96
-
description: 'This is a simple string',
90
90
+
description: "This is a simple string",
97
91
maxLength: 64,
98
98
-
pattern: '^[a-zA-Z0-9_]*$',
99
99
-
type: ['string', 'null']
92
92
+
pattern: "^[a-zA-Z0-9_]*$",
93
93
+
type: [
94
94
+
"string",
95
95
+
"null"
96
96
+
]
100
97
} as const;
101
98
102
99
export const EnumWithStringsSchema = {
103
103
-
description: 'This is a simple enum with strings',
104
104
-
enum: ['Success', 'Warning', 'Error', "'Single Quote'", '"Double Quotes"', 'Non-ascii: øæåôöØÆÅÔÖ字符串']
100
100
+
description: "This is a simple enum with strings",
101
101
+
enum: [
102
102
+
"Success",
103
103
+
"Warning",
104
104
+
"Error",
105
105
+
"'Single Quote'",
106
106
+
"\"Double Quotes\"",
107
107
+
"Non-ascii: øæåôöØÆÅÔÖ字符串"
108
108
+
]
105
109
} as const;
106
110
107
111
export const EnumWithReplacedCharactersSchema = {
108
108
-
enum: ["'Single Quote'", '"Double Quotes"', 'øæåôöØÆÅÔÖ字符串', 3.1, ''],
109
109
-
type: 'string'
112
112
+
enum: [
113
113
+
"'Single Quote'",
114
114
+
"\"Double Quotes\"",
115
115
+
"øæåôöØÆÅÔÖ字符串",
116
116
+
3.1,
117
117
+
""
118
118
+
],
119
119
+
type: "string"
110
120
} as const;
111
121
112
122
export const EnumWithNumbersSchema = {
113
113
-
description: 'This is a simple enum with numbers',
114
114
-
enum: [1, 2, 3, 1.1, 1.2, 1.3, 100, 200, 300, -100, -200, -300, -1.1, -1.2, -1.3],
123
123
+
description: "This is a simple enum with numbers",
124
124
+
enum: [
125
125
+
1,
126
126
+
2,
127
127
+
3,
128
128
+
1.1,
129
129
+
1.2,
130
130
+
1.3,
131
131
+
100,
132
132
+
200,
133
133
+
300,
134
134
+
-100,
135
135
+
-200,
136
136
+
-300,
137
137
+
-1.1,
138
138
+
-1.2,
139
139
+
-1.3
140
140
+
],
115
141
default: 200
116
142
} as const;
117
143
118
144
export const EnumFromDescriptionSchema = {
119
119
-
description: 'Success=1,Warning=2,Error=3',
120
120
-
type: 'number'
145
145
+
description: "Success=1,Warning=2,Error=3",
146
146
+
type: "number"
121
147
} as const;
122
148
123
149
export const EnumWithExtensionsSchema = {
124
124
-
description: 'This is a simple enum with numbers',
125
125
-
enum: [200, 400, 500],
126
126
-
'x-enum-varnames': ['CUSTOM_SUCCESS', 'CUSTOM_WARNING', 'CUSTOM_ERROR'],
127
127
-
'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']
150
150
+
description: "This is a simple enum with numbers",
151
151
+
enum: [
152
152
+
200,
153
153
+
400,
154
154
+
500
155
155
+
],
156
156
+
'x-enum-varnames': [
157
157
+
"CUSTOM_SUCCESS",
158
158
+
"CUSTOM_WARNING",
159
159
+
"CUSTOM_ERROR"
160
160
+
],
161
161
+
'x-enum-descriptions': [
162
162
+
"Used when the status of something is successful",
163
163
+
"Used when the status of something has a warning",
164
164
+
"Used when the status of something has an error"
165
165
+
]
128
166
} as const;
129
167
130
168
export const EnumWithXEnumNamesSchema = {
131
131
-
enum: [0, 1, 2],
132
132
-
'x-enumNames': ['zero', 'one', 'two']
169
169
+
enum: [
170
170
+
0,
171
171
+
1,
172
172
+
2
173
173
+
],
174
174
+
'x-enumNames': [
175
175
+
"zero",
176
176
+
"one",
177
177
+
"two"
178
178
+
]
133
179
} as const;
134
180
135
181
export const ArrayWithNumbersSchema = {
136
136
-
description: 'This is a simple array with numbers',
137
137
-
type: 'array',
182
182
+
description: "This is a simple array with numbers",
183
183
+
type: "array",
138
184
items: {
139
139
-
type: 'integer'
185
185
+
type: "integer"
140
186
}
141
187
} as const;
142
188
143
189
export const ArrayWithBooleansSchema = {
144
144
-
description: 'This is a simple array with booleans',
145
145
-
type: 'array',
190
190
+
description: "This is a simple array with booleans",
191
191
+
type: "array",
146
192
items: {
147
147
-
type: 'boolean'
193
193
+
type: "boolean"
148
194
}
149
195
} as const;
150
196
151
197
export const ArrayWithStringsSchema = {
152
152
-
description: 'This is a simple array with strings',
153
153
-
type: 'array',
198
198
+
description: "This is a simple array with strings",
199
199
+
type: "array",
154
200
items: {
155
155
-
type: 'string'
201
201
+
type: "string"
156
202
},
157
157
-
default: ['test']
203
203
+
default: [
204
204
+
"test"
205
205
+
]
158
206
} as const;
159
207
160
208
export const ArrayWithReferencesSchema = {
161
161
-
description: 'This is a simple array with references',
162
162
-
type: 'array',
209
209
+
description: "This is a simple array with references",
210
210
+
type: "array",
163
211
items: {
164
164
-
'$ref': '#/components/schemas/ModelWithString'
212
212
+
'$ref': "#/components/schemas/ModelWithString"
165
213
}
166
214
} as const;
167
215
168
216
export const ArrayWithArraySchema = {
169
169
-
description: 'This is a simple array containing an array',
170
170
-
type: 'array',
217
217
+
description: "This is a simple array containing an array",
218
218
+
type: "array",
171
219
items: {
172
172
-
type: 'array',
220
220
+
type: "array",
173
221
items: {
174
174
-
'$ref': '#/components/schemas/ModelWithString'
222
222
+
'$ref': "#/components/schemas/ModelWithString"
175
223
}
176
224
}
177
225
} as const;
178
226
179
227
export const ArrayWithPropertiesSchema = {
180
180
-
description: 'This is a simple array with properties',
181
181
-
type: 'array',
228
228
+
description: "This is a simple array with properties",
229
229
+
type: "array",
182
230
items: {
183
183
-
type: 'object',
231
231
+
type: "object",
184
232
properties: {
185
233
'16x16': {
186
186
-
'$ref': '#/components/schemas/camelCaseCommentWithBreaks'
234
234
+
'$ref': "#/components/schemas/camelCaseCommentWithBreaks"
187
235
},
188
236
bar: {
189
189
-
type: 'string'
237
237
+
type: "string"
190
238
}
191
239
}
192
240
}
193
241
} as const;
194
242
195
243
export const ArrayWithAnyOfPropertiesSchema = {
196
196
-
description: 'This is a simple array with any of properties',
197
197
-
type: 'array',
244
244
+
description: "This is a simple array with any of properties",
245
245
+
type: "array",
198
246
items: {
199
247
anyOf: [
200
248
{
201
201
-
type: 'object',
249
249
+
type: "object",
202
250
properties: {
203
251
foo: {
204
204
-
type: 'string',
205
205
-
default: 'test'
252
252
+
type: "string",
253
253
+
default: "test"
206
254
}
207
255
}
208
256
},
209
257
{
210
210
-
type: 'object',
258
258
+
type: "object",
211
259
properties: {
212
260
bar: {
213
213
-
type: 'string'
261
261
+
type: "string"
214
262
}
215
263
}
216
264
}
···
219
267
} as const;
220
268
221
269
export const AnyOfAnyAndNullSchema = {
222
222
-
type: 'object',
270
270
+
type: "object",
223
271
properties: {
224
272
data: {
225
273
anyOf: [
226
274
{},
227
275
{
228
228
-
type: 'null'
276
276
+
type: "null"
229
277
}
230
278
]
231
279
}
···
233
281
} as const;
234
282
235
283
export const AnyOfArraysSchema = {
236
236
-
description: 'This is a simple array with any of properties',
237
237
-
type: 'object',
284
284
+
description: "This is a simple array with any of properties",
285
285
+
type: "object",
238
286
properties: {
239
287
results: {
240
288
items: {
241
289
anyOf: [
242
290
{
243
243
-
type: 'object',
291
291
+
type: "object",
244
292
properties: {
245
293
foo: {
246
246
-
type: 'string'
294
294
+
type: "string"
247
295
}
248
296
}
249
297
},
250
298
{
251
251
-
type: 'object',
299
299
+
type: "object",
252
300
properties: {
253
301
bar: {
254
254
-
type: 'string'
302
302
+
type: "string"
255
303
}
256
304
}
257
305
}
258
306
]
259
307
},
260
260
-
type: 'array'
308
308
+
type: "array"
261
309
}
262
310
}
263
311
} as const;
264
312
265
313
export const DictionaryWithStringSchema = {
266
266
-
description: 'This is a string dictionary',
267
267
-
type: 'object',
314
314
+
description: "This is a string dictionary",
315
315
+
type: "object",
268
316
additionalProperties: {
269
269
-
type: 'string'
317
317
+
type: "string"
270
318
}
271
319
} as const;
272
320
273
321
export const DictionaryWithPropertiesAndAdditionalPropertiesSchema = {
274
274
-
type: 'object',
322
322
+
type: "object",
275
323
properties: {
276
324
foo: {
277
277
-
type: 'number'
325
325
+
type: "number"
278
326
},
279
327
bar: {
280
280
-
type: 'boolean'
328
328
+
type: "boolean"
281
329
}
282
330
},
283
331
additionalProperties: {
284
284
-
type: 'string'
332
332
+
type: "string"
285
333
}
286
334
} as const;
287
335
288
336
export const DictionaryWithReferenceSchema = {
289
289
-
description: 'This is a string reference',
290
290
-
type: 'object',
337
337
+
description: "This is a string reference",
338
338
+
type: "object",
291
339
additionalProperties: {
292
292
-
'$ref': '#/components/schemas/ModelWithString'
340
340
+
'$ref': "#/components/schemas/ModelWithString"
293
341
}
294
342
} as const;
295
343
296
344
export const DictionaryWithArraySchema = {
297
297
-
description: 'This is a complex dictionary',
298
298
-
type: 'object',
345
345
+
description: "This is a complex dictionary",
346
346
+
type: "object",
299
347
additionalProperties: {
300
300
-
type: 'array',
348
348
+
type: "array",
301
349
items: {
302
302
-
'$ref': '#/components/schemas/ModelWithString'
350
350
+
'$ref': "#/components/schemas/ModelWithString"
303
351
}
304
352
}
305
353
} as const;
306
354
307
355
export const DictionaryWithDictionarySchema = {
308
308
-
description: 'This is a string dictionary',
309
309
-
type: 'object',
356
356
+
description: "This is a string dictionary",
357
357
+
type: "object",
310
358
additionalProperties: {
311
311
-
type: 'object',
359
359
+
type: "object",
312
360
additionalProperties: {
313
313
-
type: 'string'
361
361
+
type: "string"
314
362
}
315
363
}
316
364
} as const;
317
365
318
366
export const DictionaryWithPropertiesSchema = {
319
319
-
description: 'This is a complex dictionary',
320
320
-
type: 'object',
367
367
+
description: "This is a complex dictionary",
368
368
+
type: "object",
321
369
additionalProperties: {
322
322
-
type: 'object',
370
370
+
type: "object",
323
371
properties: {
324
372
foo: {
325
325
-
type: 'string'
373
373
+
type: "string"
326
374
},
327
375
bar: {
328
328
-
type: 'string'
376
376
+
type: "string"
329
377
}
330
378
}
331
379
}
332
380
} as const;
333
381
334
382
export const ModelWithIntegerSchema = {
335
335
-
description: 'This is a model with one number property',
336
336
-
type: 'object',
383
383
+
description: "This is a model with one number property",
384
384
+
type: "object",
337
385
properties: {
338
386
prop: {
339
339
-
description: 'This is a simple number property',
340
340
-
type: 'integer'
387
387
+
description: "This is a simple number property",
388
388
+
type: "integer"
341
389
}
342
390
}
343
391
} as const;
344
392
345
393
export const ModelWithBooleanSchema = {
346
346
-
description: 'This is a model with one boolean property',
347
347
-
type: 'object',
394
394
+
description: "This is a model with one boolean property",
395
395
+
type: "object",
348
396
properties: {
349
397
prop: {
350
350
-
description: 'This is a simple boolean property',
351
351
-
type: 'boolean'
398
398
+
description: "This is a simple boolean property",
399
399
+
type: "boolean"
352
400
}
353
401
}
354
402
} as const;
355
403
356
404
export const ModelWithStringSchema = {
357
357
-
description: 'This is a model with one string property',
358
358
-
type: 'object',
405
405
+
description: "This is a model with one string property",
406
406
+
type: "object",
359
407
properties: {
360
408
prop: {
361
361
-
description: 'This is a simple string property',
362
362
-
type: 'string'
409
409
+
description: "This is a simple string property",
410
410
+
type: "string"
363
411
}
364
412
}
365
413
} as const;
366
414
367
415
export const ModelWithStringErrorSchema = {
368
368
-
description: 'This is a model with one string property',
369
369
-
type: 'object',
416
416
+
description: "This is a model with one string property",
417
417
+
type: "object",
370
418
properties: {
371
419
prop: {
372
372
-
description: 'This is a simple string property',
373
373
-
type: 'string'
420
420
+
description: "This is a simple string property",
421
421
+
type: "string"
374
422
}
375
423
}
376
424
} as const;
377
425
378
426
export const Model_From_ZendeskSchema = {
379
379
-
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)`,
380
380
-
type: 'string'
427
427
+
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)",
428
428
+
type: "string"
381
429
} as const;
382
430
383
431
export const ModelWithNullableStringSchema = {
384
384
-
description: 'This is a model with one string property',
385
385
-
type: 'object',
386
386
-
required: ['nullableRequiredProp1', 'nullableRequiredProp2'],
432
432
+
description: "This is a model with one string property",
433
433
+
type: "object",
434
434
+
required: [
435
435
+
"nullableRequiredProp1",
436
436
+
"nullableRequiredProp2"
437
437
+
],
387
438
properties: {
388
439
nullableProp1: {
389
389
-
description: 'This is a simple string property',
390
390
-
type: ['string', 'null']
440
440
+
description: "This is a simple string property",
441
441
+
type: [
442
442
+
"string",
443
443
+
"null"
444
444
+
]
391
445
},
392
446
nullableRequiredProp1: {
393
393
-
description: 'This is a simple string property',
394
394
-
type: ['string', 'null']
447
447
+
description: "This is a simple string property",
448
448
+
type: [
449
449
+
"string",
450
450
+
"null"
451
451
+
]
395
452
},
396
453
nullableProp2: {
397
397
-
description: 'This is a simple string property',
398
398
-
type: ['string', 'null']
454
454
+
description: "This is a simple string property",
455
455
+
type: [
456
456
+
"string",
457
457
+
"null"
458
458
+
]
399
459
},
400
460
nullableRequiredProp2: {
401
401
-
description: 'This is a simple string property',
402
402
-
type: ['string', 'null']
461
461
+
description: "This is a simple string property",
462
462
+
type: [
463
463
+
"string",
464
464
+
"null"
465
465
+
]
403
466
},
404
467
'foo_bar-enum': {
405
405
-
description: 'This is a simple enum with strings',
406
406
-
enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串']
468
468
+
description: "This is a simple enum with strings",
469
469
+
enum: [
470
470
+
"Success",
471
471
+
"Warning",
472
472
+
"Error",
473
473
+
"ØÆÅ字符串"
474
474
+
]
407
475
}
408
476
}
409
477
} as const;
410
478
411
479
export const ModelWithEnumSchema = {
412
412
-
description: 'This is a model with one enum',
413
413
-
type: 'object',
480
480
+
description: "This is a model with one enum",
481
481
+
type: "object",
414
482
properties: {
415
483
'foo_bar-enum': {
416
416
-
description: 'This is a simple enum with strings',
417
417
-
enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串']
484
484
+
description: "This is a simple enum with strings",
485
485
+
enum: [
486
486
+
"Success",
487
487
+
"Warning",
488
488
+
"Error",
489
489
+
"ØÆÅ字符串"
490
490
+
]
418
491
},
419
492
statusCode: {
420
420
-
description: 'These are the HTTP error code enums',
421
421
-
enum: ['100', '200 FOO', '300 FOO_BAR', '400 foo-bar', '500 foo.bar', '600 foo&bar']
493
493
+
description: "These are the HTTP error code enums",
494
494
+
enum: [
495
495
+
"100",
496
496
+
"200 FOO",
497
497
+
"300 FOO_BAR",
498
498
+
"400 foo-bar",
499
499
+
"500 foo.bar",
500
500
+
"600 foo&bar"
501
501
+
]
422
502
},
423
503
bool: {
424
424
-
description: 'Simple boolean enum',
425
425
-
type: 'boolean',
426
426
-
enum: [true]
504
504
+
description: "Simple boolean enum",
505
505
+
type: "boolean",
506
506
+
enum: [
507
507
+
true
508
508
+
]
427
509
}
428
510
}
429
511
} as const;
430
512
431
513
export const ModelWithEnumWithHyphenSchema = {
432
432
-
description: 'This is a model with one enum with escaped name',
433
433
-
type: 'object',
514
514
+
description: "This is a model with one enum with escaped name",
515
515
+
type: "object",
434
516
properties: {
435
517
'foo-bar-baz-qux': {
436
436
-
type: 'string',
437
437
-
enum: ['3.0'],
438
438
-
title: 'Foo-Bar-Baz-Qux',
439
439
-
default: '3.0'
518
518
+
type: "string",
519
519
+
enum: [
520
520
+
"3.0"
521
521
+
],
522
522
+
title: "Foo-Bar-Baz-Qux",
523
523
+
default: "3.0"
440
524
}
441
525
}
442
526
} as const;
443
527
444
528
export const ModelWithEnumFromDescriptionSchema = {
445
445
-
description: 'This is a model with one enum',
446
446
-
type: 'object',
529
529
+
description: "This is a model with one enum",
530
530
+
type: "object",
447
531
properties: {
448
532
test: {
449
449
-
type: 'integer',
450
450
-
description: 'Success=1,Warning=2,Error=3'
533
533
+
type: "integer",
534
534
+
description: "Success=1,Warning=2,Error=3"
451
535
}
452
536
}
453
537
} as const;
454
538
455
539
export const ModelWithNestedEnumsSchema = {
456
456
-
description: 'This is a model with nested enums',
457
457
-
type: 'object',
540
540
+
description: "This is a model with nested enums",
541
541
+
type: "object",
458
542
properties: {
459
543
dictionaryWithEnum: {
460
460
-
type: 'object',
544
544
+
type: "object",
461
545
additionalProperties: {
462
462
-
enum: ['Success', 'Warning', 'Error']
546
546
+
enum: [
547
547
+
"Success",
548
548
+
"Warning",
549
549
+
"Error"
550
550
+
]
463
551
}
464
552
},
465
553
dictionaryWithEnumFromDescription: {
466
466
-
type: 'object',
554
554
+
type: "object",
467
555
additionalProperties: {
468
468
-
type: 'integer',
469
469
-
description: 'Success=1,Warning=2,Error=3'
556
556
+
type: "integer",
557
557
+
description: "Success=1,Warning=2,Error=3"
470
558
}
471
559
},
472
560
arrayWithEnum: {
473
473
-
type: 'array',
561
561
+
type: "array",
474
562
items: {
475
475
-
enum: ['Success', 'Warning', 'Error']
563
563
+
enum: [
564
564
+
"Success",
565
565
+
"Warning",
566
566
+
"Error"
567
567
+
]
476
568
}
477
569
},
478
570
arrayWithDescription: {
479
479
-
type: 'array',
571
571
+
type: "array",
480
572
items: {
481
481
-
type: 'integer',
482
482
-
description: 'Success=1,Warning=2,Error=3'
573
573
+
type: "integer",
574
574
+
description: "Success=1,Warning=2,Error=3"
483
575
}
484
576
},
485
577
'foo_bar-enum': {
486
486
-
description: 'This is a simple enum with strings',
487
487
-
enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串']
578
578
+
description: "This is a simple enum with strings",
579
579
+
enum: [
580
580
+
"Success",
581
581
+
"Warning",
582
582
+
"Error",
583
583
+
"ØÆÅ字符串"
584
584
+
]
488
585
}
489
586
}
490
587
} as const;
491
588
492
589
export const ModelWithReferenceSchema = {
493
493
-
description: 'This is a model with one property containing a reference',
494
494
-
type: 'object',
590
590
+
description: "This is a model with one property containing a reference",
591
591
+
type: "object",
495
592
properties: {
496
593
prop: {
497
497
-
'$ref': '#/components/schemas/ModelWithProperties'
594
594
+
'$ref': "#/components/schemas/ModelWithProperties"
498
595
}
499
596
}
500
597
} as const;
501
598
502
599
export const ModelWithArrayReadOnlyAndWriteOnlySchema = {
503
503
-
description: 'This is a model with one property containing an array',
504
504
-
type: 'object',
600
600
+
description: "This is a model with one property containing an array",
601
601
+
type: "object",
505
602
properties: {
506
603
prop: {
507
507
-
type: 'array',
604
604
+
type: "array",
508
605
items: {
509
509
-
'$ref': '#/components/schemas/ModelWithReadOnlyAndWriteOnly'
606
606
+
'$ref': "#/components/schemas/ModelWithReadOnlyAndWriteOnly"
510
607
}
511
608
},
512
609
propWithFile: {
513
513
-
type: 'array',
610
610
+
type: "array",
514
611
items: {
515
515
-
format: 'binary',
516
516
-
type: 'string'
612
612
+
format: "binary",
613
613
+
type: "string"
517
614
}
518
615
},
519
616
propWithNumber: {
520
520
-
type: 'array',
617
617
+
type: "array",
521
618
items: {
522
522
-
type: 'number'
619
619
+
type: "number"
523
620
}
524
621
}
525
622
}
526
623
} as const;
527
624
528
625
export const ModelWithArraySchema = {
529
529
-
description: 'This is a model with one property containing an array',
530
530
-
type: 'object',
626
626
+
description: "This is a model with one property containing an array",
627
627
+
type: "object",
531
628
properties: {
532
629
prop: {
533
533
-
type: 'array',
630
630
+
type: "array",
534
631
items: {
535
535
-
'$ref': '#/components/schemas/ModelWithString'
632
632
+
'$ref': "#/components/schemas/ModelWithString"
536
633
}
537
634
},
538
635
propWithFile: {
539
539
-
type: 'array',
636
636
+
type: "array",
540
637
items: {
541
541
-
format: 'binary',
542
542
-
type: 'string'
638
638
+
format: "binary",
639
639
+
type: "string"
543
640
}
544
641
},
545
642
propWithNumber: {
546
546
-
type: 'array',
643
643
+
type: "array",
547
644
items: {
548
548
-
type: 'number'
645
645
+
type: "number"
549
646
}
550
647
}
551
648
}
552
649
} as const;
553
650
554
651
export const ModelWithDictionarySchema = {
555
555
-
description: 'This is a model with one property containing a dictionary',
556
556
-
type: 'object',
652
652
+
description: "This is a model with one property containing a dictionary",
653
653
+
type: "object",
557
654
properties: {
558
655
prop: {
559
559
-
type: 'object',
656
656
+
type: "object",
560
657
additionalProperties: {
561
561
-
type: 'string'
658
658
+
type: "string"
562
659
}
563
660
}
564
661
}
···
566
663
567
664
export const DeprecatedModelSchema = {
568
665
deprecated: true,
569
569
-
description: 'This is a deprecated model with a deprecated property',
570
570
-
type: 'object',
666
666
+
description: "This is a deprecated model with a deprecated property",
667
667
+
type: "object",
571
668
properties: {
572
669
prop: {
573
670
deprecated: true,
574
574
-
description: 'This is a deprecated property',
575
575
-
type: 'string'
671
671
+
description: "This is a deprecated property",
672
672
+
type: "string"
576
673
}
577
674
}
578
675
} as const;
579
676
580
677
export const ModelWithCircularReferenceSchema = {
581
581
-
description: 'This is a model with one property containing a circular reference',
582
582
-
type: 'object',
678
678
+
description: "This is a model with one property containing a circular reference",
679
679
+
type: "object",
583
680
properties: {
584
681
prop: {
585
585
-
'$ref': '#/components/schemas/ModelWithCircularReference'
682
682
+
'$ref': "#/components/schemas/ModelWithCircularReference"
586
683
}
587
684
}
588
685
} as const;
589
686
590
687
export const CompositionWithOneOfSchema = {
591
688
description: "This is a model with one property with a 'one of' relationship",
592
592
-
type: 'object',
689
689
+
type: "object",
593
690
properties: {
594
691
propA: {
595
595
-
type: 'object',
692
692
+
type: "object",
596
693
oneOf: [
597
694
{
598
598
-
'$ref': '#/components/schemas/ModelWithString'
695
695
+
'$ref': "#/components/schemas/ModelWithString"
599
696
},
600
697
{
601
601
-
'$ref': '#/components/schemas/ModelWithEnum'
698
698
+
'$ref': "#/components/schemas/ModelWithEnum"
602
699
},
603
700
{
604
604
-
'$ref': '#/components/schemas/ModelWithArray'
701
701
+
'$ref': "#/components/schemas/ModelWithArray"
605
702
},
606
703
{
607
607
-
'$ref': '#/components/schemas/ModelWithDictionary'
704
704
+
'$ref': "#/components/schemas/ModelWithDictionary"
608
705
}
609
706
]
610
707
}
···
613
710
614
711
export const CompositionWithOneOfAnonymousSchema = {
615
712
description: "This is a model with one property with a 'one of' relationship where the options are not $ref",
616
616
-
type: 'object',
713
713
+
type: "object",
617
714
properties: {
618
715
propA: {
619
619
-
type: 'object',
716
716
+
type: "object",
620
717
oneOf: [
621
718
{
622
622
-
description: 'Anonymous object type',
623
623
-
type: 'object',
719
719
+
description: "Anonymous object type",
720
720
+
type: "object",
624
721
properties: {
625
722
propA: {
626
626
-
type: 'string'
723
723
+
type: "string"
627
724
}
628
725
}
629
726
},
630
727
{
631
631
-
description: 'Anonymous string type',
632
632
-
type: 'string'
728
728
+
description: "Anonymous string type",
729
729
+
type: "string"
633
730
},
634
731
{
635
635
-
description: 'Anonymous integer type',
636
636
-
type: 'integer'
732
732
+
description: "Anonymous integer type",
733
733
+
type: "integer"
637
734
}
638
735
]
639
736
}
···
641
738
} as const;
642
739
643
740
export const ModelCircleSchema = {
644
644
-
description: 'Circle',
645
645
-
type: 'object',
646
646
-
required: ['kind'],
741
741
+
description: "Circle",
742
742
+
type: "object",
743
743
+
required: [
744
744
+
"kind"
745
745
+
],
647
746
properties: {
648
747
kind: {
649
649
-
type: 'string'
748
748
+
type: "string"
650
749
},
651
750
radius: {
652
652
-
type: 'number'
751
751
+
type: "number"
653
752
}
654
753
}
655
754
} as const;
656
755
657
756
export const ModelSquareSchema = {
658
658
-
description: 'Square',
659
659
-
type: 'object',
660
660
-
required: ['kind'],
757
757
+
description: "Square",
758
758
+
type: "object",
759
759
+
required: [
760
760
+
"kind"
761
761
+
],
661
762
properties: {
662
763
kind: {
663
663
-
type: 'string'
764
764
+
type: "string"
664
765
},
665
766
sideLength: {
666
666
-
type: 'number'
767
767
+
type: "number"
667
768
}
668
769
}
669
770
} as const;
670
771
671
772
export const CompositionWithOneOfDiscriminatorSchema = {
672
773
description: "This is a model with one property with a 'one of' relationship where the options are not $ref",
673
673
-
type: 'object',
774
774
+
type: "object",
674
775
oneOf: [
675
776
{
676
676
-
'$ref': '#/components/schemas/ModelCircle'
777
777
+
'$ref': "#/components/schemas/ModelCircle"
677
778
},
678
779
{
679
679
-
'$ref': '#/components/schemas/ModelSquare'
780
780
+
'$ref': "#/components/schemas/ModelSquare"
680
781
}
681
782
],
682
783
discriminator: {
683
683
-
propertyName: 'kind',
784
784
+
propertyName: "kind",
684
785
mapping: {
685
685
-
circle: '#/components/schemas/ModelCircle',
686
686
-
square: '#/components/schemas/ModelSquare'
786
786
+
circle: "#/components/schemas/ModelCircle",
787
787
+
square: "#/components/schemas/ModelSquare"
687
788
}
688
789
}
689
790
} as const;
690
791
691
792
export const CompositionWithAnyOfSchema = {
692
793
description: "This is a model with one property with a 'any of' relationship",
693
693
-
type: 'object',
794
794
+
type: "object",
694
795
properties: {
695
796
propA: {
696
696
-
type: 'object',
797
797
+
type: "object",
697
798
anyOf: [
698
799
{
699
699
-
'$ref': '#/components/schemas/ModelWithString'
800
800
+
'$ref': "#/components/schemas/ModelWithString"
700
801
},
701
802
{
702
702
-
'$ref': '#/components/schemas/ModelWithEnum'
803
803
+
'$ref': "#/components/schemas/ModelWithEnum"
703
804
},
704
805
{
705
705
-
'$ref': '#/components/schemas/ModelWithArray'
806
806
+
'$ref': "#/components/schemas/ModelWithArray"
706
807
},
707
808
{
708
708
-
'$ref': '#/components/schemas/ModelWithDictionary'
809
809
+
'$ref': "#/components/schemas/ModelWithDictionary"
709
810
}
710
811
]
711
812
}
···
714
815
715
816
export const CompositionWithAnyOfAnonymousSchema = {
716
817
description: "This is a model with one property with a 'any of' relationship where the options are not $ref",
717
717
-
type: 'object',
818
818
+
type: "object",
718
819
properties: {
719
820
propA: {
720
720
-
type: 'object',
821
821
+
type: "object",
721
822
anyOf: [
722
823
{
723
723
-
description: 'Anonymous object type',
724
724
-
type: 'object',
824
824
+
description: "Anonymous object type",
825
825
+
type: "object",
725
826
properties: {
726
827
propA: {
727
727
-
type: 'string'
828
828
+
type: "string"
728
829
}
729
830
}
730
831
},
731
832
{
732
732
-
description: 'Anonymous string type',
733
733
-
type: 'string'
833
833
+
description: "Anonymous string type",
834
834
+
type: "string"
734
835
},
735
836
{
736
736
-
description: 'Anonymous integer type',
737
737
-
type: 'integer'
837
837
+
description: "Anonymous integer type",
838
838
+
type: "integer"
738
839
}
739
840
]
740
841
}
···
743
844
744
845
export const CompositionWithNestedAnyAndTypeNullSchema = {
745
846
description: "This is a model with nested 'any of' property with a type null",
746
746
-
type: 'object',
847
847
+
type: "object",
747
848
properties: {
748
849
propA: {
749
749
-
type: 'object',
850
850
+
type: "object",
750
851
anyOf: [
751
852
{
752
853
items: {
753
854
anyOf: [
754
855
{
755
755
-
'$ref': '#/components/schemas/ModelWithDictionary'
856
856
+
'$ref': "#/components/schemas/ModelWithDictionary"
756
857
},
757
858
{
758
758
-
type: 'null'
859
859
+
type: "null"
759
860
}
760
861
]
761
862
},
762
762
-
type: 'array'
863
863
+
type: "array"
763
864
},
764
865
{
765
866
items: {
766
867
anyOf: [
767
868
{
768
768
-
'$ref': '#/components/schemas/ModelWithArray'
869
869
+
'$ref': "#/components/schemas/ModelWithArray"
769
870
},
770
871
{
771
771
-
type: 'null'
872
872
+
type: "null"
772
873
}
773
874
]
774
875
},
775
775
-
type: 'array'
876
876
+
type: "array"
776
877
}
777
878
]
778
879
}
···
780
881
} as const;
781
882
782
883
export const _3e_num_1ПериодSchema = {
783
783
-
enum: ['Bird', 'Dog'],
784
784
-
type: 'string'
884
884
+
enum: [
885
885
+
"Bird",
886
886
+
"Dog"
887
887
+
],
888
888
+
type: "string"
785
889
} as const;
786
890
787
891
export const ConstValueSchema = {
788
788
-
type: 'string',
789
789
-
const: 'ConstValue'
892
892
+
type: "string",
893
893
+
const: "ConstValue"
790
894
} as const;
791
895
792
896
export const CompositionWithNestedAnyOfAndNullSchema = {
793
897
description: "This is a model with one property with a 'any of' relationship where the options are not $ref",
794
794
-
type: 'object',
898
898
+
type: "object",
795
899
properties: {
796
900
propA: {
797
901
anyOf: [
···
799
903
items: {
800
904
anyOf: [
801
905
{
802
802
-
'$ref': '#/components/schemas/3e-num_1Период'
906
906
+
'$ref': "#/components/schemas/3e-num_1Период"
803
907
},
804
908
{
805
805
-
'$ref': '#/components/schemas/ConstValue'
909
909
+
'$ref': "#/components/schemas/ConstValue"
806
910
}
807
911
]
808
912
},
809
809
-
type: 'array'
913
913
+
type: "array"
810
914
},
811
915
{
812
812
-
type: 'null'
916
916
+
type: "null"
813
917
}
814
918
],
815
815
-
title: 'Scopes'
919
919
+
title: "Scopes"
816
920
}
817
921
}
818
922
} as const;
819
923
820
924
export const CompositionWithOneOfAndNullableSchema = {
821
925
description: "This is a model with one property with a 'one of' relationship",
822
822
-
type: 'object',
926
926
+
type: "object",
823
927
properties: {
824
928
propA: {
825
825
-
type: ['object', 'null'],
929
929
+
type: [
930
930
+
"object",
931
931
+
"null"
932
932
+
],
826
933
oneOf: [
827
934
{
828
828
-
type: 'object',
935
935
+
type: "object",
829
936
properties: {
830
937
boolean: {
831
831
-
type: 'boolean'
938
938
+
type: "boolean"
832
939
}
833
940
}
834
941
},
835
942
{
836
836
-
'$ref': '#/components/schemas/ModelWithEnum'
943
943
+
'$ref': "#/components/schemas/ModelWithEnum"
837
944
},
838
945
{
839
839
-
'$ref': '#/components/schemas/ModelWithArray'
946
946
+
'$ref': "#/components/schemas/ModelWithArray"
840
947
},
841
948
{
842
842
-
'$ref': '#/components/schemas/ModelWithDictionary'
949
949
+
'$ref': "#/components/schemas/ModelWithDictionary"
843
950
}
844
951
]
845
952
}
···
847
954
} as const;
848
955
849
956
export const CompositionWithOneOfAndSimpleDictionarySchema = {
850
850
-
description: 'This is a model that contains a simple dictionary within composition',
851
851
-
type: 'object',
957
957
+
description: "This is a model that contains a simple dictionary within composition",
958
958
+
type: "object",
852
959
properties: {
853
960
propA: {
854
961
oneOf: [
855
962
{
856
856
-
type: 'boolean'
963
963
+
type: "boolean"
857
964
},
858
965
{
859
859
-
type: 'object',
966
966
+
type: "object",
860
967
additionalProperties: {
861
861
-
type: 'number'
968
968
+
type: "number"
862
969
}
863
970
}
864
971
]
···
867
974
} as const;
868
975
869
976
export const CompositionWithOneOfAndSimpleArrayDictionarySchema = {
870
870
-
description: 'This is a model that contains a dictionary of simple arrays within composition',
871
871
-
type: 'object',
977
977
+
description: "This is a model that contains a dictionary of simple arrays within composition",
978
978
+
type: "object",
872
979
properties: {
873
980
propA: {
874
981
oneOf: [
875
982
{
876
876
-
type: 'boolean'
983
983
+
type: "boolean"
877
984
},
878
985
{
879
879
-
type: 'object',
986
986
+
type: "object",
880
987
additionalProperties: {
881
881
-
type: 'array',
988
988
+
type: "array",
882
989
items: {
883
883
-
type: 'boolean'
990
990
+
type: "boolean"
884
991
}
885
992
}
886
993
}
···
890
997
} as const;
891
998
892
999
export const CompositionWithOneOfAndComplexArrayDictionarySchema = {
893
893
-
description: 'This is a model that contains a dictionary of complex arrays (composited) within composition',
894
894
-
type: 'object',
1000
1000
+
description: "This is a model that contains a dictionary of complex arrays (composited) within composition",
1001
1001
+
type: "object",
895
1002
properties: {
896
1003
propA: {
897
1004
oneOf: [
898
1005
{
899
899
-
type: 'boolean'
1006
1006
+
type: "boolean"
900
1007
},
901
1008
{
902
902
-
type: 'object',
1009
1009
+
type: "object",
903
1010
additionalProperties: {
904
904
-
type: 'array',
1011
1011
+
type: "array",
905
1012
items: {
906
1013
oneOf: [
907
1014
{
908
908
-
type: 'number'
1015
1015
+
type: "number"
909
1016
},
910
1017
{
911
911
-
type: 'string'
1018
1018
+
type: "string"
912
1019
}
913
1020
]
914
1021
}
···
921
1028
922
1029
export const CompositionWithAllOfAndNullableSchema = {
923
1030
description: "This is a model with one property with a 'all of' relationship",
924
924
-
type: 'object',
1031
1031
+
type: "object",
925
1032
properties: {
926
1033
propA: {
927
927
-
type: ['object', 'null'],
1034
1034
+
type: [
1035
1035
+
"object",
1036
1036
+
"null"
1037
1037
+
],
928
1038
allOf: [
929
1039
{
930
930
-
type: 'object',
1040
1040
+
type: "object",
931
1041
properties: {
932
1042
boolean: {
933
933
-
type: 'boolean'
1043
1043
+
type: "boolean"
934
1044
}
935
1045
}
936
1046
},
937
1047
{
938
938
-
'$ref': '#/components/schemas/ModelWithEnum'
1048
1048
+
'$ref': "#/components/schemas/ModelWithEnum"
939
1049
},
940
1050
{
941
941
-
'$ref': '#/components/schemas/ModelWithArray'
1051
1051
+
'$ref': "#/components/schemas/ModelWithArray"
942
1052
},
943
1053
{
944
944
-
'$ref': '#/components/schemas/ModelWithDictionary'
1054
1054
+
'$ref': "#/components/schemas/ModelWithDictionary"
945
1055
}
946
1056
]
947
1057
}
···
950
1060
951
1061
export const CompositionWithAnyOfAndNullableSchema = {
952
1062
description: "This is a model with one property with a 'any of' relationship",
953
953
-
type: 'object',
1063
1063
+
type: "object",
954
1064
properties: {
955
1065
propA: {
956
956
-
type: ['object', 'null'],
1066
1066
+
type: [
1067
1067
+
"object",
1068
1068
+
"null"
1069
1069
+
],
957
1070
anyOf: [
958
1071
{
959
959
-
type: 'object',
1072
1072
+
type: "object",
960
1073
properties: {
961
1074
boolean: {
962
962
-
type: 'boolean'
1075
1075
+
type: "boolean"
963
1076
}
964
1077
}
965
1078
},
966
1079
{
967
967
-
'$ref': '#/components/schemas/ModelWithEnum'
1080
1080
+
'$ref': "#/components/schemas/ModelWithEnum"
968
1081
},
969
1082
{
970
970
-
'$ref': '#/components/schemas/ModelWithArray'
1083
1083
+
'$ref': "#/components/schemas/ModelWithArray"
971
1084
},
972
1085
{
973
973
-
'$ref': '#/components/schemas/ModelWithDictionary'
1086
1086
+
'$ref': "#/components/schemas/ModelWithDictionary"
974
1087
}
975
1088
]
976
1089
}
···
978
1091
} as const;
979
1092
980
1093
export const CompositionBaseModelSchema = {
981
981
-
description: 'This is a base model with two simple optional properties',
982
982
-
type: 'object',
1094
1094
+
description: "This is a base model with two simple optional properties",
1095
1095
+
type: "object",
983
1096
properties: {
984
1097
firstName: {
985
985
-
type: 'string'
1098
1098
+
type: "string"
986
1099
},
987
1100
lastname: {
988
988
-
type: 'string'
1101
1101
+
type: "string"
989
1102
}
990
1103
}
991
1104
} as const;
992
1105
993
1106
export const CompositionExtendedModelSchema = {
994
994
-
description: 'This is a model that extends the base model',
995
995
-
type: 'object',
1107
1107
+
description: "This is a model that extends the base model",
1108
1108
+
type: "object",
996
1109
allOf: [
997
1110
{
998
998
-
'$ref': '#/components/schemas/CompositionBaseModel'
1111
1111
+
'$ref': "#/components/schemas/CompositionBaseModel"
999
1112
}
1000
1113
],
1001
1114
properties: {
1002
1115
age: {
1003
1003
-
type: 'number'
1116
1116
+
type: "number"
1004
1117
}
1005
1118
},
1006
1006
-
required: ['firstName', 'lastname', 'age']
1119
1119
+
required: [
1120
1120
+
"firstName",
1121
1121
+
"lastname",
1122
1122
+
"age"
1123
1123
+
]
1007
1124
} as const;
1008
1125
1009
1126
export const ModelWithPropertiesSchema = {
1010
1010
-
description: 'This is a model with one nested property',
1011
1011
-
type: 'object',
1012
1012
-
required: ['required', 'requiredAndReadOnly', 'requiredAndNullable'],
1127
1127
+
description: "This is a model with one nested property",
1128
1128
+
type: "object",
1129
1129
+
required: [
1130
1130
+
"required",
1131
1131
+
"requiredAndReadOnly",
1132
1132
+
"requiredAndNullable"
1133
1133
+
],
1013
1134
properties: {
1014
1135
required: {
1015
1015
-
type: 'string'
1136
1136
+
type: "string"
1016
1137
},
1017
1138
requiredAndReadOnly: {
1018
1018
-
type: 'string',
1139
1139
+
type: "string",
1019
1140
readOnly: true
1020
1141
},
1021
1142
requiredAndNullable: {
1022
1022
-
type: ['string', 'null']
1143
1143
+
type: [
1144
1144
+
"string",
1145
1145
+
"null"
1146
1146
+
]
1023
1147
},
1024
1148
string: {
1025
1025
-
type: 'string'
1149
1149
+
type: "string"
1026
1150
},
1027
1151
number: {
1028
1028
-
type: 'number'
1152
1152
+
type: "number"
1029
1153
},
1030
1154
boolean: {
1031
1031
-
type: 'boolean'
1155
1155
+
type: "boolean"
1032
1156
},
1033
1157
reference: {
1034
1034
-
'$ref': '#/components/schemas/ModelWithString'
1158
1158
+
'$ref': "#/components/schemas/ModelWithString"
1035
1159
},
1036
1160
'property with space': {
1037
1037
-
type: 'string'
1161
1161
+
type: "string"
1038
1162
},
1039
1163
default: {
1040
1040
-
type: 'string'
1164
1164
+
type: "string"
1041
1165
},
1042
1166
try: {
1043
1043
-
type: 'string'
1167
1167
+
type: "string"
1044
1168
},
1045
1169
'@namespace.string': {
1046
1046
-
type: 'string',
1170
1170
+
type: "string",
1047
1171
readOnly: true
1048
1172
},
1049
1173
'@namespace.integer': {
1050
1050
-
type: 'integer',
1174
1174
+
type: "integer",
1051
1175
readOnly: true
1052
1176
}
1053
1177
}
1054
1178
} as const;
1055
1179
1056
1180
export const ModelWithNestedPropertiesSchema = {
1057
1057
-
description: 'This is a model with one nested property',
1058
1058
-
type: 'object',
1059
1059
-
required: ['first'],
1181
1181
+
description: "This is a model with one nested property",
1182
1182
+
type: "object",
1183
1183
+
required: [
1184
1184
+
"first"
1185
1185
+
],
1060
1186
properties: {
1061
1187
first: {
1062
1062
-
type: ['object', 'null'],
1063
1063
-
required: ['second'],
1188
1188
+
type: [
1189
1189
+
"object",
1190
1190
+
"null"
1191
1191
+
],
1192
1192
+
required: [
1193
1193
+
"second"
1194
1194
+
],
1064
1195
readOnly: true,
1065
1196
properties: {
1066
1197
second: {
1067
1067
-
type: ['object', 'null'],
1068
1068
-
required: ['third'],
1198
1198
+
type: [
1199
1199
+
"object",
1200
1200
+
"null"
1201
1201
+
],
1202
1202
+
required: [
1203
1203
+
"third"
1204
1204
+
],
1069
1205
readOnly: true,
1070
1206
properties: {
1071
1207
third: {
1072
1072
-
type: ['string', 'null'],
1208
1208
+
type: [
1209
1209
+
"string",
1210
1210
+
"null"
1211
1211
+
],
1073
1212
required: true,
1074
1213
readOnly: true
1075
1214
}
···
1081
1220
} as const;
1082
1221
1083
1222
export const ModelWithDuplicatePropertiesSchema = {
1084
1084
-
description: 'This is a model with duplicated properties',
1085
1085
-
type: 'object',
1223
1223
+
description: "This is a model with duplicated properties",
1224
1224
+
type: "object",
1086
1225
properties: {
1087
1226
prop: {
1088
1088
-
'$ref': '#/components/schemas/ModelWithString'
1227
1227
+
'$ref': "#/components/schemas/ModelWithString"
1089
1228
}
1090
1229
}
1091
1230
} as const;
1092
1231
1093
1232
export const ModelWithOrderedPropertiesSchema = {
1094
1094
-
description: 'This is a model with ordered properties',
1095
1095
-
type: 'object',
1233
1233
+
description: "This is a model with ordered properties",
1234
1234
+
type: "object",
1096
1235
properties: {
1097
1236
zebra: {
1098
1098
-
type: 'string'
1237
1237
+
type: "string"
1099
1238
},
1100
1239
apple: {
1101
1101
-
type: 'string'
1240
1240
+
type: "string"
1102
1241
},
1103
1242
hawaii: {
1104
1104
-
type: 'string'
1243
1243
+
type: "string"
1105
1244
}
1106
1245
}
1107
1246
} as const;
1108
1247
1109
1248
export const ModelWithDuplicateImportsSchema = {
1110
1110
-
description: 'This is a model with duplicated imports',
1111
1111
-
type: 'object',
1249
1249
+
description: "This is a model with duplicated imports",
1250
1250
+
type: "object",
1112
1251
properties: {
1113
1252
propA: {
1114
1114
-
'$ref': '#/components/schemas/ModelWithString'
1253
1253
+
'$ref': "#/components/schemas/ModelWithString"
1115
1254
},
1116
1255
propB: {
1117
1117
-
'$ref': '#/components/schemas/ModelWithString'
1256
1256
+
'$ref': "#/components/schemas/ModelWithString"
1118
1257
},
1119
1258
propC: {
1120
1120
-
'$ref': '#/components/schemas/ModelWithString'
1259
1259
+
'$ref': "#/components/schemas/ModelWithString"
1121
1260
}
1122
1261
}
1123
1262
} as const;
1124
1263
1125
1264
export const ModelThatExtendsSchema = {
1126
1126
-
description: 'This is a model that extends another model',
1127
1127
-
type: 'object',
1265
1265
+
description: "This is a model that extends another model",
1266
1266
+
type: "object",
1128
1267
allOf: [
1129
1268
{
1130
1130
-
'$ref': '#/components/schemas/ModelWithString'
1269
1269
+
'$ref': "#/components/schemas/ModelWithString"
1131
1270
},
1132
1271
{
1133
1133
-
type: 'object',
1272
1272
+
type: "object",
1134
1273
properties: {
1135
1274
propExtendsA: {
1136
1136
-
type: 'string'
1275
1275
+
type: "string"
1137
1276
},
1138
1277
propExtendsB: {
1139
1139
-
'$ref': '#/components/schemas/ModelWithString'
1278
1278
+
'$ref': "#/components/schemas/ModelWithString"
1140
1279
}
1141
1280
}
1142
1281
}
···
1144
1283
} as const;
1145
1284
1146
1285
export const ModelThatExtendsExtendsSchema = {
1147
1147
-
description: 'This is a model that extends another model',
1148
1148
-
type: 'object',
1286
1286
+
description: "This is a model that extends another model",
1287
1287
+
type: "object",
1149
1288
allOf: [
1150
1289
{
1151
1151
-
'$ref': '#/components/schemas/ModelWithString'
1290
1290
+
'$ref': "#/components/schemas/ModelWithString"
1152
1291
},
1153
1292
{
1154
1154
-
'$ref': '#/components/schemas/ModelThatExtends'
1293
1293
+
'$ref': "#/components/schemas/ModelThatExtends"
1155
1294
},
1156
1295
{
1157
1157
-
type: 'object',
1296
1296
+
type: "object",
1158
1297
properties: {
1159
1298
propExtendsC: {
1160
1160
-
type: 'string'
1299
1299
+
type: "string"
1161
1300
},
1162
1301
propExtendsD: {
1163
1163
-
'$ref': '#/components/schemas/ModelWithString'
1302
1302
+
'$ref': "#/components/schemas/ModelWithString"
1164
1303
}
1165
1304
}
1166
1305
}
···
1168
1307
} as const;
1169
1308
1170
1309
export const ModelWithPatternSchema = {
1171
1171
-
description: 'This is a model that contains a some patterns',
1172
1172
-
type: 'object',
1173
1173
-
required: ['key', 'name'],
1310
1310
+
description: "This is a model that contains a some patterns",
1311
1311
+
type: "object",
1312
1312
+
required: [
1313
1313
+
"key",
1314
1314
+
"name"
1315
1315
+
],
1174
1316
properties: {
1175
1317
key: {
1176
1318
maxLength: 64,
1177
1177
-
pattern: '^[a-zA-Z0-9_]*$',
1178
1178
-
type: 'string'
1319
1319
+
pattern: "^[a-zA-Z0-9_]*$",
1320
1320
+
type: "string"
1179
1321
},
1180
1322
name: {
1181
1323
maxLength: 255,
1182
1182
-
type: 'string'
1324
1324
+
type: "string"
1183
1325
},
1184
1326
enabled: {
1185
1185
-
type: 'boolean',
1327
1327
+
type: "boolean",
1186
1328
readOnly: true
1187
1329
},
1188
1330
modified: {
1189
1189
-
type: 'string',
1190
1190
-
format: 'date-time',
1331
1331
+
type: "string",
1332
1332
+
format: "date-time",
1191
1333
readOnly: true
1192
1334
},
1193
1335
id: {
1194
1194
-
type: 'string',
1195
1195
-
pattern: '^\\d{2}-\\d{3}-\\d{4}$'
1336
1336
+
type: "string",
1337
1337
+
pattern: "^\\d{2}-\\d{3}-\\d{4}$"
1196
1338
},
1197
1339
text: {
1198
1198
-
type: 'string',
1199
1199
-
pattern: '^\\w+$'
1340
1340
+
type: "string",
1341
1341
+
pattern: "^\\w+$"
1200
1342
},
1201
1343
patternWithSingleQuotes: {
1202
1202
-
type: 'string',
1344
1344
+
type: "string",
1203
1345
pattern: "^[a-zA-Z0-9']*$"
1204
1346
},
1205
1347
patternWithNewline: {
1206
1206
-
type: 'string',
1207
1207
-
pattern: 'aaa\\nbbb'
1348
1348
+
type: "string",
1349
1349
+
pattern: "aaa\\nbbb"
1208
1350
},
1209
1351
patternWithBacktick: {
1210
1210
-
type: 'string',
1211
1211
-
pattern: 'aaa`bbb'
1352
1352
+
type: "string",
1353
1353
+
pattern: "aaa`bbb"
1212
1354
}
1213
1355
}
1214
1356
} as const;
1215
1357
1216
1358
export const FileSchema = {
1217
1217
-
required: ['mime'],
1218
1218
-
type: 'object',
1359
1359
+
required: [
1360
1360
+
"mime"
1361
1361
+
],
1362
1362
+
type: "object",
1219
1363
properties: {
1220
1364
id: {
1221
1221
-
title: 'Id',
1222
1222
-
type: 'string',
1365
1365
+
title: "Id",
1366
1366
+
type: "string",
1223
1367
readOnly: true,
1224
1368
minLength: 1
1225
1369
},
1226
1370
updated_at: {
1227
1227
-
title: 'Updated at',
1228
1228
-
type: 'string',
1229
1229
-
format: 'date-time',
1371
1371
+
title: "Updated at",
1372
1372
+
type: "string",
1373
1373
+
format: "date-time",
1230
1374
readOnly: true
1231
1375
},
1232
1376
created_at: {
1233
1233
-
title: 'Created at',
1234
1234
-
type: 'string',
1235
1235
-
format: 'date-time',
1377
1377
+
title: "Created at",
1378
1378
+
type: "string",
1379
1379
+
format: "date-time",
1236
1380
readOnly: true
1237
1381
},
1238
1382
mime: {
1239
1239
-
title: 'Mime',
1240
1240
-
type: 'string',
1383
1383
+
title: "Mime",
1384
1384
+
type: "string",
1241
1385
maxLength: 24,
1242
1386
minLength: 1
1243
1387
},
1244
1388
file: {
1245
1245
-
title: 'File',
1246
1246
-
type: 'string',
1389
1389
+
title: "File",
1390
1390
+
type: "string",
1247
1391
readOnly: true,
1248
1248
-
format: 'uri'
1392
1392
+
format: "uri"
1249
1393
}
1250
1394
}
1251
1395
} as const;
1252
1396
1253
1397
export const defaultSchema = {
1254
1254
-
type: 'object',
1398
1398
+
type: "object",
1255
1399
properties: {
1256
1400
name: {
1257
1257
-
type: 'string'
1401
1401
+
type: "string"
1258
1402
}
1259
1403
}
1260
1404
} as const;
1261
1405
1262
1406
export const PageableSchema = {
1263
1263
-
type: 'object',
1407
1407
+
type: "object",
1264
1408
properties: {
1265
1409
page: {
1266
1410
minimum: 0,
1267
1267
-
type: 'integer',
1268
1268
-
format: 'int32',
1411
1411
+
type: "integer",
1412
1412
+
format: "int32",
1269
1413
default: 0
1270
1414
},
1271
1415
size: {
1272
1416
minimum: 1,
1273
1273
-
type: 'integer',
1274
1274
-
format: 'int32'
1417
1417
+
type: "integer",
1418
1418
+
format: "int32"
1275
1419
},
1276
1420
sort: {
1277
1277
-
type: 'array',
1421
1421
+
type: "array",
1278
1422
items: {
1279
1279
-
type: 'string'
1423
1423
+
type: "string"
1280
1424
}
1281
1425
}
1282
1426
}
1283
1427
} as const;
1284
1428
1285
1429
export const FreeFormObjectWithoutAdditionalPropertiesSchema = {
1286
1286
-
description: 'This is a free-form object without additionalProperties.',
1287
1287
-
type: 'object'
1430
1430
+
description: "This is a free-form object without additionalProperties.",
1431
1431
+
type: "object"
1288
1432
} as const;
1289
1433
1290
1434
export const FreeFormObjectWithAdditionalPropertiesEqTrueSchema = {
1291
1291
-
description: 'This is a free-form object with additionalProperties: true.',
1292
1292
-
type: 'object',
1435
1435
+
description: "This is a free-form object with additionalProperties: true.",
1436
1436
+
type: "object",
1293
1437
additionalProperties: true
1294
1438
} as const;
1295
1439
1296
1440
export const FreeFormObjectWithAdditionalPropertiesEqEmptyObjectSchema = {
1297
1297
-
description: 'This is a free-form object with additionalProperties: {}.',
1298
1298
-
type: 'object',
1441
1441
+
description: "This is a free-form object with additionalProperties: {}.",
1442
1442
+
type: "object",
1299
1443
additionalProperties: {}
1300
1444
} as const;
1301
1445
1302
1446
export const ModelWithConstSchema = {
1303
1303
-
type: 'object',
1447
1447
+
type: "object",
1304
1448
properties: {
1305
1449
String: {
1306
1306
-
const: 'String'
1450
1450
+
const: "String"
1307
1451
},
1308
1452
number: {
1309
1453
const: 0
···
1312
1456
const: null
1313
1457
},
1314
1458
withType: {
1315
1315
-
type: 'string',
1316
1316
-
const: 'Some string'
1459
1459
+
type: "string",
1460
1460
+
const: "Some string"
1317
1461
}
1318
1462
}
1319
1463
} as const;
1320
1464
1321
1465
export const ModelWithAdditionalPropertiesEqTrueSchema = {
1322
1322
-
description: 'This is a model with one property and additionalProperties: true',
1323
1323
-
type: 'object',
1466
1466
+
description: "This is a model with one property and additionalProperties: true",
1467
1467
+
type: "object",
1324
1468
properties: {
1325
1469
prop: {
1326
1326
-
description: 'This is a simple string property',
1327
1327
-
type: 'string'
1470
1470
+
description: "This is a simple string property",
1471
1471
+
type: "string"
1328
1472
}
1329
1473
},
1330
1474
additionalProperties: true
···
1338
1482
items: {
1339
1483
anyOf: [
1340
1484
{
1341
1341
-
type: 'string'
1485
1485
+
type: "string"
1342
1486
},
1343
1487
{
1344
1344
-
type: 'boolean'
1488
1488
+
type: "boolean"
1345
1489
}
1346
1490
]
1347
1491
},
1348
1348
-
type: 'array'
1492
1492
+
type: "array"
1349
1493
},
1350
1494
{
1351
1351
-
type: 'null'
1495
1495
+
type: "null"
1352
1496
}
1353
1497
]
1354
1498
}
1355
1499
},
1356
1356
-
type: 'object'
1500
1500
+
type: "object"
1357
1501
} as const;
1358
1502
1359
1503
export const CompositionWithOneOfAndPropertiesSchema = {
1360
1360
-
type: 'object',
1504
1504
+
type: "object",
1361
1505
oneOf: [
1362
1506
{
1363
1363
-
type: 'object',
1364
1364
-
required: ['foo'],
1507
1507
+
type: "object",
1508
1508
+
required: [
1509
1509
+
"foo"
1510
1510
+
],
1365
1511
properties: {
1366
1512
foo: {
1367
1367
-
'$ref': '#/components/parameters/SimpleParameter'
1513
1513
+
'$ref': "#/components/parameters/SimpleParameter"
1368
1514
}
1369
1515
},
1370
1516
additionalProperties: false
1371
1517
},
1372
1518
{
1373
1373
-
type: 'object',
1374
1374
-
required: ['bar'],
1519
1519
+
type: "object",
1520
1520
+
required: [
1521
1521
+
"bar"
1522
1522
+
],
1375
1523
properties: {
1376
1524
bar: {
1377
1377
-
'$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串'
1525
1525
+
'$ref': "#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串"
1378
1526
}
1379
1527
},
1380
1528
additionalProperties: false
1381
1529
}
1382
1530
],
1383
1383
-
required: ['baz', 'qux'],
1531
1531
+
required: [
1532
1532
+
"baz",
1533
1533
+
"qux"
1534
1534
+
],
1384
1535
properties: {
1385
1536
baz: {
1386
1386
-
type: ['integer', 'null'],
1387
1387
-
format: 'uint16',
1537
1537
+
type: [
1538
1538
+
"integer",
1539
1539
+
"null"
1540
1540
+
],
1541
1541
+
format: "uint16",
1388
1542
minimum: 0
1389
1543
},
1390
1544
qux: {
1391
1391
-
type: 'integer',
1392
1392
-
format: 'uint8',
1545
1545
+
type: "integer",
1546
1546
+
format: "uint8",
1393
1547
minimum: 0
1394
1548
}
1395
1549
}
1396
1550
} as const;
1397
1551
1398
1552
export const NullableObjectSchema = {
1399
1399
-
type: ['object', 'null'],
1400
1400
-
description: 'An object that can be null',
1553
1553
+
type: [
1554
1554
+
"object",
1555
1555
+
"null"
1556
1556
+
],
1557
1557
+
description: "An object that can be null",
1401
1558
properties: {
1402
1559
foo: {
1403
1403
-
type: 'string'
1560
1560
+
type: "string"
1404
1561
}
1405
1562
},
1406
1563
default: null
1407
1564
} as const;
1408
1565
1409
1566
export const CharactersInDescriptionSchema = {
1410
1410
-
type: 'string',
1411
1411
-
description: 'Some % character'
1567
1567
+
type: "string",
1568
1568
+
description: "Some % character"
1412
1569
} as const;
1413
1570
1414
1571
export const ModelWithNullableObjectSchema = {
1415
1415
-
type: 'object',
1572
1572
+
type: "object",
1416
1573
properties: {
1417
1574
data: {
1418
1418
-
'$ref': '#/components/schemas/NullableObject'
1575
1575
+
'$ref': "#/components/schemas/NullableObject"
1419
1576
}
1420
1577
}
1421
1578
} as const;
···
1423
1580
export const ModelWithOneOfEnumSchema = {
1424
1581
oneOf: [
1425
1582
{
1426
1426
-
type: 'object',
1427
1427
-
required: ['foo'],
1583
1583
+
type: "object",
1584
1584
+
required: [
1585
1585
+
"foo"
1586
1586
+
],
1428
1587
properties: {
1429
1588
foo: {
1430
1430
-
type: 'string',
1431
1431
-
enum: ['Bar']
1589
1589
+
type: "string",
1590
1590
+
enum: [
1591
1591
+
"Bar"
1592
1592
+
]
1432
1593
}
1433
1594
}
1434
1595
},
1435
1596
{
1436
1436
-
type: 'object',
1437
1437
-
required: ['foo'],
1597
1597
+
type: "object",
1598
1598
+
required: [
1599
1599
+
"foo"
1600
1600
+
],
1438
1601
properties: {
1439
1602
foo: {
1440
1440
-
type: 'string',
1441
1441
-
enum: ['Baz']
1603
1603
+
type: "string",
1604
1604
+
enum: [
1605
1605
+
"Baz"
1606
1606
+
]
1442
1607
}
1443
1608
}
1444
1609
},
1445
1610
{
1446
1446
-
type: 'object',
1447
1447
-
required: ['foo'],
1611
1611
+
type: "object",
1612
1612
+
required: [
1613
1613
+
"foo"
1614
1614
+
],
1448
1615
properties: {
1449
1616
foo: {
1450
1450
-
type: 'string',
1451
1451
-
enum: ['Qux']
1617
1617
+
type: "string",
1618
1618
+
enum: [
1619
1619
+
"Qux"
1620
1620
+
]
1452
1621
}
1453
1622
}
1454
1623
},
1455
1624
{
1456
1456
-
type: 'object',
1457
1457
-
required: ['content', 'foo'],
1625
1625
+
type: "object",
1626
1626
+
required: [
1627
1627
+
"content",
1628
1628
+
"foo"
1629
1629
+
],
1458
1630
properties: {
1459
1631
content: {
1460
1460
-
type: 'string',
1461
1461
-
format: 'date-time'
1632
1632
+
type: "string",
1633
1633
+
format: "date-time"
1462
1634
},
1463
1635
foo: {
1464
1464
-
type: 'string',
1465
1465
-
enum: ['Quux']
1636
1636
+
type: "string",
1637
1637
+
enum: [
1638
1638
+
"Quux"
1639
1639
+
]
1466
1640
}
1467
1641
}
1468
1642
},
1469
1643
{
1470
1470
-
type: 'object',
1471
1471
-
required: ['content', 'foo'],
1644
1644
+
type: "object",
1645
1645
+
required: [
1646
1646
+
"content",
1647
1647
+
"foo"
1648
1648
+
],
1472
1649
properties: {
1473
1650
content: {
1474
1474
-
type: 'array',
1651
1651
+
type: "array",
1475
1652
prefixItems: [
1476
1653
{
1477
1477
-
type: 'string',
1478
1478
-
format: 'date-time'
1654
1654
+
type: "string",
1655
1655
+
format: "date-time"
1479
1656
},
1480
1657
{
1481
1481
-
type: 'string'
1658
1658
+
type: "string"
1482
1659
}
1483
1660
],
1484
1661
maxItems: 2,
1485
1662
minItems: 2
1486
1663
},
1487
1664
foo: {
1488
1488
-
type: 'string',
1489
1489
-
enum: ['Corge']
1665
1665
+
type: "string",
1666
1666
+
enum: [
1667
1667
+
"Corge"
1668
1668
+
]
1490
1669
}
1491
1670
}
1492
1671
}
···
1494
1673
} as const;
1495
1674
1496
1675
export const ModelWithNestedArrayEnumsDataFooSchema = {
1497
1497
-
enum: ['foo', 'bar'],
1498
1498
-
type: 'string'
1676
1676
+
enum: [
1677
1677
+
"foo",
1678
1678
+
"bar"
1679
1679
+
],
1680
1680
+
type: "string"
1499
1681
} as const;
1500
1682
1501
1683
export const ModelWithNestedArrayEnumsDataBarSchema = {
1502
1502
-
enum: ['baz', 'qux'],
1503
1503
-
type: 'string'
1684
1684
+
enum: [
1685
1685
+
"baz",
1686
1686
+
"qux"
1687
1687
+
],
1688
1688
+
type: "string"
1504
1689
} as const;
1505
1690
1506
1691
export const ModelWithNestedArrayEnumsDataSchema = {
1507
1507
-
type: 'object',
1692
1692
+
type: "object",
1508
1693
properties: {
1509
1694
foo: {
1510
1510
-
type: 'array',
1695
1695
+
type: "array",
1511
1696
items: {
1512
1512
-
'$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo'
1697
1697
+
'$ref': "#/components/schemas/ModelWithNestedArrayEnumsDataFoo"
1513
1698
}
1514
1699
},
1515
1700
bar: {
1516
1516
-
type: 'array',
1701
1701
+
type: "array",
1517
1702
items: {
1518
1518
-
'$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataBar'
1703
1703
+
'$ref': "#/components/schemas/ModelWithNestedArrayEnumsDataBar"
1519
1704
}
1520
1705
}
1521
1706
}
1522
1707
} as const;
1523
1708
1524
1709
export const ModelWithNestedArrayEnumsSchema = {
1525
1525
-
type: 'object',
1710
1710
+
type: "object",
1526
1711
properties: {
1527
1712
array_strings: {
1528
1528
-
type: 'array',
1713
1713
+
type: "array",
1529
1714
items: {
1530
1530
-
type: 'string'
1715
1715
+
type: "string"
1531
1716
}
1532
1717
},
1533
1718
data: {
1534
1719
allOf: [
1535
1720
{
1536
1536
-
'$ref': '#/components/schemas/ModelWithNestedArrayEnumsData'
1721
1721
+
'$ref': "#/components/schemas/ModelWithNestedArrayEnumsData"
1537
1722
}
1538
1723
]
1539
1724
}
···
1541
1726
} as const;
1542
1727
1543
1728
export const ModelWithNestedCompositionEnumsSchema = {
1544
1544
-
type: 'object',
1729
1729
+
type: "object",
1545
1730
properties: {
1546
1731
foo: {
1547
1732
allOf: [
1548
1733
{
1549
1549
-
'$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo'
1734
1734
+
'$ref': "#/components/schemas/ModelWithNestedArrayEnumsDataFoo"
1550
1735
}
1551
1736
]
1552
1737
}
···
1554
1739
} as const;
1555
1740
1556
1741
export const ModelWithReadOnlyAndWriteOnlySchema = {
1557
1557
-
type: 'object',
1558
1558
-
required: ['foo', 'bar'],
1742
1742
+
type: "object",
1743
1743
+
required: [
1744
1744
+
"foo",
1745
1745
+
"bar"
1746
1746
+
],
1559
1747
properties: {
1560
1748
foo: {
1561
1561
-
type: 'string'
1749
1749
+
type: "string"
1562
1750
},
1563
1751
bar: {
1564
1752
readOnly: true,
1565
1565
-
type: 'string'
1753
1753
+
type: "string"
1566
1754
}
1567
1755
}
1568
1756
} as const;
1569
1757
1570
1758
export const ModelWithConstantSizeArraySchema = {
1571
1571
-
type: 'array',
1759
1759
+
type: "array",
1572
1760
items: {
1573
1573
-
type: 'number'
1761
1761
+
type: "number"
1574
1762
},
1575
1763
minItems: 2,
1576
1764
maxItems: 2
1577
1765
} as const;
1578
1766
1579
1767
export const ModelWithAnyOfConstantSizeArraySchema = {
1580
1580
-
type: 'array',
1768
1768
+
type: "array",
1581
1769
items: {
1582
1770
oneOf: [
1583
1771
{
1584
1584
-
type: 'number'
1772
1772
+
type: "number"
1585
1773
},
1586
1774
{
1587
1587
-
type: 'string'
1775
1775
+
type: "string"
1588
1776
}
1589
1777
]
1590
1778
},
···
1593
1781
} as const;
1594
1782
1595
1783
export const ModelWithPrefixItemsConstantSizeArraySchema = {
1596
1596
-
type: 'array',
1784
1784
+
type: "array",
1597
1785
prefixItems: [
1598
1786
{
1599
1599
-
'$ref': '#/components/schemas/ModelWithInteger'
1787
1787
+
'$ref': "#/components/schemas/ModelWithInteger"
1600
1788
},
1601
1789
{
1602
1790
oneOf: [
1603
1791
{
1604
1604
-
type: 'number'
1792
1792
+
type: "number"
1605
1793
},
1606
1794
{
1607
1607
-
type: 'string'
1795
1795
+
type: "string"
1608
1796
}
1609
1797
]
1610
1798
},
1611
1799
{
1612
1612
-
type: 'string'
1800
1800
+
type: "string"
1613
1801
}
1614
1802
]
1615
1803
} as const;
1616
1804
1617
1805
export const ModelWithAnyOfConstantSizeArrayNullableSchema = {
1618
1618
-
type: ['array'],
1806
1806
+
type: [
1807
1807
+
"array"
1808
1808
+
],
1619
1809
items: {
1620
1810
oneOf: [
1621
1811
{
1622
1622
-
type: ['number', 'null']
1812
1812
+
type: [
1813
1813
+
"number",
1814
1814
+
"null"
1815
1815
+
]
1623
1816
},
1624
1817
{
1625
1625
-
type: 'string'
1818
1818
+
type: "string"
1626
1819
}
1627
1820
]
1628
1821
},
···
1631
1824
} as const;
1632
1825
1633
1826
export const ModelWithAnyOfConstantSizeArrayWithNSizeAndOptionsSchema = {
1634
1634
-
type: 'array',
1827
1827
+
type: "array",
1635
1828
items: {
1636
1829
oneOf: [
1637
1830
{
1638
1638
-
type: 'number'
1831
1831
+
type: "number"
1639
1832
},
1640
1833
{
1641
1641
-
'$ref': '#/components/schemas/import'
1834
1834
+
'$ref': "#/components/schemas/import"
1642
1835
}
1643
1836
]
1644
1837
},
···
1647
1840
} as const;
1648
1841
1649
1842
export const ModelWithAnyOfConstantSizeArrayAndIntersectSchema = {
1650
1650
-
type: 'array',
1843
1843
+
type: "array",
1651
1844
items: {
1652
1845
allOf: [
1653
1846
{
1654
1654
-
type: 'number'
1847
1847
+
type: "number"
1655
1848
},
1656
1849
{
1657
1657
-
type: 'string'
1850
1850
+
type: "string"
1658
1851
}
1659
1852
]
1660
1853
},
···
1663
1856
} as const;
1664
1857
1665
1858
export const ModelWithNumericEnumUnionSchema = {
1666
1666
-
type: 'object',
1859
1859
+
type: "object",
1667
1860
properties: {
1668
1861
value: {
1669
1669
-
type: 'number',
1670
1670
-
description: 'Период',
1671
1671
-
enum: [-10, -1, 0, 1, 3, 6, 12]
1862
1862
+
type: "number",
1863
1863
+
description: "Период",
1864
1864
+
enum: [
1865
1865
+
-10,
1866
1866
+
-1,
1867
1867
+
0,
1868
1868
+
1,
1869
1869
+
3,
1870
1870
+
6,
1871
1871
+
12
1872
1872
+
]
1672
1873
}
1673
1874
}
1674
1875
} as const;
1675
1876
1676
1877
export const ModelWithBackticksInDescriptionSchema = {
1677
1677
-
description: 'Some description with `back ticks`',
1678
1678
-
type: 'object',
1878
1878
+
description: "Some description with `back ticks`",
1879
1879
+
type: "object",
1679
1880
properties: {
1680
1881
template: {
1681
1681
-
type: 'string',
1682
1682
-
description: `The template \`that\` should be used for parsing and importing the contents of the CSV file.
1683
1683
-
1684
1684
-
<br/><p>There is one placeholder currently supported:<ul> <li><b>\${x}</b> - refers to the n-th column in the CSV file, e.g. \${1}, \${2}, ...)</li></ul><p>Example of a correct JSON template:</p>
1685
1685
-
<pre>
1686
1686
-
[
1687
1687
-
{
1688
1688
-
"resourceType": "Asset",
1689
1689
-
"identifier": {
1690
1690
-
"name": "\${1}",
1691
1691
-
"domain": {
1692
1692
-
"name": "\${2}",
1693
1693
-
"community": {
1694
1694
-
"name": "Some Community"
1695
1695
-
}
1696
1696
-
}
1697
1697
-
},
1698
1698
-
"attributes" : {
1699
1699
-
"00000000-0000-0000-0000-000000003115" : [ {
1700
1700
-
"value" : "\${3}"
1701
1701
-
} ],
1702
1702
-
"00000000-0000-0000-0000-000000000222" : [ {
1703
1703
-
"value" : "\${4}"
1704
1704
-
} ]
1705
1705
-
}
1706
1706
-
}
1707
1707
-
]
1708
1708
-
</pre>`
1882
1882
+
type: "string",
1883
1883
+
description: "The template `that` should be used for parsing and importing the contents of the CSV file.\n\n<br/><p>There is one placeholder currently supported:<ul> <li><b>${x}</b> - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)</li></ul><p>Example of a correct JSON template:</p>\n<pre>\n[\n {\n \"resourceType\": \"Asset\",\n \"identifier\": {\n \"name\": \"${1}\",\n \"domain\": {\n \"name\": \"${2}\",\n \"community\": {\n \"name\": \"Some Community\"\n }\n }\n },\n \"attributes\" : {\n \"00000000-0000-0000-0000-000000003115\" : [ {\n \"value\" : \"${3}\"\n } ],\n \"00000000-0000-0000-0000-000000000222\" : [ {\n \"value\" : \"${4}\"\n } ]\n }\n }\n]\n</pre>"
1709
1884
}
1710
1885
}
1711
1886
} as const;
1712
1887
1713
1888
export const ModelWithOneOfAndPropertiesSchema = {
1714
1714
-
type: 'object',
1889
1889
+
type: "object",
1715
1890
oneOf: [
1716
1891
{
1717
1717
-
'$ref': '#/components/parameters/SimpleParameter'
1892
1892
+
'$ref': "#/components/parameters/SimpleParameter"
1718
1893
},
1719
1894
{
1720
1720
-
'$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串'
1895
1895
+
'$ref': "#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串"
1721
1896
}
1722
1897
],
1723
1723
-
required: ['baz', 'qux'],
1898
1898
+
required: [
1899
1899
+
"baz",
1900
1900
+
"qux"
1901
1901
+
],
1724
1902
properties: {
1725
1903
baz: {
1726
1726
-
type: ['integer', 'null'],
1727
1727
-
format: 'uint16',
1904
1904
+
type: [
1905
1905
+
"integer",
1906
1906
+
"null"
1907
1907
+
],
1908
1908
+
format: "uint16",
1728
1909
minimum: 0
1729
1910
},
1730
1911
qux: {
1731
1731
-
type: 'integer',
1732
1732
-
format: 'uint8',
1912
1912
+
type: "integer",
1913
1913
+
format: "uint8",
1733
1914
minimum: 0
1734
1915
}
1735
1916
}
1736
1917
} as const;
1737
1918
1738
1919
export const ParameterSimpleParameterUnusedSchema = {
1739
1739
-
description: 'Model used to test deduplication strategy (unused)',
1740
1740
-
type: 'string'
1920
1920
+
description: "Model used to test deduplication strategy (unused)",
1921
1921
+
type: "string"
1741
1922
} as const;
1742
1923
1743
1924
export const PostServiceWithEmptyTagResponseSchema = {
1744
1744
-
description: 'Model used to test deduplication strategy',
1745
1745
-
type: 'string'
1925
1925
+
description: "Model used to test deduplication strategy",
1926
1926
+
type: "string"
1746
1927
} as const;
1747
1928
1748
1929
export const PostServiceWithEmptyTagResponse2Schema = {
1749
1749
-
description: 'Model used to test deduplication strategy',
1750
1750
-
type: 'string'
1930
1930
+
description: "Model used to test deduplication strategy",
1931
1931
+
type: "string"
1751
1932
} as const;
1752
1933
1753
1934
export const DeleteFooDataSchema = {
1754
1754
-
description: 'Model used to test deduplication strategy',
1755
1755
-
type: 'string'
1935
1935
+
description: "Model used to test deduplication strategy",
1936
1936
+
type: "string"
1756
1937
} as const;
1757
1938
1758
1939
export const DeleteFooData2Schema = {
1759
1759
-
description: 'Model used to test deduplication strategy',
1760
1760
-
type: 'string'
1940
1940
+
description: "Model used to test deduplication strategy",
1941
1941
+
type: "string"
1761
1942
} as const;
1762
1943
1763
1944
export const importSchema = {
1764
1764
-
description: 'Model with restricted keyword name',
1765
1765
-
type: 'string'
1945
1945
+
description: "Model with restricted keyword name",
1946
1946
+
type: "string"
1766
1947
} as const;
1767
1948
1768
1949
export const SchemaWithFormRestrictedKeysSchema = {
1769
1769
-
type: 'object',
1950
1950
+
type: "object",
1770
1951
properties: {
1771
1952
description: {
1772
1772
-
type: 'string'
1953
1953
+
type: "string"
1773
1954
},
1774
1955
'x-enum-descriptions': {
1775
1775
-
type: 'string'
1956
1956
+
type: "string"
1776
1957
},
1777
1958
'x-enum-varnames': {
1778
1778
-
type: 'string'
1959
1959
+
type: "string"
1779
1960
},
1780
1961
'x-enumNames': {
1781
1781
-
type: 'string'
1962
1962
+
type: "string"
1782
1963
},
1783
1964
title: {
1784
1784
-
type: 'string'
1965
1965
+
type: "string"
1785
1966
},
1786
1967
object: {
1787
1787
-
type: 'object',
1968
1968
+
type: "object",
1788
1969
properties: {
1789
1970
description: {
1790
1790
-
type: 'string'
1971
1971
+
type: "string"
1791
1972
},
1792
1973
'x-enum-descriptions': {
1793
1793
-
type: 'string'
1974
1974
+
type: "string"
1794
1975
},
1795
1976
'x-enum-varnames': {
1796
1796
-
type: 'string'
1977
1977
+
type: "string"
1797
1978
},
1798
1979
'x-enumNames': {
1799
1799
-
type: 'string'
1980
1980
+
type: "string"
1800
1981
},
1801
1982
title: {
1802
1802
-
type: 'string'
1983
1983
+
type: "string"
1803
1984
}
1804
1985
}
1805
1986
},
1806
1987
array: {
1807
1807
-
type: 'array',
1988
1988
+
type: "array",
1808
1989
items: {
1809
1809
-
type: 'object',
1990
1990
+
type: "object",
1810
1991
properties: {
1811
1992
description: {
1812
1812
-
type: 'string'
1993
1993
+
type: "string"
1813
1994
},
1814
1995
'x-enum-descriptions': {
1815
1815
-
type: 'string'
1996
1996
+
type: "string"
1816
1997
},
1817
1998
'x-enum-varnames': {
1818
1818
-
type: 'string'
1999
1999
+
type: "string"
1819
2000
},
1820
2001
'x-enumNames': {
1821
1821
-
type: 'string'
2002
2002
+
type: "string"
1822
2003
},
1823
2004
title: {
1824
1824
-
type: 'string'
2005
2005
+
type: "string"
1825
2006
}
1826
2007
}
1827
2008
}
···
1830
2011
} as const;
1831
2012
1832
2013
export const io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptionsSchema = {
1833
1833
-
description: 'This schema was giving PascalCase transformations a hard time',
2014
2014
+
description: "This schema was giving PascalCase transformations a hard time",
1834
2015
properties: {
1835
2016
preconditions: {
1836
2017
allOf: [
1837
2018
{
1838
1838
-
'$ref': '#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions'
2019
2019
+
'$ref': "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions"
1839
2020
}
1840
2021
],
1841
1841
-
description: 'Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.'
2022
2022
+
description: "Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned."
1842
2023
}
1843
2024
},
1844
1844
-
type: 'object'
2025
2025
+
type: "object"
1845
2026
} as const;
1846
2027
1847
2028
export const io_k8s_apimachinery_pkg_apis_meta_v1_PreconditionsSchema = {
1848
1848
-
description: 'This schema was giving PascalCase transformations a hard time',
2029
2029
+
description: "This schema was giving PascalCase transformations a hard time",
1849
2030
properties: {
1850
2031
resourceVersion: {
1851
1851
-
description: 'Specifies the target ResourceVersion',
1852
1852
-
type: 'string'
2032
2032
+
description: "Specifies the target ResourceVersion",
2033
2033
+
type: "string"
1853
2034
},
1854
2035
uid: {
1855
1855
-
description: 'Specifies the target UID.',
1856
1856
-
type: 'string'
2036
2036
+
description: "Specifies the target UID.",
2037
2037
+
type: "string"
1857
2038
}
1858
2039
},
1859
1859
-
type: 'object'
2040
2040
+
type: "object"
1860
2041
} as const;
1861
2042
1862
2043
export const AdditionalPropertiesUnknownIssueSchema = {
1863
1863
-
type: 'object',
2044
2044
+
type: "object",
1864
2045
additionalProperties: {
1865
2046
anyOf: [
1866
2047
{
1867
1867
-
type: 'string'
2048
2048
+
type: "string"
1868
2049
},
1869
2050
{
1870
1870
-
type: 'number'
2051
2051
+
type: "number"
1871
2052
}
1872
2053
]
1873
2054
}
1874
2055
} as const;
1875
2056
1876
2057
export const AdditionalPropertiesUnknownIssue2Schema = {
1877
1877
-
type: 'object',
2058
2058
+
type: "object",
1878
2059
additionalProperties: {
1879
2060
anyOf: [
1880
2061
{
1881
1881
-
type: 'string'
2062
2062
+
type: "string"
1882
2063
},
1883
2064
{
1884
1884
-
type: 'number'
2065
2065
+
type: "number"
1885
2066
}
1886
2067
]
1887
2068
}
1888
2069
} as const;
1889
2070
1890
2071
export const AdditionalPropertiesUnknownIssue3Schema = {
1891
1891
-
type: 'object',
2072
2072
+
type: "object",
1892
2073
allOf: [
1893
2074
{
1894
1894
-
type: 'string'
2075
2075
+
type: "string"
1895
2076
},
1896
2077
{
1897
1897
-
type: 'object',
1898
1898
-
required: ['entries'],
2078
2078
+
type: "object",
2079
2079
+
required: [
2080
2080
+
"entries"
2081
2081
+
],
1899
2082
properties: {
1900
2083
entries: {
1901
1901
-
type: 'object',
2084
2084
+
type: "object",
1902
2085
additionalProperties: {
1903
1903
-
'$ref': '#/components/schemas/AdditionalPropertiesUnknownIssue'
2086
2086
+
'$ref': "#/components/schemas/AdditionalPropertiesUnknownIssue"
1904
2087
}
1905
2088
}
1906
2089
}
···
1909
2092
} as const;
1910
2093
1911
2094
export const AdditionalPropertiesIntegerIssueSchema = {
1912
1912
-
type: 'object',
1913
1913
-
required: ['value'],
2095
2095
+
type: "object",
2096
2096
+
required: [
2097
2097
+
"value"
2098
2098
+
],
1914
2099
properties: {
1915
2100
value: {
1916
1916
-
type: 'integer'
2101
2101
+
type: "integer"
1917
2102
}
1918
2103
},
1919
2104
additionalProperties: {
1920
1920
-
type: 'integer'
2105
2105
+
type: "integer"
1921
2106
}
1922
2107
} as const;
1923
2108
···
1928
2113
{
1929
2114
oneOf: [
1930
2115
{
1931
1931
-
'$ref': '#/components/schemas/ConstValue'
2116
2116
+
'$ref': "#/components/schemas/ConstValue"
1932
2117
},
1933
2118
{
1934
1934
-
'$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]'
2119
2119
+
'$ref': "#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]"
1935
2120
}
1936
2121
]
1937
2122
},
1938
2123
{
1939
1939
-
'$ref': '#/components/schemas/3e-num_1Период'
2124
2124
+
'$ref': "#/components/schemas/3e-num_1Период"
1940
2125
}
1941
2126
]
1942
2127
},
1943
2128
{
1944
1944
-
'$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]'
2129
2129
+
'$ref': "#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]"
1945
2130
}
1946
2131
]
1947
2132
} as const;
1948
2133
1949
2134
export const Generic_Schema_Duplicate_Issue_1_System_Boolean_Schema = {
1950
1950
-
type: 'object',
2135
2135
+
type: "object",
1951
2136
properties: {
1952
2137
item: {
1953
1953
-
type: 'boolean'
2138
2138
+
type: "boolean"
1954
2139
},
1955
2140
error: {
1956
1956
-
type: ['string', 'null']
2141
2141
+
type: [
2142
2142
+
"string",
2143
2143
+
"null"
2144
2144
+
]
1957
2145
},
1958
2146
hasError: {
1959
1959
-
type: 'boolean',
2147
2147
+
type: "boolean",
1960
2148
readOnly: true
1961
2149
},
1962
2150
data: {
1963
1963
-
type: 'object',
2151
2151
+
type: "object",
1964
2152
additionalProperties: false
1965
2153
}
1966
2154
},
···
1968
2156
} as const;
1969
2157
1970
2158
export const Generic_Schema_Duplicate_Issue_1_System_String_Schema = {
1971
1971
-
type: 'object',
2159
2159
+
type: "object",
1972
2160
properties: {
1973
2161
item: {
1974
1974
-
type: ['string', 'null']
2162
2162
+
type: [
2163
2163
+
"string",
2164
2164
+
"null"
2165
2165
+
]
1975
2166
},
1976
2167
error: {
1977
1977
-
type: ['string', 'null']
2168
2168
+
type: [
2169
2169
+
"string",
2170
2170
+
"null"
2171
2171
+
]
1978
2172
},
1979
2173
hasError: {
1980
1980
-
type: 'boolean',
2174
2174
+
type: "boolean",
1981
2175
readOnly: true
1982
2176
}
1983
2177
},
···
1985
2179
} as const;
1986
2180
1987
2181
export const external_shared_ExternalSharedModelSchema = {
1988
1988
-
type: 'object',
2182
2182
+
type: "object",
1989
2183
properties: {
1990
2184
id: {
1991
1991
-
type: 'string'
2185
2185
+
type: "string"
1992
2186
},
1993
2187
name: {
1994
1994
-
type: 'string'
2188
2188
+
type: "string"
1995
2189
}
1996
2190
},
1997
1997
-
required: ['id']
2191
2191
+
required: [
2192
2192
+
"id"
2193
2193
+
]
1998
2194
} as const;
1999
2195
2000
2196
export const ModelWithReferenceWritableSchema = {
2001
2001
-
description: 'This is a model with one property containing a reference',
2002
2002
-
type: 'object',
2197
2197
+
description: "This is a model with one property containing a reference",
2198
2198
+
type: "object",
2003
2199
properties: {
2004
2200
prop: {
2005
2005
-
'$ref': '#/components/schemas/ModelWithPropertiesWritable'
2201
2201
+
'$ref': "#/components/schemas/ModelWithPropertiesWritable"
2006
2202
}
2007
2203
}
2008
2204
} as const;
2009
2205
2010
2206
export const ModelWithArrayReadOnlyAndWriteOnlyWritableSchema = {
2011
2011
-
description: 'This is a model with one property containing an array',
2012
2012
-
type: 'object',
2207
2207
+
description: "This is a model with one property containing an array",
2208
2208
+
type: "object",
2013
2209
properties: {
2014
2210
prop: {
2015
2015
-
type: 'array',
2211
2211
+
type: "array",
2016
2212
items: {
2017
2017
-
'$ref': '#/components/schemas/ModelWithReadOnlyAndWriteOnlyWritable'
2213
2213
+
'$ref': "#/components/schemas/ModelWithReadOnlyAndWriteOnlyWritable"
2018
2214
}
2019
2215
},
2020
2216
propWithFile: {
2021
2021
-
type: 'array',
2217
2217
+
type: "array",
2022
2218
items: {
2023
2023
-
format: 'binary',
2024
2024
-
type: 'string'
2219
2219
+
format: "binary",
2220
2220
+
type: "string"
2025
2221
}
2026
2222
},
2027
2223
propWithNumber: {
2028
2028
-
type: 'array',
2224
2224
+
type: "array",
2029
2225
items: {
2030
2030
-
type: 'number'
2226
2226
+
type: "number"
2031
2227
}
2032
2228
}
2033
2229
}
2034
2230
} as const;
2035
2231
2036
2232
export const ModelWithPropertiesWritableSchema = {
2037
2037
-
description: 'This is a model with one nested property',
2038
2038
-
type: 'object',
2039
2039
-
required: ['required', 'requiredAndNullable'],
2233
2233
+
description: "This is a model with one nested property",
2234
2234
+
type: "object",
2235
2235
+
required: [
2236
2236
+
"required",
2237
2237
+
"requiredAndNullable"
2238
2238
+
],
2040
2239
properties: {
2041
2240
required: {
2042
2042
-
type: 'string'
2241
2241
+
type: "string"
2043
2242
},
2044
2243
requiredAndNullable: {
2045
2045
-
type: ['string', 'null']
2244
2244
+
type: [
2245
2245
+
"string",
2246
2246
+
"null"
2247
2247
+
]
2046
2248
},
2047
2249
string: {
2048
2048
-
type: 'string'
2250
2250
+
type: "string"
2049
2251
},
2050
2252
number: {
2051
2051
-
type: 'number'
2253
2253
+
type: "number"
2052
2254
},
2053
2255
boolean: {
2054
2054
-
type: 'boolean'
2256
2256
+
type: "boolean"
2055
2257
},
2056
2258
reference: {
2057
2057
-
'$ref': '#/components/schemas/ModelWithString'
2259
2259
+
'$ref': "#/components/schemas/ModelWithString"
2058
2260
},
2059
2261
'property with space': {
2060
2060
-
type: 'string'
2262
2262
+
type: "string"
2061
2263
},
2062
2264
default: {
2063
2063
-
type: 'string'
2265
2265
+
type: "string"
2064
2266
},
2065
2267
try: {
2066
2066
-
type: 'string'
2268
2268
+
type: "string"
2067
2269
}
2068
2270
}
2069
2271
} as const;
2070
2272
2071
2273
export const ModelWithPatternWritableSchema = {
2072
2072
-
description: 'This is a model that contains a some patterns',
2073
2073
-
type: 'object',
2074
2074
-
required: ['key', 'name'],
2274
2274
+
description: "This is a model that contains a some patterns",
2275
2275
+
type: "object",
2276
2276
+
required: [
2277
2277
+
"key",
2278
2278
+
"name"
2279
2279
+
],
2075
2280
properties: {
2076
2281
key: {
2077
2282
maxLength: 64,
2078
2078
-
pattern: '^[a-zA-Z0-9_]*$',
2079
2079
-
type: 'string'
2283
2283
+
pattern: "^[a-zA-Z0-9_]*$",
2284
2284
+
type: "string"
2080
2285
},
2081
2286
name: {
2082
2287
maxLength: 255,
2083
2083
-
type: 'string'
2288
2288
+
type: "string"
2084
2289
},
2085
2290
id: {
2086
2086
-
type: 'string',
2087
2087
-
pattern: '^\\d{2}-\\d{3}-\\d{4}$'
2291
2291
+
type: "string",
2292
2292
+
pattern: "^\\d{2}-\\d{3}-\\d{4}$"
2088
2293
},
2089
2294
text: {
2090
2090
-
type: 'string',
2091
2091
-
pattern: '^\\w+$'
2295
2295
+
type: "string",
2296
2296
+
pattern: "^\\w+$"
2092
2297
},
2093
2298
patternWithSingleQuotes: {
2094
2094
-
type: 'string',
2299
2299
+
type: "string",
2095
2300
pattern: "^[a-zA-Z0-9']*$"
2096
2301
},
2097
2302
patternWithNewline: {
2098
2098
-
type: 'string',
2099
2099
-
pattern: 'aaa\\nbbb'
2303
2303
+
type: "string",
2304
2304
+
pattern: "aaa\\nbbb"
2100
2305
},
2101
2306
patternWithBacktick: {
2102
2102
-
type: 'string',
2103
2103
-
pattern: 'aaa`bbb'
2307
2307
+
type: "string",
2308
2308
+
pattern: "aaa`bbb"
2104
2309
}
2105
2310
}
2106
2311
} as const;
2107
2312
2108
2313
export const FileWritableSchema = {
2109
2109
-
required: ['mime'],
2110
2110
-
type: 'object',
2314
2314
+
required: [
2315
2315
+
"mime"
2316
2316
+
],
2317
2317
+
type: "object",
2111
2318
properties: {
2112
2319
mime: {
2113
2113
-
title: 'Mime',
2114
2114
-
type: 'string',
2320
2320
+
title: "Mime",
2321
2321
+
type: "string",
2115
2322
maxLength: 24,
2116
2323
minLength: 1
2117
2324
}
···
2119
2326
} as const;
2120
2327
2121
2328
export const ModelWithReadOnlyAndWriteOnlyWritableSchema = {
2122
2122
-
type: 'object',
2123
2123
-
required: ['foo', 'baz'],
2329
2329
+
type: "object",
2330
2330
+
required: [
2331
2331
+
"foo",
2332
2332
+
"baz"
2333
2333
+
],
2124
2334
properties: {
2125
2335
foo: {
2126
2126
-
type: 'string'
2336
2336
+
type: "string"
2127
2337
},
2128
2338
baz: {
2129
2129
-
type: 'string',
2339
2339
+
type: "string",
2130
2340
writeOnly: true
2131
2341
}
2132
2342
}
2133
2343
} as const;
2134
2344
2135
2345
export const ModelWithAnyOfConstantSizeArrayWithNSizeAndOptionsWritableSchema = {
2136
2136
-
type: 'array',
2346
2346
+
type: "array",
2137
2347
items: {
2138
2348
oneOf: [
2139
2349
{
2140
2140
-
type: 'number'
2350
2350
+
type: "number"
2141
2351
},
2142
2352
{
2143
2143
-
'$ref': '#/components/schemas/import'
2353
2353
+
'$ref': "#/components/schemas/import"
2144
2354
}
2145
2355
]
2146
2356
},
···
2149
2359
} as const;
2150
2360
2151
2361
export const AdditionalPropertiesUnknownIssueWritableSchema = {
2152
2152
-
type: 'object',
2362
2362
+
type: "object",
2153
2363
additionalProperties: {
2154
2364
anyOf: [
2155
2365
{
2156
2156
-
type: 'string'
2366
2366
+
type: "string"
2157
2367
},
2158
2368
{
2159
2159
-
type: 'number'
2369
2369
+
type: "number"
2160
2370
}
2161
2371
]
2162
2372
}
···
2169
2379
{
2170
2380
oneOf: [
2171
2381
{
2172
2172
-
'$ref': '#/components/schemas/ConstValue'
2382
2382
+
'$ref': "#/components/schemas/ConstValue"
2173
2383
},
2174
2384
{
2175
2175
-
'$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]'
2385
2385
+
'$ref': "#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]"
2176
2386
}
2177
2387
]
2178
2388
},
2179
2389
{
2180
2180
-
'$ref': '#/components/schemas/3e-num_1Период'
2390
2390
+
'$ref': "#/components/schemas/3e-num_1Период"
2181
2391
}
2182
2392
]
2183
2393
},
2184
2394
{
2185
2185
-
'$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]'
2395
2395
+
'$ref': "#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]"
2186
2396
}
2187
2397
]
2188
2398
} as const;
2189
2399
2190
2400
export const Generic_Schema_Duplicate_Issue_1_System_Boolean_WritableSchema = {
2191
2191
-
type: 'object',
2401
2401
+
type: "object",
2192
2402
properties: {
2193
2403
item: {
2194
2194
-
type: 'boolean'
2404
2404
+
type: "boolean"
2195
2405
},
2196
2406
error: {
2197
2197
-
type: ['string', 'null']
2407
2407
+
type: [
2408
2408
+
"string",
2409
2409
+
"null"
2410
2410
+
]
2198
2411
},
2199
2412
data: {
2200
2200
-
type: 'object',
2413
2413
+
type: "object",
2201
2414
additionalProperties: false
2202
2415
}
2203
2416
},
···
2205
2418
} as const;
2206
2419
2207
2420
export const Generic_Schema_Duplicate_Issue_1_System_String_WritableSchema = {
2208
2208
-
type: 'object',
2421
2421
+
type: "object",
2209
2422
properties: {
2210
2423
item: {
2211
2211
-
type: ['string', 'null']
2424
2424
+
type: [
2425
2425
+
"string",
2426
2426
+
"null"
2427
2427
+
]
2212
2428
},
2213
2429
error: {
2214
2214
-
type: ['string', 'null']
2430
2430
+
type: [
2431
2431
+
"string",
2432
2432
+
"null"
2433
2433
+
]
2215
2434
}
2216
2435
},
2217
2436
additionalProperties: false
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/sdk/default/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base',
18
18
-
throwOnError: true
19
19
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base", throwOnError: true }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@pinia/colada/fetch/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseURL: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/axios/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseURL: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/fetch/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/axios/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseURL: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/fetch/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/axios/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseURL: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/axios/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseURL: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/fetch/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'http://localhost:3000/base'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/servers/client.gen.ts
···
13
13
*/
14
14
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
16
16
-
export const client = createClient(createConfig<ClientOptions2>({
17
17
-
baseUrl: 'https://foo.com/v1'
18
18
-
}));
16
16
+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "https://foo.com/v1" }));
+2
-6
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-all-of/transformers.gen.ts
···
3
3
import type { GetFooResponse } from './types.gen';
4
4
5
5
const fooSchemaResponseTransformer = (data: any) => {
6
6
-
data.foo = data.foo.map((item: any) => {
7
7
-
return barSchemaResponseTransformer(item);
8
8
-
});
6
6
+
data.foo = data.foo.map((item: any) => barSchemaResponseTransformer(item));
9
7
return data;
10
8
};
11
9
12
10
const barSchemaResponseTransformer = (data: any) => {
13
13
-
data.foo = data.foo.map((item: any) => {
14
14
-
return bazSchemaResponseTransformer(item);
15
15
-
});
11
11
+
data.foo = data.foo.map((item: any) => bazSchemaResponseTransformer(item));
16
12
return data;
17
13
};
18
14
+1
-3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-any-of-null/transformers.gen.ts
···
19
19
};
20
20
21
21
export const getFooResponseTransformer = async (data: any): Promise<GetFooResponse> => {
22
22
-
data = data.map((item: any) => {
23
23
-
return fooSchemaResponseTransformer(item);
24
24
-
});
22
22
+
data = data.map((item: any) => fooSchemaResponseTransformer(item));
25
23
return data;
26
24
};
27
25
+2
-6
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-recursive/transformers.gen.ts
···
7
7
data.createdAt = new Date(data.createdAt);
8
8
}
9
9
if (data.children) {
10
10
-
data.children = data.children.map((item: any) => {
11
11
-
return treeNodeSchemaResponseTransformer(item);
12
12
-
});
10
10
+
data.children = data.children.map((item: any) => treeNodeSchemaResponseTransformer(item));
13
11
}
14
12
return data;
15
13
};
16
14
17
15
export const getTreeResponseTransformer = async (data: any): Promise<GetTreeResponse> => {
18
18
-
data = data.map((item: any) => {
19
19
-
return treeNodeSchemaResponseTransformer(item);
20
20
-
});
16
16
+
data = data.map((item: any) => treeNodeSchemaResponseTransformer(item));
21
17
return data;
22
18
};
+24
-38
packages/openapi-ts/src/plugins/@hey-api/client-core/client.ts
···
1
1
import { clientFolderAbsolutePath } from '~/generate/client';
2
2
-
import { tsc } from '~/tsc';
2
2
+
import { $ } from '~/ts-dsl';
3
3
import { parseUrl } from '~/utils/url';
4
4
5
5
import type { PluginHandler } from './types';
···
51
51
})
52
52
: undefined;
53
53
54
54
-
const defaultValues: Array<unknown> = [];
54
54
+
const defaultVals = $.object();
55
55
56
56
const resolvedBaseUrl = resolveBaseUrlString({
57
57
plugin: plugin as any,
···
59
59
if (resolvedBaseUrl) {
60
60
const url = parseUrl(resolvedBaseUrl);
61
61
if (url.protocol && url.host && !resolvedBaseUrl.includes('{')) {
62
62
-
defaultValues.push({
63
63
-
key: getClientBaseUrlKey(plugin.context.config),
64
64
-
value: resolvedBaseUrl,
65
65
-
});
62
62
+
defaultVals.prop(
63
63
+
getClientBaseUrlKey(plugin.context.config),
64
64
+
$.literal(resolvedBaseUrl),
65
65
+
);
66
66
} else if (resolvedBaseUrl !== '/' && resolvedBaseUrl.startsWith('/')) {
67
67
const baseUrl = resolvedBaseUrl.endsWith('/')
68
68
? resolvedBaseUrl.slice(0, -1)
69
69
: resolvedBaseUrl;
70
70
-
defaultValues.push({
71
71
-
key: getClientBaseUrlKey(plugin.context.config),
72
72
-
value: baseUrl,
73
73
-
});
70
70
+
defaultVals.prop(
71
71
+
getClientBaseUrlKey(plugin.context.config),
72
72
+
$.literal(baseUrl),
73
73
+
);
74
74
}
75
75
}
76
76
77
77
if ('throwOnError' in plugin.config && plugin.config.throwOnError) {
78
78
-
defaultValues.push({
79
79
-
key: 'throwOnError',
80
80
-
value: true,
81
81
-
});
78
78
+
defaultVals.prop('throwOnError', $.literal(true));
82
79
}
83
80
84
81
const createConfigParameters = [
85
85
-
tsc.callExpression({
86
86
-
functionName: symbolCreateConfig.placeholder,
87
87
-
parameters: defaultValues.length
88
88
-
? [tsc.objectExpression({ obj: defaultValues })]
89
89
-
: undefined,
90
90
-
types: [
91
91
-
tsc.typeReferenceNode({ typeName: symbolClientOptions.placeholder }),
92
92
-
],
93
93
-
}),
82
82
+
$(symbolCreateConfig.placeholder)
83
83
+
.call(defaultVals.hasProps() ? defaultVals : undefined)
84
84
+
.generic(symbolClientOptions.placeholder),
94
85
];
95
86
96
87
const symbolClient = plugin.registerSymbol({
88
88
+
exported: true,
97
89
meta: {
98
90
category: 'client',
99
91
},
100
92
name: 'client',
101
93
});
102
102
-
const statement = tsc.constVariable({
103
103
-
exportConst: true,
104
104
-
expression: tsc.callExpression({
105
105
-
functionName: symbolCreateClient.placeholder,
106
106
-
parameters: symbolCreateClientConfig
107
107
-
? [
108
108
-
tsc.callExpression({
109
109
-
functionName: symbolCreateClientConfig.placeholder,
110
110
-
parameters: createConfigParameters,
111
111
-
}),
112
112
-
]
113
113
-
: createConfigParameters,
114
114
-
}),
115
115
-
name: symbolClient.placeholder,
116
116
-
});
94
94
+
const statement = $.const(symbolClient.placeholder)
95
95
+
.export(symbolClient.exported)
96
96
+
.assign(
97
97
+
$(symbolCreateClient.placeholder).$if(
98
98
+
symbolCreateClientConfig,
99
99
+
(c, s) => c.call($(s.placeholder).call(...createConfigParameters)),
100
100
+
(c) => c.call(...createConfigParameters),
101
101
+
),
102
102
+
);
117
103
plugin.setSymbolValue(symbolClient, statement);
118
104
};
+34
-50
packages/openapi-ts/src/plugins/@hey-api/client-core/createClientConfig.ts
···
1
1
import { clientFolderAbsolutePath } from '~/generate/client';
2
2
-
import { tsc } from '~/tsc';
2
2
+
import { $ } from '~/ts-dsl';
3
3
4
4
import type { PluginHandler } from './types';
5
5
···
28
28
name: 'CreateClientConfig',
29
29
});
30
30
31
31
-
const defaultClientOptionsType = tsc.typeReferenceNode({
32
32
-
typeName: symbolDefaultClientOptions.placeholder,
33
33
-
});
34
34
-
const tType = tsc.typeReferenceNode({ typeName: 'T' });
35
35
-
const typeCreateClientConfig = tsc.typeAliasDeclaration({
36
36
-
comment: [
31
31
+
const typeCreateClientConfig = $.type
32
32
+
.alias(symbolCreateClientConfig.placeholder)
33
33
+
.export(symbolCreateClientConfig.exported)
34
34
+
.doc([
37
35
'The `createClientConfig()` function will be called on client initialization',
38
36
"and the returned object will become the client's initial configuration.",
39
37
'',
40
38
'You may want to initialize your client this way instead of calling',
41
39
"`setConfig()`. This is useful for example if you're using Next.js",
42
40
'to ensure your client always has the correct values.',
43
43
-
],
44
44
-
exportType: symbolCreateClientConfig.exported,
45
45
-
name: symbolCreateClientConfig.placeholder,
46
46
-
type: tsc.functionTypeNode({
47
47
-
parameters: [
48
48
-
tsc.parameterDeclaration({
49
49
-
name: 'override',
50
50
-
required: false,
51
51
-
type: tsc.typeReferenceNode({
52
52
-
typeArguments: [
53
53
-
tsc.typeIntersectionNode({
54
54
-
types: [defaultClientOptionsType, tType],
55
55
-
}),
56
56
-
],
57
57
-
typeName: symbolConfig.placeholder,
58
58
-
}),
59
59
-
}),
60
60
-
],
61
61
-
returnType: tsc.typeReferenceNode({
62
62
-
typeArguments: [
63
63
-
tsc.typeIntersectionNode({
64
64
-
types: [
65
65
-
tsc.typeReferenceNode({
66
66
-
typeArguments: [defaultClientOptionsType],
67
67
-
typeName: 'Required',
68
68
-
}),
69
69
-
tType,
70
70
-
],
71
71
-
}),
72
72
-
],
73
73
-
typeName: symbolConfig.placeholder,
74
74
-
}),
75
75
-
}),
76
76
-
typeParameters: [
77
77
-
{
78
78
-
default: tsc.typeReferenceNode({
79
79
-
typeName: symbolClientOptions.placeholder,
80
80
-
}),
81
81
-
extends: defaultClientOptionsType,
82
82
-
name: 'T',
83
83
-
},
84
84
-
],
85
85
-
});
41
41
+
])
42
42
+
.generic('T', (g) =>
43
43
+
g
44
44
+
.extends(symbolDefaultClientOptions.placeholder)
45
45
+
.default(symbolClientOptions.placeholder),
46
46
+
)
47
47
+
.type(
48
48
+
$.type
49
49
+
.func()
50
50
+
.param('override', (p) =>
51
51
+
p
52
52
+
.optional()
53
53
+
.type(
54
54
+
$.type(symbolConfig.placeholder).generic(
55
55
+
$.type.and(symbolDefaultClientOptions.placeholder, 'T'),
56
56
+
),
57
57
+
),
58
58
+
)
59
59
+
.returns(
60
60
+
$.type(symbolConfig.placeholder).generic(
61
61
+
$.type.and(
62
62
+
$.type('Required').generic(
63
63
+
symbolDefaultClientOptions.placeholder,
64
64
+
),
65
65
+
'T',
66
66
+
),
67
67
+
),
68
68
+
),
69
69
+
);
86
70
plugin.setSymbolValue(symbolCreateClientConfig, typeCreateClientConfig);
87
71
};
+28
-19
packages/openapi-ts/src/plugins/@hey-api/schemas/plugin.ts
···
5
5
import type { OpenApiV3_1_XTypes } from '~/openApi/3.1.x';
6
6
import { ensureValidIdentifier } from '~/openApi/shared/utils/identifier';
7
7
import type { OpenApi } from '~/openApi/types';
8
8
-
import { tsc } from '~/tsc';
8
8
+
import { $ } from '~/ts-dsl';
9
9
10
10
import type { HeyApiSchemasPlugin } from './types';
11
11
···
383
383
plugin,
384
384
schema,
385
385
});
386
386
-
const statement = tsc.constVariable({
387
387
-
assertion: 'const',
388
388
-
exportConst: symbol.exported,
389
389
-
expression: tsc.objectExpression({ obj }),
390
390
-
name: symbol.placeholder,
391
391
-
});
386
386
+
const statement = $.const(symbol.placeholder)
387
387
+
.export(symbol.exported)
388
388
+
.assign(
389
389
+
$(
390
390
+
$.toExpr(obj, {
391
391
+
layout: 'pretty',
392
392
+
})!,
393
393
+
).as('const'),
394
394
+
);
392
395
plugin.setSymbolValue(symbol, statement);
393
396
}
394
397
};
···
421
424
plugin,
422
425
schema,
423
426
});
424
424
-
const statement = tsc.constVariable({
425
425
-
assertion: 'const',
426
426
-
exportConst: symbol.exported,
427
427
-
expression: tsc.objectExpression({ obj }),
428
428
-
name: symbol.placeholder,
429
429
-
});
427
427
+
const statement = $.const(symbol.placeholder)
428
428
+
.export(symbol.exported)
429
429
+
.assign(
430
430
+
$(
431
431
+
$.toExpr(obj, {
432
432
+
layout: 'pretty',
433
433
+
})!,
434
434
+
).as('const'),
435
435
+
);
430
436
plugin.setSymbolValue(symbol, statement);
431
437
}
432
438
};
···
459
465
plugin,
460
466
schema,
461
467
});
462
462
-
const statement = tsc.constVariable({
463
463
-
assertion: 'const',
464
464
-
exportConst: symbol.exported,
465
465
-
expression: tsc.objectExpression({ obj }),
466
466
-
name: symbol.placeholder,
467
467
-
});
468
468
+
const statement = $.const(symbol.placeholder)
469
469
+
.export(symbol.exported)
470
470
+
.assign(
471
471
+
$(
472
472
+
$.toExpr(obj, {
473
473
+
layout: 'pretty',
474
474
+
})!,
475
475
+
).as('const'),
476
476
+
);
468
477
plugin.setSymbolValue(symbol, statement);
469
478
}
470
479
};
+10
-37
packages/openapi-ts/src/plugins/@hey-api/transformers/expressions.ts
···
1
1
import type ts from 'typescript';
2
2
3
3
import type { IR } from '~/ir/types';
4
4
-
import { tsc } from '~/tsc';
4
4
+
import { $ } from '~/ts-dsl';
5
5
6
6
import type { UserConfig } from './types';
7
7
···
11
11
schema,
12
12
}: {
13
13
config: Omit<UserConfig, 'name'>;
14
14
-
dataExpression?: ts.Expression | string;
14
14
+
dataExpression?:
15
15
+
| ts.Expression
16
16
+
| ReturnType<typeof $.expr | typeof $.attr>
17
17
+
| string;
15
18
schema: IR.SchemaObject;
16
16
-
}) => Array<ts.Expression> | undefined;
19
19
+
}) => Array<NonNullable<ReturnType<typeof $.toExpr>>> | undefined;
17
20
18
21
export const bigIntExpressions: ExpressionTransformer = ({
19
22
dataExpression,
···
25
28
26
29
const bigIntCallExpression =
27
30
dataExpression !== undefined
28
28
-
? tsc.callExpression({
29
29
-
functionName: 'BigInt',
30
30
-
parameters: [
31
31
-
tsc.callExpression({
32
32
-
functionName: tsc.propertyAccessExpression({
33
33
-
expression: dataExpression,
34
34
-
name: 'toString',
35
35
-
}),
36
36
-
}),
37
37
-
],
38
38
-
})
31
31
+
? $('BigInt').call($.expr(dataExpression).attr('toString').call())
39
32
: undefined;
40
33
41
34
if (bigIntCallExpression) {
···
44
37
}
45
38
46
39
if (dataExpression) {
47
47
-
return [
48
48
-
tsc.assignment({
49
49
-
left: dataExpression,
50
50
-
right: bigIntCallExpression,
51
51
-
}),
52
52
-
];
40
40
+
return [$.expr(dataExpression).assign(bigIntCallExpression)];
53
41
}
54
42
}
55
43
···
67
55
return;
68
56
}
69
57
70
70
-
const identifierDate = tsc.identifier({ text: 'Date' });
71
71
-
72
58
if (typeof dataExpression === 'string') {
73
73
-
return [
74
74
-
tsc.newExpression({
75
75
-
argumentsArray: [tsc.identifier({ text: dataExpression })],
76
76
-
expression: identifierDate,
77
77
-
}),
78
78
-
];
59
59
+
return [$.new('Date').arg(dataExpression)];
79
60
}
80
61
81
62
if (dataExpression) {
82
82
-
return [
83
83
-
tsc.assignment({
84
84
-
left: dataExpression,
85
85
-
right: tsc.newExpression({
86
86
-
argumentsArray: [dataExpression],
87
87
-
expression: identifierDate,
88
88
-
}),
89
89
-
}),
90
90
-
];
63
63
+
return [$.expr(dataExpression).assign($.new('Date').arg(dataExpression))];
91
64
}
92
65
93
66
return;
+70
-116
packages/openapi-ts/src/plugins/@hey-api/transformers/plugin.ts
···
4
4
import { createOperationKey, operationResponsesMap } from '~/ir/operation';
5
5
import type { IR } from '~/ir/types';
6
6
import { buildName } from '~/openApi/shared/utils/name';
7
7
-
import { tsc } from '~/tsc';
7
7
+
import { $ } from '~/ts-dsl';
8
8
+
import { TsDsl } from '~/ts-dsl';
8
9
import { refToName } from '~/utils/ref';
9
10
10
11
import type { HeyApiTransformersPlugin } from './types';
···
15
16
// can emit calls to transformers that will be implemented later.
16
17
const buildingSymbols = new Set<number>();
17
18
19
19
+
type Expr = NonNullable<
20
20
+
ReturnType<typeof $.toExpr | typeof $.return | typeof $.if>
21
21
+
>;
22
22
+
18
23
const ensureStatements = (
19
19
-
nodes: Array<ts.Expression | ts.Statement>,
20
20
-
): Array<ts.Statement> =>
21
21
-
nodes.map((node) =>
22
22
-
ts.isStatement(node)
23
23
-
? node
24
24
-
: tsc.expressionToStatement({ expression: node }),
25
25
-
);
24
24
+
nodes: Array<Expr | ts.Expression | ts.Statement>,
25
25
+
): Array<ts.Statement | ReturnType<typeof $.return>> =>
26
26
+
nodes.map((node) => {
27
27
+
if (node instanceof TsDsl) {
28
28
+
node = node.$render();
29
29
+
}
30
30
+
return $.toStmt(node);
31
31
+
});
26
32
27
33
const isNodeReturnStatement = ({
28
34
node,
29
35
}: {
30
30
-
node: ts.Expression | ts.Statement;
31
31
-
}) => node.kind === ts.SyntaxKind.ReturnStatement;
36
36
+
node: ts.Expression | ts.Statement | Expr;
37
37
+
}) => {
38
38
+
if (node instanceof TsDsl) {
39
39
+
node = node.$render();
40
40
+
}
41
41
+
return node.kind === ts.SyntaxKind.ReturnStatement;
42
42
+
};
32
43
33
44
const schemaResponseTransformerNodes = ({
34
45
plugin,
···
36
47
}: {
37
48
plugin: HeyApiTransformersPlugin['Instance'];
38
49
schema: IR.SchemaObject;
39
39
-
}): Array<ts.Expression | ts.Statement> => {
40
40
-
const identifierData = tsc.identifier({ text: dataVariableName });
50
50
+
}): Array<ts.Expression | ts.Statement | Expr> => {
41
51
const nodes = processSchemaType({
42
42
-
dataExpression: identifierData,
52
52
+
dataExpression: $(dataVariableName),
43
53
plugin,
44
54
schema,
45
55
});
46
56
// append return statement if one does not already exist
47
47
-
if (
48
48
-
nodes.length &&
49
49
-
!isNodeReturnStatement({ node: nodes[nodes.length - 1]! })
50
50
-
) {
51
51
-
nodes.push(tsc.returnStatement({ expression: identifierData }));
57
57
+
if (nodes.length) {
58
58
+
const last = nodes[nodes.length - 1]!;
59
59
+
if (!isNodeReturnStatement({ node: last })) {
60
60
+
nodes.push($.return(dataVariableName));
61
61
+
}
52
62
}
53
63
return nodes;
54
64
};
···
58
68
plugin,
59
69
schema,
60
70
}: {
61
61
-
dataExpression?: ts.Expression | string;
71
71
+
dataExpression?:
72
72
+
| ts.Expression
73
73
+
| string
74
74
+
| ReturnType<typeof $.attr | typeof $.expr>;
62
75
plugin: HeyApiTransformersPlugin['Instance'];
63
76
schema: IR.SchemaObject;
64
64
-
}): Array<ts.Expression | ts.Statement> => {
77
77
+
}): Array<Expr | ts.Expression | ts.Statement> => {
65
78
if (schema.$ref) {
66
79
const query: SymbolMeta = {
67
80
category: 'transform',
···
106
119
});
107
120
108
121
if (nodes.length) {
109
109
-
const node = tsc.constVariable({
110
110
-
expression: tsc.arrowFunction({
111
111
-
async: false,
112
112
-
multiLine: true,
113
113
-
parameters: [
114
114
-
{
115
115
-
name: dataVariableName,
116
116
-
// TODO: parser - add types, generate types without transforms
117
117
-
type: tsc.keywordTypeNode({ keyword: 'any' }),
118
118
-
},
119
119
-
],
120
120
-
statements: ensureStatements(nodes),
121
121
-
}),
122
122
-
name: symbol.placeholder,
123
123
-
});
122
122
+
const node = $.const(symbol.placeholder).assign(
123
123
+
// TODO: parser - add types, generate types without transforms
124
124
+
$.func()
125
125
+
.param(dataVariableName, (p) => p.type('any'))
126
126
+
.do(...ensureStatements(nodes)),
127
127
+
);
124
128
plugin.setSymbolValue(symbol, node);
125
129
}
126
130
} finally {
···
134
138
const currentValue = plugin.gen.symbols.getValue(symbol.id);
135
139
if (currentValue || buildingSymbols.has(symbol.id)) {
136
140
const ref = plugin.referenceSymbol(query);
137
137
-
const callExpression = tsc.callExpression({
138
138
-
functionName: ref.placeholder,
139
139
-
parameters: [dataExpression],
140
140
-
});
141
141
+
const callExpression = $(ref.placeholder).call(dataExpression);
141
142
142
143
if (dataExpression) {
143
144
// In a map callback, the item needs to be returned, not just the transformation result
144
145
if (typeof dataExpression === 'string' && dataExpression === 'item') {
145
145
-
return [
146
146
-
tsc.returnStatement({
147
147
-
expression: callExpression,
148
148
-
}),
149
149
-
];
146
146
+
return [$.return(callExpression)];
150
147
}
151
148
152
149
return [
153
150
typeof dataExpression === 'string'
154
151
? callExpression
155
155
-
: tsc.assignment({
156
156
-
left: dataExpression,
157
157
-
right: callExpression,
158
158
-
}),
152
152
+
: $(dataExpression).assign(callExpression),
159
153
];
160
154
}
161
155
}
···
193
187
);
194
188
195
189
if (!hasReturnStatement) {
196
196
-
mapCallbackStatements.push(
197
197
-
tsc.returnStatement({
198
198
-
expression: tsc.identifier({ text: 'item' }),
199
199
-
}),
200
200
-
);
190
190
+
mapCallbackStatements.push($.return('item'));
201
191
}
202
192
203
193
return [
204
204
-
tsc.assignment({
205
205
-
left: dataExpression,
206
206
-
right: tsc.callExpression({
207
207
-
functionName: tsc.propertyAccessExpression({
208
208
-
expression: dataExpression,
209
209
-
name: 'map',
210
210
-
}),
211
211
-
parameters: [
212
212
-
tsc.arrowFunction({
213
213
-
multiLine: true,
214
214
-
parameters: [
215
215
-
{
216
216
-
name: 'item',
217
217
-
type: 'any',
218
218
-
},
219
219
-
],
220
220
-
statements: mapCallbackStatements,
221
221
-
}),
222
222
-
],
223
223
-
}),
224
224
-
}),
194
194
+
$(dataExpression).assign(
195
195
+
$(dataExpression)
196
196
+
.attr('map')
197
197
+
.call(
198
198
+
$.func()
199
199
+
.param('item', (p) => p.type('any'))
200
200
+
.do(...mapCallbackStatements),
201
201
+
),
202
202
+
),
225
203
];
226
204
}
227
205
228
206
if (schema.type === 'object') {
229
229
-
let nodes: Array<ts.Expression | ts.Statement> = [];
207
207
+
let nodes: Array<ts.Expression | ts.Statement | Expr> = [];
230
208
const required = schema.required ?? [];
231
209
232
210
for (const name in schema.properties) {
233
211
const property = schema.properties[name]!;
234
234
-
const propertyAccessExpression = tsc.propertyAccessExpression({
235
235
-
expression: dataExpression || dataVariableName,
236
236
-
name,
237
237
-
});
212
212
+
const propertyAccessExpression = $(
213
213
+
dataExpression || dataVariableName,
214
214
+
).attr(name);
238
215
const propertyNodes = processSchemaType({
239
216
dataExpression: propertyAccessExpression,
240
217
plugin,
···
256
233
// todo: Probably, it would make more sense to go with if(x !== undefined && x !== null) instead of if(x)
257
234
// this place influences all underlying transformers, while it's not exactly transformer itself
258
235
// Keep in mind that !!0 === false, so it already makes output for Bigint undesirable
259
259
-
tsc.ifStatement({
260
260
-
expression: propertyAccessExpression,
261
261
-
thenStatement: tsc.block({
262
262
-
statements: ensureStatements(propertyNodes),
263
263
-
}),
264
264
-
}),
236
236
+
$.if(propertyAccessExpression).do(...ensureStatements(propertyNodes)),
265
237
);
266
238
}
267
239
}
···
278
250
});
279
251
}
280
252
281
281
-
let arrayNodes: Array<ts.Expression | ts.Statement> = [];
253
253
+
let arrayNodes: Array<ts.Expression | ts.Statement | Expr> = [];
282
254
// process 2 items if one of them is null
283
255
if (
284
256
schema.logicalOperator === 'and' ||
···
297
269
if (dataExpression) {
298
270
arrayNodes = arrayNodes.concat(nodes);
299
271
} else {
300
300
-
const identifierItem = tsc.identifier({ text: 'item' });
301
272
// processed means the item was transformed
302
273
arrayNodes.push(
303
303
-
tsc.ifStatement({
304
304
-
expression: identifierItem,
305
305
-
thenStatement: tsc.block({
306
306
-
statements: ensureStatements(nodes),
307
307
-
}),
308
308
-
}),
309
309
-
tsc.returnStatement({ expression: identifierItem }),
274
274
+
$.if('item').do(...ensureStatements(nodes)),
275
275
+
$.return('item'),
310
276
);
311
277
}
312
278
}
···
393
359
name: operation.id,
394
360
}),
395
361
});
396
396
-
const value = tsc.constVariable({
397
397
-
exportConst: symbol.exported,
398
398
-
expression: tsc.arrowFunction({
399
399
-
async: true,
400
400
-
multiLine: true,
401
401
-
parameters: [
402
402
-
{
403
403
-
name: dataVariableName,
404
404
-
// TODO: parser - add types, generate types without transforms
405
405
-
type: tsc.keywordTypeNode({ keyword: 'any' }),
406
406
-
},
407
407
-
],
408
408
-
returnType: tsc.typeReferenceNode({
409
409
-
typeArguments: [
410
410
-
tsc.typeReferenceNode({ typeName: symbolResponse.placeholder }),
411
411
-
],
412
412
-
typeName: 'Promise',
413
413
-
}),
414
414
-
statements: ensureStatements(nodes),
415
415
-
}),
416
416
-
name: symbol.placeholder,
417
417
-
});
362
362
+
const value = $.const(symbol.placeholder)
363
363
+
.export(symbol.exported)
364
364
+
.assign(
365
365
+
// TODO: parser - add types, generate types without transforms
366
366
+
$.func()
367
367
+
.async()
368
368
+
.param(dataVariableName, (p) => p.type('any'))
369
369
+
.returns($.type('Promise').generic(symbolResponse.placeholder))
370
370
+
.do(...ensureStatements(nodes)),
371
371
+
);
418
372
plugin.setSymbolValue(symbol, value);
419
373
},
420
374
{
+4
-3
packages/openapi-ts/src/ts-dsl/array.ts
···
1
1
-
/* eslint-disable @typescript-eslint/no-empty-object-type, @typescript-eslint/no-unsafe-declaration-merging */
1
1
+
/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */
2
2
import ts from 'typescript';
3
3
4
4
import type { MaybeTsDsl } from './base';
5
5
import { TsDsl } from './base';
6
6
import { LiteralTsDsl } from './literal';
7
7
import { mixin } from './mixins/apply';
8
8
+
import { AsMixin } from './mixins/as';
8
9
import { LayoutMixin } from './mixins/layout';
9
10
10
11
export class ArrayTsDsl extends TsDsl<ts.ArrayLiteralExpression> {
···
63
64
}
64
65
}
65
66
66
66
-
export interface ArrayTsDsl extends LayoutMixin {}
67
67
-
mixin(ArrayTsDsl, LayoutMixin);
67
67
+
export interface ArrayTsDsl extends AsMixin, LayoutMixin {}
68
68
+
mixin(ArrayTsDsl, AsMixin, LayoutMixin);
+5
-4
packages/openapi-ts/src/ts-dsl/as.ts
···
1
1
-
/* eslint-disable @typescript-eslint/no-empty-object-type, @typescript-eslint/no-unsafe-declaration-merging */
1
1
+
/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */
2
2
import ts from 'typescript';
3
3
4
4
import type { MaybeTsDsl, TypeTsDsl } from './base';
5
5
import { TsDsl } from './base';
6
6
import { mixin } from './mixins/apply';
7
7
-
import { ExprMixin, registerLazyAccessAsFactory } from './mixins/expr';
7
7
+
import { AsMixin, registerLazyAccessAsFactory } from './mixins/as';
8
8
+
import { ExprMixin } from './mixins/expr';
8
9
9
10
export class AsTsDsl extends TsDsl<ts.AsExpression> {
10
11
private expr: string | MaybeTsDsl<ts.Expression>;
···
27
28
}
28
29
}
29
30
30
30
-
export interface AsTsDsl extends ExprMixin {}
31
31
-
mixin(AsTsDsl, ExprMixin);
31
31
+
export interface AsTsDsl extends AsMixin, ExprMixin {}
32
32
+
mixin(AsTsDsl, AsMixin, ExprMixin);
32
33
33
34
registerLazyAccessAsFactory((...args) => new AsTsDsl(...args));
+29
-9
packages/openapi-ts/src/ts-dsl/attr.ts
···
1
1
/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */
2
2
import ts from 'typescript';
3
3
4
4
+
import { validTypescriptIdentifierRegExp } from '~/utils/regexp';
5
5
+
4
6
import type { MaybeTsDsl } from './base';
5
7
import { TsDsl } from './base';
8
8
+
import { LiteralTsDsl } from './literal';
6
9
import { mixin } from './mixins/apply';
10
10
+
import { AsMixin } from './mixins/as';
7
11
import { AssignmentMixin } from './mixins/assignment';
8
12
import { ExprMixin, registerLazyAccessAttrFactory } from './mixins/expr';
9
13
import { OperatorMixin } from './mixins/operator';
···
26
30
27
31
$render(): ts.PropertyAccessExpression | ts.ElementAccessExpression {
28
32
const leftNode = this.$node(this.left);
29
29
-
if (typeof this.right === 'number') {
30
30
-
if (this.isOptional) {
33
33
+
validTypescriptIdentifierRegExp.lastIndex = 0;
34
34
+
const questionToken = this.isOptional
35
35
+
? ts.factory.createToken(ts.SyntaxKind.QuestionDotToken)
36
36
+
: undefined;
37
37
+
if (
38
38
+
typeof this.right === 'number' ||
39
39
+
(typeof this.right === 'string' &&
40
40
+
!validTypescriptIdentifierRegExp.test(this.right))
41
41
+
) {
42
42
+
if (questionToken) {
31
43
return ts.factory.createElementAccessChain(
32
44
leftNode,
33
33
-
ts.factory.createToken(ts.SyntaxKind.QuestionDotToken),
34
34
-
ts.factory.createNumericLiteral(this.right),
45
45
+
questionToken,
46
46
+
this.$node(new LiteralTsDsl(this.right)),
35
47
);
36
48
}
37
49
return ts.factory.createElementAccessExpression(
38
50
leftNode,
39
39
-
ts.factory.createNumericLiteral(this.right),
51
51
+
this.$node(new LiteralTsDsl(this.right)),
40
52
);
41
53
}
42
42
-
if (this.isOptional) {
54
54
+
if (questionToken) {
43
55
return ts.factory.createPropertyAccessChain(
44
56
leftNode,
45
45
-
ts.factory.createToken(ts.SyntaxKind.QuestionDotToken),
57
57
+
questionToken,
46
58
this.$maybeId(this.right),
47
59
);
48
60
}
···
54
66
}
55
67
56
68
export interface AttrTsDsl
57
57
-
extends AssignmentMixin,
69
69
+
extends AsMixin,
70
70
+
AssignmentMixin,
58
71
ExprMixin,
59
72
OperatorMixin,
60
73
OptionalMixin {}
61
61
-
mixin(AttrTsDsl, AssignmentMixin, ExprMixin, OperatorMixin, OptionalMixin);
74
74
+
mixin(
75
75
+
AttrTsDsl,
76
76
+
AsMixin,
77
77
+
AssignmentMixin,
78
78
+
ExprMixin,
79
79
+
OperatorMixin,
80
80
+
OptionalMixin,
81
81
+
);
62
82
63
83
registerLazyAccessAttrFactory((...args) => new AttrTsDsl(...args));
+3
-3
packages/openapi-ts/src/ts-dsl/base.ts
···
1
1
import ts from 'typescript';
2
2
3
3
+
import { toStmt } from './toStmt';
4
4
+
3
5
export type MaybeArray<T> = T | ReadonlyArray<T>;
4
6
5
7
export interface ITsDsl<T extends ts.Node = ts.Node> {
···
116
118
return arr.map((item) => {
117
119
const node =
118
120
typeof item === 'string' ? this.$id(item) : this._render(item);
119
119
-
return ts.isExpression(node)
120
120
-
? ts.factory.createExpressionStatement(node)
121
121
-
: node;
121
121
+
return toStmt(node);
122
122
});
123
123
}
124
124
+4
-3
packages/openapi-ts/src/ts-dsl/binary.ts
···
1
1
-
/* eslint-disable @typescript-eslint/no-empty-object-type, @typescript-eslint/no-unsafe-declaration-merging */
1
1
+
/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */
2
2
import ts from 'typescript';
3
3
4
4
import type { MaybeTsDsl } from './base';
5
5
import { TsDsl } from './base';
6
6
import { mixin } from './mixins/apply';
7
7
+
import { AsMixin } from './mixins/as';
7
8
import { ExprMixin } from './mixins/expr';
8
9
9
10
type Operator =
···
83
84
}
84
85
}
85
86
86
86
-
export interface BinaryTsDsl extends ExprMixin {}
87
87
-
mixin(BinaryTsDsl, ExprMixin);
87
87
+
export interface BinaryTsDsl extends AsMixin, ExprMixin {}
88
88
+
mixin(BinaryTsDsl, AsMixin, ExprMixin);
+7
-2
packages/openapi-ts/src/ts-dsl/call.ts
···
5
5
import { TsDsl } from './base';
6
6
import { mixin } from './mixins/apply';
7
7
import { ArgsMixin } from './mixins/args';
8
8
+
import { AsMixin } from './mixins/as';
8
9
import { ExprMixin, registerLazyAccessCallFactory } from './mixins/expr';
9
10
import { TypeArgsMixin } from './mixins/type-args';
10
11
···
31
32
}
32
33
}
33
34
34
34
-
export interface CallTsDsl extends ArgsMixin, ExprMixin, TypeArgsMixin {}
35
35
-
mixin(CallTsDsl, ArgsMixin, ExprMixin, TypeArgsMixin);
35
35
+
export interface CallTsDsl
36
36
+
extends ArgsMixin,
37
37
+
AsMixin,
38
38
+
ExprMixin,
39
39
+
TypeArgsMixin {}
40
40
+
mixin(CallTsDsl, ArgsMixin, AsMixin, ExprMixin, TypeArgsMixin);
36
41
37
42
registerLazyAccessCallFactory((expr, args) => new CallTsDsl(expr, ...args));
+1
-1
packages/openapi-ts/src/ts-dsl/class.ts
···
102
102
AbstractMixin,
103
103
DecoratorMixin,
104
104
DefaultMixin,
105
105
-
[DocMixin, { overrideRender: true }],
105
105
+
DocMixin,
106
106
ExportMixin,
107
107
TypeParamsMixin,
108
108
);
+16
-2
packages/openapi-ts/src/ts-dsl/expr.ts
···
4
4
import type { MaybeTsDsl } from './base';
5
5
import { TsDsl } from './base';
6
6
import { mixin } from './mixins/apply';
7
7
+
import { AsMixin } from './mixins/as';
8
8
+
import { AssignmentMixin } from './mixins/assignment';
7
9
import { ExprMixin } from './mixins/expr';
8
10
import { OperatorMixin } from './mixins/operator';
9
11
import { TypeExprMixin } from './mixins/type-expr';
···
21
23
}
22
24
}
23
25
24
24
-
export interface ExprTsDsl extends ExprMixin, OperatorMixin, TypeExprMixin {}
25
25
-
mixin(ExprTsDsl, ExprMixin, OperatorMixin, TypeExprMixin);
26
26
+
export interface ExprTsDsl
27
27
+
extends AsMixin,
28
28
+
AssignmentMixin,
29
29
+
ExprMixin,
30
30
+
OperatorMixin,
31
31
+
TypeExprMixin {}
32
32
+
mixin(
33
33
+
ExprTsDsl,
34
34
+
AsMixin,
35
35
+
AssignmentMixin,
36
36
+
ExprMixin,
37
37
+
OperatorMixin,
38
38
+
TypeExprMixin,
39
39
+
);
+1
-1
packages/openapi-ts/src/ts-dsl/field.ts
···
57
57
mixin(
58
58
FieldTsDsl,
59
59
DecoratorMixin,
60
60
-
[DocMixin, { overrideRender: true }],
60
60
+
DocMixin,
61
61
PrivateMixin,
62
62
ProtectedMixin,
63
63
PublicMixin,
+4
-1
packages/openapi-ts/src/ts-dsl/func.ts
···
3
3
4
4
import { TsDsl, TypeTsDsl } from './base';
5
5
import { mixin } from './mixins/apply';
6
6
+
import { AsMixin } from './mixins/as';
6
7
import { DecoratorMixin } from './mixins/decorator';
7
8
import { DoMixin } from './mixins/do';
8
9
import { DocMixin } from './mixins/doc';
···
126
127
127
128
interface ImplFuncTsDsl
128
129
extends AbstractMixin,
130
130
+
AsMixin,
129
131
AsyncMixin,
130
132
DecoratorMixin,
131
133
DoMixin,
···
140
142
mixin(
141
143
ImplFuncTsDsl,
142
144
AbstractMixin,
145
145
+
AsMixin,
143
146
AsyncMixin,
144
147
DecoratorMixin,
145
148
DoMixin,
146
146
-
[DocMixin, { overrideRender: true }],
149
149
+
DocMixin,
147
150
OptionalMixin,
148
151
ParamMixin,
149
152
PrivateMixin,
+1
-1
packages/openapi-ts/src/ts-dsl/getter.ts
···
54
54
AbstractMixin,
55
55
DecoratorMixin,
56
56
DoMixin,
57
57
-
[DocMixin, { overrideRender: true }],
57
57
+
DocMixin,
58
58
ParamMixin,
59
59
PrivateMixin,
60
60
ProtectedMixin,
+10
-1
packages/openapi-ts/src/ts-dsl/index.ts
···
29
29
import { TemplateTsDsl } from './template';
30
30
import { TernaryTsDsl } from './ternary';
31
31
import { ThrowTsDsl } from './throw';
32
32
+
import { toExpr } from './toExpr';
33
33
+
import { toStmt } from './toStmt';
32
34
import { TypeAliasTsDsl } from './type/alias';
33
35
import { TypeAndTsDsl } from './type/and';
34
36
import { TypeAttrTsDsl } from './type/attr';
35
37
import { TypeExprTsDsl } from './type/expr';
38
38
+
import { TypeFuncTsDsl } from './type/func';
36
39
import { TypeIdxTsDsl } from './type/idx';
37
40
import { TypeLiteralTsDsl } from './type/literal';
38
41
import { TypeObjectTsDsl } from './type/object';
···
41
44
import { TypeQueryTsDsl } from './type/query';
42
45
import { TypeTupleTsDsl } from './type/tuple';
43
46
import { TypeOfExprTsDsl } from './typeof';
44
44
-
import { toExpr } from './utils';
45
47
import { VarTsDsl } from './var';
46
48
47
49
const base = {
···
199
201
/** Converts a runtime value into a corresponding expression node. */
200
202
toExpr: (...args: Parameters<typeof toExpr>) => toExpr(...args),
201
203
204
204
+
/** Converts a runtime value into a corresponding statement node. */
205
205
+
toStmt: (...args: Parameters<typeof toStmt>) => toStmt(...args),
206
206
+
202
207
/** Creates a basic type reference or type expression (e.g. Foo or Foo<T>). */
203
208
type: Object.assign(
204
209
(...args: ConstructorParameters<typeof TypeExprTsDsl>) =>
···
219
224
/** Creates a basic type reference or type expression (e.g. Foo or Foo<T>). */
220
225
expr: (...args: ConstructorParameters<typeof TypeExprTsDsl>) =>
221
226
new TypeExprTsDsl(...args),
227
227
+
228
228
+
/** Creates a function type node (e.g. `(a: string) => number`). */
229
229
+
func: (...args: ConstructorParameters<typeof TypeFuncTsDsl>) =>
230
230
+
new TypeFuncTsDsl(...args),
222
231
223
232
/** Creates an indexed-access type (e.g. `Foo<T>[K]`). */
224
233
idx: (...args: ConstructorParameters<typeof TypeIdxTsDsl>) =>
+1
-1
packages/openapi-ts/src/ts-dsl/init.ts
···
44
44
InitTsDsl,
45
45
DecoratorMixin,
46
46
DoMixin,
47
47
-
[DocMixin, { overrideRender: true }],
47
47
+
DocMixin,
48
48
ParamMixin,
49
49
PrivateMixin,
50
50
ProtectedMixin,
+6
packages/openapi-ts/src/ts-dsl/literal.ts
···
1
1
+
/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging, @typescript-eslint/no-empty-object-type */
1
2
import ts from 'typescript';
2
3
3
4
import { TsDsl } from './base';
5
5
+
import { mixin } from './mixins/apply';
6
6
+
import { AsMixin } from './mixins/as';
4
7
import { PrefixTsDsl } from './prefix';
5
8
6
9
export class LiteralTsDsl extends TsDsl<ts.LiteralTypeNode['literal']> {
···
28
31
throw new Error(`Unsupported literal: ${String(this.value)}`);
29
32
}
30
33
}
34
34
+
35
35
+
export interface LiteralTsDsl extends AsMixin {}
36
36
+
mixin(LiteralTsDsl, AsMixin);
+1
-1
packages/openapi-ts/src/ts-dsl/method.ts
···
71
71
AsyncMixin,
72
72
DecoratorMixin,
73
73
DoMixin,
74
74
-
[DocMixin, { overrideRender: true }],
74
74
+
DocMixin,
75
75
OptionalMixin,
76
76
ParamMixin,
77
77
PrivateMixin,
+5
-9
packages/openapi-ts/src/ts-dsl/mixins/apply.ts
···
1
1
/* eslint-disable @typescript-eslint/no-unsafe-function-type */
2
2
-
export function mixin(
3
3
-
target: Function,
4
4
-
...sources: ReadonlyArray<Function | [Function, { overrideRender?: boolean }]>
5
5
-
) {
2
2
+
export function mixin(target: Function, ...sources: ReadonlyArray<Function>) {
6
3
const targetProto = target.prototype;
7
4
for (const src of sources) {
8
8
-
const [source, options] = src instanceof Array ? src : [src];
9
9
-
let resolvedSource = source;
10
10
-
if (typeof source === 'function') {
5
5
+
let resolvedSource = src;
6
6
+
if (typeof src === 'function') {
11
7
try {
12
12
-
const candidate = source(target);
8
8
+
const candidate = src(target);
13
9
if (candidate?.prototype) {
14
10
resolvedSource = candidate;
15
11
}
···
23
19
Object.getOwnPropertyDescriptors(sourceProto),
24
20
)) {
25
21
if (key === 'constructor') continue;
26
26
-
if (key === '$render' && !options?.overrideRender) continue;
22
22
+
if (key === '$render' && !descriptor.value.mixin) continue;
27
23
Object.defineProperty(targetProto, key, descriptor);
28
24
}
29
25
}
+24
packages/openapi-ts/src/ts-dsl/mixins/as.ts
···
1
1
+
import type ts from 'typescript';
2
2
+
3
3
+
import type { AsTsDsl } from '../as';
4
4
+
import type { MaybeTsDsl, TypeTsDsl } from '../base';
5
5
+
6
6
+
type AsFactory = (
7
7
+
expr: string | MaybeTsDsl<ts.Expression>,
8
8
+
type: string | TypeTsDsl,
9
9
+
) => AsTsDsl;
10
10
+
let asFactory: AsFactory | undefined;
11
11
+
/** Registers the As DSL factory after its module has finished evaluating. */
12
12
+
export function registerLazyAccessAsFactory(factory: AsFactory): void {
13
13
+
asFactory = factory;
14
14
+
}
15
15
+
16
16
+
export class AsMixin {
17
17
+
/** Creates an `as` type assertion expression (e.g. `value as Type`). */
18
18
+
as(
19
19
+
this: string | MaybeTsDsl<ts.Expression>,
20
20
+
type: string | TypeTsDsl,
21
21
+
): AsTsDsl {
22
22
+
return asFactory!(this, type);
23
23
+
}
24
24
+
}
+10
-7
packages/openapi-ts/src/ts-dsl/mixins/doc.ts
···
4
4
export function DocMixin<
5
5
TBase extends new (...args: ReadonlyArray<any>) => ITsDsl,
6
6
>(Base: TBase) {
7
7
-
const Mixin = class extends Base {
7
7
+
const $renderBase = Base.prototype.$render;
8
8
+
9
9
+
class Mixin extends Base {
8
10
_doc?: DocTsDsl;
9
11
10
12
doc(lines?: MaybeArray<string>, fn?: (d: DocTsDsl) => void): this {
11
13
this._doc = new DocTsDsl(lines, fn);
12
14
return this;
13
15
}
14
14
-
};
15
16
16
16
-
const originalFn = Base.prototype.$render;
17
17
+
override $render(...args: Parameters<ITsDsl['$render']>) {
18
18
+
const node = $renderBase.apply(this, args);
19
19
+
return this._doc ? this._doc.apply(node) : node;
20
20
+
}
21
21
+
}
17
22
18
18
-
Mixin.prototype.$render = function (...args: Parameters<ITsDsl['$render']>) {
19
19
-
const node = originalFn.apply(this, args);
20
20
-
return this._doc ? this._doc.apply(node) : node;
21
21
-
};
23
23
+
// @ts-expect-error
24
24
+
Mixin.prototype.$render.mixin = true;
22
25
23
26
return Mixin;
24
27
}
+1
-25
packages/openapi-ts/src/ts-dsl/mixins/expr.ts
···
1
1
import type ts from 'typescript';
2
2
3
3
-
import type { AsTsDsl } from '../as';
4
3
import type { AttrTsDsl } from '../attr';
5
4
import type { AwaitTsDsl } from '../await';
6
6
-
import type { MaybeTsDsl, TypeTsDsl } from '../base';
5
5
+
import type { MaybeTsDsl } from '../base';
7
6
import type { CallTsDsl } from '../call';
8
7
import type { ReturnTsDsl } from '../return';
9
9
-
10
10
-
/**
11
11
-
* Lazily register factory callbacks to avoid circular imports and
12
12
-
* ensure predictable mixin application order.
13
13
-
*/
14
14
-
15
15
-
type AsFactory = (
16
16
-
expr: string | MaybeTsDsl<ts.Expression>,
17
17
-
type: string | TypeTsDsl,
18
18
-
) => AsTsDsl;
19
19
-
let asFactory: AsFactory | undefined;
20
20
-
/** Registers the As DSL factory after its module has finished evaluating. */
21
21
-
export function registerLazyAccessAsFactory(factory: AsFactory): void {
22
22
-
asFactory = factory;
23
23
-
}
24
8
25
9
type AttrFactory = (
26
10
expr: string | MaybeTsDsl<ts.Expression>,
···
57
41
}
58
42
59
43
export class ExprMixin {
60
60
-
/** Creates an `as` type assertion expression (e.g. `value as Type`). */
61
61
-
as(
62
62
-
this: string | MaybeTsDsl<ts.Expression>,
63
63
-
type: string | TypeTsDsl,
64
64
-
): AsTsDsl {
65
65
-
return asFactory!(this, type);
66
66
-
}
67
67
-
68
44
/** Accesses a property on the current expression (e.g. `this.foo`). */
69
45
attr(
70
46
this: string | MaybeTsDsl<ts.Expression>,
+10
-7
packages/openapi-ts/src/ts-dsl/mixins/hint.ts
···
4
4
export function HintMixin<
5
5
TBase extends new (...args: ReadonlyArray<any>) => ITsDsl,
6
6
>(Base: TBase) {
7
7
-
const Mixin = class extends Base {
7
7
+
const $renderBase = Base.prototype.$render;
8
8
+
9
9
+
class Mixin extends Base {
8
10
_hint?: HintTsDsl;
9
11
10
12
hint(lines?: MaybeArray<string>, fn?: (h: HintTsDsl) => void): this {
11
13
this._hint = new HintTsDsl(lines, fn);
12
14
return this;
13
15
}
14
14
-
};
15
16
16
16
-
const originalFn = Base.prototype.$render;
17
17
+
override $render(...args: Parameters<ITsDsl['$render']>) {
18
18
+
const node = $renderBase.apply(this, args);
19
19
+
return this._hint ? this._hint.apply(node) : node;
20
20
+
}
21
21
+
}
17
22
18
18
-
Mixin.prototype.$render = function (...args: Parameters<ITsDsl['$render']>) {
19
19
-
const node = originalFn.apply(this, args);
20
20
-
return this._hint ? this._hint.apply(node) : node;
21
21
-
};
23
23
+
// @ts-expect-error
24
24
+
Mixin.prototype.$render.mixin = true;
22
25
23
26
return Mixin;
24
27
}
+10
-7
packages/openapi-ts/src/ts-dsl/mixins/note.ts
···
4
4
export function NoteMixin<
5
5
TBase extends new (...args: ReadonlyArray<any>) => ITsDsl,
6
6
>(Base: TBase) {
7
7
-
const Mixin = class extends Base {
7
7
+
const $renderBase = Base.prototype.$render;
8
8
+
9
9
+
class Mixin extends Base {
8
10
_note?: NoteTsDsl;
9
11
10
12
note(lines?: MaybeArray<string>, fn?: (h: NoteTsDsl) => void): this {
11
13
this._note = new NoteTsDsl(lines, fn);
12
14
return this;
13
15
}
14
14
-
};
15
16
16
16
-
const originalFn = Base.prototype.$render;
17
17
+
override $render(...args: Parameters<ITsDsl['$render']>) {
18
18
+
const node = $renderBase.apply(this, args);
19
19
+
return this._note ? this._note.apply(node) : node;
20
20
+
}
21
21
+
}
17
22
18
18
-
Mixin.prototype.$render = function (...args: Parameters<ITsDsl['$render']>) {
19
19
-
const node = originalFn.apply(this, args);
20
20
-
return this._note ? this._note.apply(node) : node;
21
21
-
};
23
23
+
// @ts-expect-error
24
24
+
Mixin.prototype.$render.mixin = true;
22
25
23
26
return Mixin;
24
27
}
-5
packages/openapi-ts/src/ts-dsl/mixins/type-expr.ts
···
5
5
import type { TypeQueryTsDsl } from '../type/query';
6
6
import type { TypeOfExprTsDsl } from '../typeof';
7
7
8
8
-
/**
9
9
-
* Lazily register factory callbacks to avoid circular imports and
10
10
-
* ensure predictable mixin application order.
11
11
-
*/
12
12
-
13
8
type TypeExprFactory = (
14
9
nameOrFn?: string | ((t: TypeExprTsDsl) => void),
15
10
fn?: (t: TypeExprTsDsl) => void,
+7
-7
packages/openapi-ts/src/ts-dsl/object.ts
···
7
7
import { TsDsl } from './base';
8
8
import { GetterTsDsl } from './getter';
9
9
import { mixin } from './mixins/apply';
10
10
+
import { AsMixin } from './mixins/as';
10
11
import { ExprMixin } from './mixins/expr';
11
12
import { HintMixin } from './mixins/hint';
12
13
import { LayoutMixin } from './mixins/layout';
···
143
144
}
144
145
}
145
146
146
146
-
export interface ObjectTsDsl extends ExprMixin, HintMixin, LayoutMixin {}
147
147
-
mixin(
148
148
-
ObjectTsDsl,
149
149
-
ExprMixin,
150
150
-
[HintMixin, { overrideRender: true }],
151
151
-
LayoutMixin,
152
152
-
);
147
147
+
export interface ObjectTsDsl
148
148
+
extends AsMixin,
149
149
+
ExprMixin,
150
150
+
HintMixin,
151
151
+
LayoutMixin {}
152
152
+
mixin(ObjectTsDsl, AsMixin, ExprMixin, HintMixin, LayoutMixin);
+1
-1
packages/openapi-ts/src/ts-dsl/setter.ts
···
53
53
AbstractMixin,
54
54
DecoratorMixin,
55
55
DoMixin,
56
56
-
[DocMixin, { overrideRender: true }],
56
56
+
DocMixin,
57
57
ParamMixin,
58
58
PrivateMixin,
59
59
ProtectedMixin,
+4
packages/openapi-ts/src/ts-dsl/toStmt.ts
···
1
1
+
import ts from 'typescript';
2
2
+
3
3
+
export const toStmt = (value: ts.Expression | ts.Statement): ts.Statement =>
4
4
+
ts.isExpression(value) ? ts.factory.createExpressionStatement(value) : value;
+33
packages/openapi-ts/src/ts-dsl/type/func.ts
···
1
1
+
/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */
2
2
+
import ts from 'typescript';
3
3
+
4
4
+
import { TypeTsDsl } from '../base';
5
5
+
import { mixin } from '../mixins/apply';
6
6
+
import { DocMixin } from '../mixins/doc';
7
7
+
import { ParamMixin } from '../mixins/param';
8
8
+
import { TypeParamsMixin } from '../mixins/type-params';
9
9
+
import { TypeExprTsDsl } from './expr';
10
10
+
11
11
+
export class TypeFuncTsDsl extends TypeTsDsl<ts.FunctionTypeNode> {
12
12
+
private _returns?: TypeTsDsl;
13
13
+
14
14
+
/** Sets the return type. */
15
15
+
returns(type: string | TypeTsDsl): this {
16
16
+
this._returns = type instanceof TypeTsDsl ? type : new TypeExprTsDsl(type);
17
17
+
return this;
18
18
+
}
19
19
+
20
20
+
$render(): ts.FunctionTypeNode {
21
21
+
if (this._returns === undefined) {
22
22
+
throw new Error('Missing return type in function type DSL');
23
23
+
}
24
24
+
return ts.factory.createFunctionTypeNode(
25
25
+
this.$generics(),
26
26
+
this.$params(),
27
27
+
this.$type(this._returns),
28
28
+
);
29
29
+
}
30
30
+
}
31
31
+
32
32
+
export interface TypeFuncTsDsl extends DocMixin, ParamMixin, TypeParamsMixin {}
33
33
+
mixin(TypeFuncTsDsl, DocMixin, ParamMixin, TypeParamsMixin);
+1
-1
packages/openapi-ts/src/ts-dsl/type/object.ts
···
63
63
}
64
64
65
65
interface TypePropTsDsl extends DocMixin, OptionalMixin {}
66
66
-
mixin(TypePropTsDsl, [DocMixin, { overrideRender: true }], OptionalMixin);
66
66
+
mixin(TypePropTsDsl, DocMixin, OptionalMixin);
+11
-3
packages/openapi-ts/src/ts-dsl/utils.ts
packages/openapi-ts/src/ts-dsl/toExpr.ts
···
5
5
import { LiteralTsDsl } from './literal';
6
6
import { ObjectTsDsl } from './object';
7
7
8
8
-
export const toExpr = (value: unknown): TsDsl<ts.Expression> | undefined => {
8
8
+
export const toExpr = (
9
9
+
value: unknown,
10
10
+
options?: {
11
11
+
layout?: 'pretty';
12
12
+
},
13
13
+
): TsDsl<ts.Expression> | undefined => {
9
14
if (value instanceof TsDsl) {
10
15
return value;
11
16
}
···
23
28
}
24
29
25
30
if (value instanceof Array) {
26
26
-
return new ArrayTsDsl(...value.map((v) => toExpr(v) ?? v));
31
31
+
const arr = new ArrayTsDsl(...value.map((v) => toExpr(v, options) ?? v));
32
32
+
if (options?.layout === 'pretty') arr.pretty();
33
33
+
return arr;
27
34
}
28
35
29
36
if (typeof value === 'object') {
30
37
const obj = new ObjectTsDsl();
31
38
for (const [key, val] of Object.entries(value)) {
32
32
-
const expr = toExpr(val);
39
39
+
const expr = toExpr(val, options);
33
40
if (expr) obj.prop(key, expr);
34
41
}
42
42
+
if (options?.layout === 'pretty') obj.pretty();
35
43
return obj;
36
44
}
37
45
+2
-2
packages/openapi-ts/src/ts-dsl/var.ts
···
77
77
mixin(
78
78
VarTsDsl,
79
79
DefaultMixin,
80
80
-
[DocMixin, { overrideRender: true }],
80
80
+
DocMixin,
81
81
ExportMixin,
82
82
-
[HintMixin, { overrideRender: true }],
82
82
+
HintMixin,
83
83
PatternMixin,
84
84
ValueMixin,
85
85
);