@orpc/openapi 2.0.0-beta.49 → 2.0.0-beta.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/aws-lambda/index.d.ts +3 -15
- package/dist/adapters/aws-lambda/index.js +1 -1
- package/dist/adapters/aws-lambda/openapi-handler.d.ts +8 -9
- package/dist/adapters/aws-lambda/openapi-handler.js +19 -17
- package/dist/adapters/fastify/index.d.ts +2 -1
- package/dist/adapters/fastify/index.js +1 -1
- package/dist/adapters/fastify/openapi-handler.d.ts +8 -9
- package/dist/adapters/fastify/openapi-handler.js +16 -14
- package/dist/adapters/fetch/index.d.ts +3 -2
- package/dist/adapters/fetch/index.js +2 -2
- package/dist/adapters/fetch/openapi-handler.d.ts +8 -9
- package/dist/adapters/fetch/openapi-handler.js +16 -14
- package/dist/adapters/fetch/openapi-link.d.ts +9 -10
- package/dist/adapters/fetch/openapi-link.js +21 -19
- package/dist/adapters/node/index.d.ts +2 -1
- package/dist/adapters/node/index.js +1 -1
- package/dist/adapters/node/openapi-handler.d.ts +8 -9
- package/dist/adapters/node/openapi-handler.js +16 -14
- package/dist/adapters/standard/index.d.ts +4 -3
- package/dist/adapters/standard/index.js +3 -3
- package/dist/adapters/standard/openapi-handler-codec.d.ts +56 -57
- package/dist/adapters/standard/openapi-handler-codec.js +143 -205
- package/dist/adapters/standard/openapi-link-codec.d.ts +55 -59
- package/dist/adapters/standard/openapi-link-codec.js +262 -377
- package/dist/adapters/standard/openapi-matcher.d.ts +26 -26
- package/dist/adapters/standard/openapi-matcher.js +78 -108
- package/dist/adapters/standard/utils.js +28 -44
- package/dist/bracket-notation.d.ts +22 -22
- package/dist/bracket-notation.js +123 -173
- package/dist/client-factory.d.ts +12 -12
- package/dist/client-factory.js +13 -11
- package/dist/constants.d.ts +1 -4
- package/dist/constants.js +5 -4
- package/dist/extensions/route.d.ts +36 -36
- package/dist/extensions/route.js +7 -6
- package/dist/helpers/form-data.d.ts +1 -1
- package/dist/helpers/form-data.js +74 -86
- package/dist/helpers/index.d.ts +2 -1
- package/dist/helpers/index.js +1 -1
- package/dist/index.d.ts +15 -13
- package/dist/index.js +11 -11
- package/dist/meta.d.ts +298 -298
- package/dist/meta.js +54 -72
- package/dist/openapi-generator-components.d.ts +2 -31
- package/dist/openapi-generator-components.js +200 -248
- package/dist/openapi-generator-operation.d.ts +12 -33
- package/dist/openapi-generator-operation.js +369 -437
- package/dist/openapi-generator.d.ts +75 -80
- package/dist/openapi-generator.js +114 -142
- package/dist/openapi-json-serializer.d.ts +65 -65
- package/dist/openapi-json-serializer.js +218 -257
- package/dist/openapi-serializer.d.ts +31 -32
- package/dist/openapi-serializer.js +68 -92
- package/dist/plugins/index.d.ts +2 -1
- package/dist/plugins/index.js +1 -1
- package/dist/plugins/openapi-reference.d.ts +99 -102
- package/dist/plugins/openapi-reference.js +109 -132
- package/dist/router-utils.d.ts +7 -10
- package/dist/router-utils.js +30 -34
- package/dist/types.d.ts +8 -12
- package/dist/utils.d.ts +5 -10
- package/dist/utils.js +39 -42
- package/package.json +12 -12
- package/dist/adapters/standard/utils.d.ts +0 -4
- package/dist/types.js +0 -1
|
@@ -1,260 +1,221 @@
|
|
|
1
|
-
import { copyOnWrite, isPlainObject
|
|
1
|
+
import { NullProtoObj, copyOnWrite, isPlainObject } from "@orpc/shared";
|
|
2
|
+
// src/openapi-json-serializer.ts
|
|
2
3
|
const DEFAULT_OPEN_API_JSON_SERIALIZER_HANDLERS = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
},
|
|
75
|
-
},
|
|
4
|
+
undefined: {
|
|
5
|
+
condition(data) {
|
|
6
|
+
return data === void 0;
|
|
7
|
+
},
|
|
8
|
+
serialize() {
|
|
9
|
+
return null;
|
|
10
|
+
},
|
|
11
|
+
isTerminal: true
|
|
12
|
+
},
|
|
13
|
+
bigint: {
|
|
14
|
+
condition(data) {
|
|
15
|
+
return typeof data === "bigint";
|
|
16
|
+
},
|
|
17
|
+
serialize(data) {
|
|
18
|
+
return data.toString();
|
|
19
|
+
},
|
|
20
|
+
isTerminal: true
|
|
21
|
+
},
|
|
22
|
+
date: {
|
|
23
|
+
condition(data) {
|
|
24
|
+
return data instanceof Date;
|
|
25
|
+
},
|
|
26
|
+
serialize(data) {
|
|
27
|
+
if (Number.isNaN(data.getTime())) return null;
|
|
28
|
+
return data.toISOString();
|
|
29
|
+
},
|
|
30
|
+
isTerminal: true
|
|
31
|
+
},
|
|
32
|
+
nan: {
|
|
33
|
+
condition(data) {
|
|
34
|
+
return typeof data === "number" && Number.isNaN(data);
|
|
35
|
+
},
|
|
36
|
+
serialize() {
|
|
37
|
+
return null;
|
|
38
|
+
},
|
|
39
|
+
isTerminal: true
|
|
40
|
+
},
|
|
41
|
+
infinity: {
|
|
42
|
+
condition(data) {
|
|
43
|
+
return data === Number.POSITIVE_INFINITY || data === Number.NEGATIVE_INFINITY;
|
|
44
|
+
},
|
|
45
|
+
serialize() {
|
|
46
|
+
return null;
|
|
47
|
+
},
|
|
48
|
+
isTerminal: true
|
|
49
|
+
},
|
|
50
|
+
url: {
|
|
51
|
+
condition(data) {
|
|
52
|
+
return data instanceof URL;
|
|
53
|
+
},
|
|
54
|
+
serialize(data) {
|
|
55
|
+
return data.toString();
|
|
56
|
+
},
|
|
57
|
+
isTerminal: true
|
|
58
|
+
},
|
|
59
|
+
set: {
|
|
60
|
+
condition(data) {
|
|
61
|
+
return data instanceof Set;
|
|
62
|
+
},
|
|
63
|
+
serialize(data) {
|
|
64
|
+
return Array.from(data);
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
map: {
|
|
68
|
+
condition(data) {
|
|
69
|
+
return data instanceof Map;
|
|
70
|
+
},
|
|
71
|
+
serialize(data) {
|
|
72
|
+
return Array.from(data.entries());
|
|
73
|
+
}
|
|
74
|
+
}
|
|
76
75
|
};
|
|
77
76
|
/**
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
}
|
|
224
|
-
if (v === undefined) {
|
|
225
|
-
continue;
|
|
226
|
-
}
|
|
227
|
-
segments.push(k);
|
|
228
|
-
json[k] = this.serializeValue(v, segments, maps, blobs);
|
|
229
|
-
segments.pop();
|
|
230
|
-
}
|
|
231
|
-
return json;
|
|
232
|
-
}
|
|
233
|
-
return data;
|
|
234
|
-
}
|
|
235
|
-
deserializeJson(serialized) {
|
|
236
|
-
const ref = { json: serialized.json };
|
|
237
|
-
if (serialized.blobs?.length) {
|
|
238
|
-
for (let i = 0; i < serialized.maps.length; i++) {
|
|
239
|
-
const blob = serialized.blobs[i];
|
|
240
|
-
if (!(blob instanceof Blob)) {
|
|
241
|
-
throw new TypeError(`Invalid OpenAPI serialized data: blob ${i} is not a Blob.`);
|
|
242
|
-
}
|
|
243
|
-
const segments = serialized.maps[i];
|
|
244
|
-
let original = serialized;
|
|
245
|
-
let currentRef = ref;
|
|
246
|
-
let preSegment = 'json';
|
|
247
|
-
for (let j = 0; j < segments.length; j++) {
|
|
248
|
-
original = original[preSegment];
|
|
249
|
-
currentRef = copyOnWrite(currentRef, preSegment, original);
|
|
250
|
-
preSegment = segments[j];
|
|
251
|
-
if (!Object.hasOwn(currentRef, preSegment)) {
|
|
252
|
-
throw new TypeError(`Invalid OpenAPI serialized data: segment "${preSegment}" does not exist.`);
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
currentRef[preSegment] = blob;
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
return ref.json;
|
|
259
|
-
}
|
|
260
|
-
}
|
|
77
|
+
* The JSON layer behind `OpenAPISerializer`: one-way serialization of types like `Date`, `BigInt`,
|
|
78
|
+
* and `Set` into JSON-friendly values, for places that only accept JSON.
|
|
79
|
+
*
|
|
80
|
+
* @see {@link https://orpc.dev/docs/openapi/serializer#openapi-json-serializer | OpenAPI Serializer - OpenAPI JSON Serializer}
|
|
81
|
+
*/
|
|
82
|
+
var OpenAPIJsonSerializer = class {
|
|
83
|
+
inlineBuiltInHandlers;
|
|
84
|
+
handlerEntries;
|
|
85
|
+
constructor(options = {}) {
|
|
86
|
+
const customHandlers = options.handlers;
|
|
87
|
+
if (customHandlers === void 0) {
|
|
88
|
+
this.inlineBuiltInHandlers = true;
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
let inlineBuiltInHandlers = true;
|
|
92
|
+
let handlerEntries = [];
|
|
93
|
+
for (const key of Object.keys(customHandlers)) {
|
|
94
|
+
const handler = customHandlers[key];
|
|
95
|
+
if (inlineBuiltInHandlers && key in DEFAULT_OPEN_API_JSON_SERIALIZER_HANDLERS) {
|
|
96
|
+
inlineBuiltInHandlers = false;
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
if (handler !== void 0) handlerEntries.push(handler);
|
|
100
|
+
}
|
|
101
|
+
if (!inlineBuiltInHandlers) {
|
|
102
|
+
handlerEntries = [];
|
|
103
|
+
for (const handler of Object.values({
|
|
104
|
+
...DEFAULT_OPEN_API_JSON_SERIALIZER_HANDLERS,
|
|
105
|
+
...customHandlers
|
|
106
|
+
})) if (handler !== void 0) handlerEntries.push(handler);
|
|
107
|
+
}
|
|
108
|
+
this.inlineBuiltInHandlers = inlineBuiltInHandlers;
|
|
109
|
+
this.handlerEntries = handlerEntries.length === 0 ? void 0 : handlerEntries;
|
|
110
|
+
}
|
|
111
|
+
serializeJson(data) {
|
|
112
|
+
const maps = [];
|
|
113
|
+
const blobs = [];
|
|
114
|
+
return {
|
|
115
|
+
json: this.serializeValue(data, [], maps, blobs),
|
|
116
|
+
maps,
|
|
117
|
+
blobs
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* `segments` is a shared mutable stack (push/pop while walking),
|
|
122
|
+
* so it must be copied before being stored in `maps`.
|
|
123
|
+
*/
|
|
124
|
+
serializeValue(data, segments, maps, blobs) {
|
|
125
|
+
const handlerEntries = this.handlerEntries;
|
|
126
|
+
/**
|
|
127
|
+
* Inlined version of DEFAULT_OPEN_API_JSON_SERIALIZER_HANDLERS: primitives
|
|
128
|
+
* are dispatched on typeof and skip every handler condition check.
|
|
129
|
+
* Must match the built-in handlers exactly.
|
|
130
|
+
* Primitives without a built-in handler return early unless custom handlers must see them.
|
|
131
|
+
*/
|
|
132
|
+
if (this.inlineBuiltInHandlers) switch (typeof data) {
|
|
133
|
+
case "string":
|
|
134
|
+
case "boolean":
|
|
135
|
+
if (handlerEntries === void 0) return data;
|
|
136
|
+
break;
|
|
137
|
+
case "number":
|
|
138
|
+
if (!Number.isFinite(data)) return null;
|
|
139
|
+
if (handlerEntries === void 0) return data;
|
|
140
|
+
break;
|
|
141
|
+
case "undefined": return null;
|
|
142
|
+
case "bigint": return data.toString();
|
|
143
|
+
case "object":
|
|
144
|
+
if (data === null) {
|
|
145
|
+
if (handlerEntries === void 0) return data;
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
if (data instanceof Date) return Number.isNaN(data.getTime()) ? null : data.toISOString();
|
|
149
|
+
if (data instanceof URL) return data.toString();
|
|
150
|
+
if (data instanceof Set) return this.serializeValue(Array.from(data), segments, maps, blobs);
|
|
151
|
+
if (data instanceof Map) return this.serializeValue(Array.from(data.entries()), segments, maps, blobs);
|
|
152
|
+
}
|
|
153
|
+
if (handlerEntries) for (let i = 0; i < handlerEntries.length; i++) {
|
|
154
|
+
const handler = handlerEntries[i];
|
|
155
|
+
if (handler.condition(data)) {
|
|
156
|
+
const serialized = handler.serialize(data);
|
|
157
|
+
if (handler.isTerminal) {
|
|
158
|
+
if (serialized instanceof Blob) {
|
|
159
|
+
maps.push(segments.slice());
|
|
160
|
+
blobs.push(serialized);
|
|
161
|
+
}
|
|
162
|
+
return serialized;
|
|
163
|
+
}
|
|
164
|
+
return this.serializeValue(serialized, segments, maps, blobs);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
if (typeof data !== "object" || data === null) return data;
|
|
168
|
+
if (data instanceof Blob) {
|
|
169
|
+
maps.push(segments.slice());
|
|
170
|
+
blobs.push(data);
|
|
171
|
+
return data;
|
|
172
|
+
}
|
|
173
|
+
if (Array.isArray(data)) {
|
|
174
|
+
const json = [];
|
|
175
|
+
for (let i = 0; i < data.length; i++) {
|
|
176
|
+
segments.push(i);
|
|
177
|
+
json.push(this.serializeValue(data[i], segments, maps, blobs));
|
|
178
|
+
segments.pop();
|
|
179
|
+
}
|
|
180
|
+
return json;
|
|
181
|
+
}
|
|
182
|
+
if (isPlainObject(data)) {
|
|
183
|
+
const json = new NullProtoObj();
|
|
184
|
+
for (const k of Object.keys(data)) {
|
|
185
|
+
const v = data[k];
|
|
186
|
+
/**
|
|
187
|
+
* Skip custom toJSON methods to avoid JSON.stringify invoking them,
|
|
188
|
+
* which could cause meta and serialized data mismatches during deserialization.
|
|
189
|
+
* Instead, rely on custom handlers.
|
|
190
|
+
*/
|
|
191
|
+
if (k === "toJSON" && typeof v === "function") continue;
|
|
192
|
+
if (v === void 0) continue;
|
|
193
|
+
segments.push(k);
|
|
194
|
+
json[k] = this.serializeValue(v, segments, maps, blobs);
|
|
195
|
+
segments.pop();
|
|
196
|
+
}
|
|
197
|
+
return json;
|
|
198
|
+
}
|
|
199
|
+
return data;
|
|
200
|
+
}
|
|
201
|
+
deserializeJson(serialized) {
|
|
202
|
+
const ref = { json: serialized.json };
|
|
203
|
+
if (serialized.blobs?.length) for (let i = 0; i < serialized.maps.length; i++) {
|
|
204
|
+
const blob = serialized.blobs[i];
|
|
205
|
+
if (!(blob instanceof Blob)) throw new TypeError(`Invalid OpenAPI serialized data: blob ${i} is not a Blob.`);
|
|
206
|
+
const segments = serialized.maps[i];
|
|
207
|
+
let original = serialized;
|
|
208
|
+
let currentRef = ref;
|
|
209
|
+
let preSegment = "json";
|
|
210
|
+
for (let j = 0; j < segments.length; j++) {
|
|
211
|
+
original = original[preSegment];
|
|
212
|
+
currentRef = copyOnWrite(currentRef, preSegment, original);
|
|
213
|
+
preSegment = segments[j];
|
|
214
|
+
if (!Object.hasOwn(currentRef, preSegment)) throw new TypeError(`Invalid OpenAPI serialized data: segment "${preSegment}" does not exist.`);
|
|
215
|
+
}
|
|
216
|
+
currentRef[preSegment] = blob;
|
|
217
|
+
}
|
|
218
|
+
return ref.json;
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
export { OpenAPIJsonSerializer };
|
|
@@ -1,31 +1,30 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { OpenAPIJsonSerializer } from './openapi-json-serializer.ts';
|
|
1
|
+
import { BracketNotationSerializerOptions } from "./bracket-notation.js";
|
|
2
|
+
import { OpenAPIJsonSerializer, OpenAPIJsonSerializerOptions } from "./openapi-json-serializer.js";
|
|
3
|
+
import { StandardBody } from "@standard-server/core";
|
|
5
4
|
export interface OpenAPISerializerSerializeOptions {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Use FormData for serialization when nested blobs are present.
|
|
7
|
+
* Does not apply to root-level Blob values.
|
|
8
|
+
*
|
|
9
|
+
* @default true
|
|
10
|
+
*/
|
|
11
|
+
useFormDataForBlobFields?: boolean | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* When enabled, the serialized output is always returned as a FormData instance using bracket notation.
|
|
14
|
+
*
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
17
|
+
asFormData?: boolean | undefined;
|
|
19
18
|
}
|
|
20
19
|
export interface OpenAPISerializerOptions extends OpenAPIJsonSerializerOptions {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Options for bracket notation serializer, like maxDeserializingEmptySlots
|
|
22
|
+
*/
|
|
23
|
+
bracketNotation?: BracketNotationSerializerOptions | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Default options for serialize method
|
|
26
|
+
*/
|
|
27
|
+
serialize?: OpenAPISerializerSerializeOptions | undefined;
|
|
29
28
|
}
|
|
30
29
|
/**
|
|
31
30
|
* Handles one-way serialization of oRPC payloads into JSON-friendly formats,
|
|
@@ -34,10 +33,10 @@ export interface OpenAPISerializerOptions extends OpenAPIJsonSerializerOptions {
|
|
|
34
33
|
* @see {@link https://orpc.dev/docs/openapi/serializer | OpenAPI Serializer}
|
|
35
34
|
*/
|
|
36
35
|
export declare class OpenAPISerializer extends OpenAPIJsonSerializer {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
36
|
+
private readonly bracketNotation;
|
|
37
|
+
private readonly defaultSerializeOptions;
|
|
38
|
+
constructor({ bracketNotation, serialize, ...options }?: OpenAPISerializerOptions);
|
|
39
|
+
serialize(data: unknown, options?: OpenAPISerializerSerializeOptions): StandardBody;
|
|
40
|
+
private serializePayload;
|
|
41
|
+
deserialize(data: StandardBody): unknown;
|
|
42
|
+
}
|