@shipworthy/openapi-parser 0.0.0-stage → 0.0.2
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/LICENSE +21 -0
- package/README.md +364 -2
- package/dist/bundle.d.ts +973 -0
- package/dist/bundle.js +11 -0
- package/dist/codec.d.ts +2188 -0
- package/dist/codec.js +42 -0
- package/dist/document.d.ts +9 -0
- package/dist/document.js +28 -0
- package/dist/errors.d.ts +105 -0
- package/dist/errors.js +162 -0
- package/dist/hoist.d.ts +10 -0
- package/dist/hoist.js +444 -0
- package/dist/http.d.ts +2 -0
- package/dist/http.js +163 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2 -0
- package/dist/load.d.ts +17 -0
- package/dist/load.js +128 -0
- package/dist/loader.d.ts +11 -0
- package/dist/loader.js +89 -0
- package/dist/parsers.d.ts +5 -0
- package/dist/parsers.js +90 -0
- package/dist/pipeline.d.ts +3 -0
- package/dist/pipeline.js +433 -0
- package/dist/plugins.d.ts +95 -0
- package/dist/plugins.js +61 -0
- package/dist/pointer.d.ts +7 -0
- package/dist/pointer.js +80 -0
- package/dist/run.d.ts +17 -0
- package/dist/run.js +313 -0
- package/dist/schemas/3.1/callback.d.ts +205 -0
- package/dist/schemas/3.1/callback.js +4 -0
- package/dist/schemas/3.1/components.d.ts +801 -0
- package/dist/schemas/3.1/components.js +25 -0
- package/dist/schemas/3.1/contact.d.ts +7 -0
- package/dist/schemas/3.1/contact.js +7 -0
- package/dist/schemas/3.1/document.d.ts +1093 -0
- package/dist/schemas/3.1/document.js +25 -0
- package/dist/schemas/3.1/encoding.d.ts +14 -0
- package/dist/schemas/3.1/encoding.js +11 -0
- package/dist/schemas/3.1/example.d.ts +8 -0
- package/dist/schemas/3.1/example.js +10 -0
- package/dist/schemas/3.1/external-docs.d.ts +6 -0
- package/dist/schemas/3.1/external-docs.js +6 -0
- package/dist/schemas/3.1/header.d.ts +194 -0
- package/dist/schemas/3.1/header.js +29 -0
- package/dist/schemas/3.1/http-method.d.ts +4 -0
- package/dist/schemas/3.1/http-method.js +12 -0
- package/dist/schemas/3.1/index.d.ts +29 -0
- package/dist/schemas/3.1/index.js +29 -0
- package/dist/schemas/3.1/info.d.ts +19 -0
- package/dist/schemas/3.1/info.js +13 -0
- package/dist/schemas/3.1/license.d.ts +7 -0
- package/dist/schemas/3.1/license.js +9 -0
- package/dist/schemas/3.1/link.d.ts +18 -0
- package/dist/schemas/3.1/link.js +13 -0
- package/dist/schemas/3.1/media-type.d.ts +27 -0
- package/dist/schemas/3.1/media-type.js +14 -0
- package/dist/schemas/3.1/oauth-flow.d.ts +8 -0
- package/dist/schemas/3.1/oauth-flow.js +8 -0
- package/dist/schemas/3.1/oauth-flows.d.ts +28 -0
- package/dist/schemas/3.1/oauth-flows.js +13 -0
- package/dist/schemas/3.1/object.d.ts +5 -0
- package/dist/schemas/3.1/object.js +17 -0
- package/dist/schemas/3.1/operation.d.ts +1040 -0
- package/dist/schemas/3.1/operation.js +25 -0
- package/dist/schemas/3.1/parameter.d.ts +101 -0
- package/dist/schemas/3.1/parameter.js +33 -0
- package/dist/schemas/3.1/path-item.d.ts +127 -0
- package/dist/schemas/3.1/path-item.js +22 -0
- package/dist/schemas/3.1/paths.d.ts +126 -0
- package/dist/schemas/3.1/paths.js +4 -0
- package/dist/schemas/3.1/reference.d.ts +13 -0
- package/dist/schemas/3.1/reference.js +11 -0
- package/dist/schemas/3.1/request-body.d.ts +31 -0
- package/dist/schemas/3.1/request-body.js +8 -0
- package/dist/schemas/3.1/response.d.ts +149 -0
- package/dist/schemas/3.1/response.js +12 -0
- package/dist/schemas/3.1/responses.d.ts +152 -0
- package/dist/schemas/3.1/responses.js +7 -0
- package/dist/schemas/3.1/schema.d.ts +4 -0
- package/dist/schemas/3.1/schema.js +6 -0
- package/dist/schemas/3.1/security-requirement.d.ts +3 -0
- package/dist/schemas/3.1/security-requirement.js +2 -0
- package/dist/schemas/3.1/security-scheme.d.ts +49 -0
- package/dist/schemas/3.1/security-scheme.js +25 -0
- package/dist/schemas/3.1/server-variable.d.ts +7 -0
- package/dist/schemas/3.1/server-variable.js +7 -0
- package/dist/schemas/3.1/server.d.ts +11 -0
- package/dist/schemas/3.1/server.js +8 -0
- package/dist/schemas/3.1/tag.d.ts +10 -0
- package/dist/schemas/3.1/tag.js +8 -0
- package/dist/upgraders/3.0-to-3.1.d.ts +9 -0
- package/dist/upgraders/3.0-to-3.1.js +310 -0
- package/dist/url.d.ts +29 -0
- package/dist/url.js +255 -0
- package/dist/yaml.d.ts +6 -0
- package/dist/yaml.js +235 -0
- package/package.json +47 -4
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { OpenApiComponents } from "./components.js";
|
|
3
|
+
import { OpenApiExternalDocs } from "./external-docs.js";
|
|
4
|
+
import { OpenApiInfo } from "./info.js";
|
|
5
|
+
import { openApiObject } from "./object.js";
|
|
6
|
+
import { OpenApiPathItem } from "./path-item.js";
|
|
7
|
+
import { OpenApiPaths } from "./paths.js";
|
|
8
|
+
import { OpenApiSchema } from "./schema.js";
|
|
9
|
+
import { OpenApiSecurityRequirement } from "./security-requirement.js";
|
|
10
|
+
import { OpenApiServer } from "./server.js";
|
|
11
|
+
import { OpenApiTag } from "./tag.js";
|
|
12
|
+
/** The OpenAPI 3.1 document produced after bundling and upgrading. */
|
|
13
|
+
export const ParsedOpenApi = openApiObject({
|
|
14
|
+
openapi: Schema.String.check(Schema.isPattern(/^3\.1\.\d+(?:[-+].*)?$/)),
|
|
15
|
+
info: OpenApiInfo,
|
|
16
|
+
jsonSchemaDialect: Schema.optionalKey(Schema.String),
|
|
17
|
+
servers: Schema.optionalKey(Schema.Array(OpenApiServer)),
|
|
18
|
+
paths: Schema.optionalKey(OpenApiPaths),
|
|
19
|
+
webhooks: Schema.optionalKey(Schema.Record(Schema.String, OpenApiPathItem)),
|
|
20
|
+
components: Schema.optionalKey(OpenApiComponents),
|
|
21
|
+
security: Schema.optionalKey(Schema.Array(OpenApiSecurityRequirement)),
|
|
22
|
+
tags: Schema.optionalKey(Schema.Array(OpenApiTag)),
|
|
23
|
+
externalDocs: Schema.optionalKey(OpenApiExternalDocs),
|
|
24
|
+
$defs: Schema.optionalKey(Schema.Record(Schema.String, OpenApiSchema)),
|
|
25
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { OpenApiHeader } from "./header.ts";
|
|
3
|
+
export declare const OpenApiEncoding: Schema.StructWithRest<Schema.Struct<{
|
|
4
|
+
readonly contentType: Schema.optionalKey<Schema.String>;
|
|
5
|
+
readonly headers: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.StructWithRest<Schema.Struct<{
|
|
6
|
+
readonly $ref: Schema.String;
|
|
7
|
+
readonly summary: Schema.optionalKey<Schema.String>;
|
|
8
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
9
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>, Schema.suspend<Schema.Codec<OpenApiHeader, OpenApiHeader, never, never>>]>>>;
|
|
10
|
+
readonly style: Schema.optionalKey<Schema.Literals<readonly ["form", "spaceDelimited", "pipeDelimited", "deepObject"]>>;
|
|
11
|
+
readonly explode: Schema.optionalKey<Schema.Boolean>;
|
|
12
|
+
readonly allowReserved: Schema.optionalKey<Schema.Boolean>;
|
|
13
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>;
|
|
14
|
+
export type OpenApiEncoding = typeof OpenApiEncoding.Type;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { OpenApiHeader } from "./header.js";
|
|
3
|
+
import { openApiObject } from "./object.js";
|
|
4
|
+
import { withReference } from "./reference.js";
|
|
5
|
+
export const OpenApiEncoding = openApiObject({
|
|
6
|
+
contentType: Schema.optionalKey(Schema.String),
|
|
7
|
+
headers: Schema.optionalKey(Schema.Record(Schema.String, withReference(Schema.suspend(() => OpenApiHeader)))),
|
|
8
|
+
style: Schema.optionalKey(Schema.Literals(["form", "spaceDelimited", "pipeDelimited", "deepObject"])),
|
|
9
|
+
explode: Schema.optionalKey(Schema.Boolean),
|
|
10
|
+
allowReserved: Schema.optionalKey(Schema.Boolean),
|
|
11
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const OpenApiExample: Schema.StructWithRest<Schema.Struct<{
|
|
3
|
+
readonly summary: Schema.optionalKey<Schema.String>;
|
|
4
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
5
|
+
readonly value: Schema.optionalKey<Schema.Unknown>;
|
|
6
|
+
readonly externalValue: Schema.optionalKey<Schema.String>;
|
|
7
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>;
|
|
8
|
+
export type OpenApiExample = typeof OpenApiExample.Type;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { openApiObject } from "./object.js";
|
|
3
|
+
export const OpenApiExample = openApiObject({
|
|
4
|
+
summary: Schema.optionalKey(Schema.String),
|
|
5
|
+
description: Schema.optionalKey(Schema.String),
|
|
6
|
+
value: Schema.optionalKey(Schema.Unknown),
|
|
7
|
+
externalValue: Schema.optionalKey(Schema.String),
|
|
8
|
+
}).check(Schema.makeFilter((value) => Object.hasOwn(value, "value") && value.externalValue !== undefined
|
|
9
|
+
? "Example value and externalValue are mutually exclusive"
|
|
10
|
+
: undefined));
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const OpenApiExternalDocs: Schema.StructWithRest<Schema.Struct<{
|
|
3
|
+
readonly url: Schema.String;
|
|
4
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
5
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>;
|
|
6
|
+
export type OpenApiExternalDocs = typeof OpenApiExternalDocs.Type;
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
declare const fields: {
|
|
3
|
+
description: Schema.optionalKey<Schema.String>;
|
|
4
|
+
required: Schema.optionalKey<Schema.Boolean>;
|
|
5
|
+
deprecated: Schema.optionalKey<Schema.Boolean>;
|
|
6
|
+
style: Schema.optionalKey<Schema.Literal<"simple">>;
|
|
7
|
+
explode: Schema.optionalKey<Schema.Boolean>;
|
|
8
|
+
schema: Schema.optionalKey<Schema.Union<readonly [Schema.$Record<Schema.String, Schema.Unknown>, Schema.Boolean]>>;
|
|
9
|
+
content: Schema.optionalKey<Schema.$Record<Schema.String, Schema.suspend<Schema.Codec<{
|
|
10
|
+
readonly [x: string]: unknown;
|
|
11
|
+
readonly schema?: boolean | {
|
|
12
|
+
readonly [x: string]: unknown;
|
|
13
|
+
} | undefined;
|
|
14
|
+
readonly example?: unknown;
|
|
15
|
+
readonly examples?: {
|
|
16
|
+
readonly [x: string]: {
|
|
17
|
+
readonly [x: string]: unknown;
|
|
18
|
+
readonly $ref: string;
|
|
19
|
+
readonly summary?: string | undefined;
|
|
20
|
+
readonly description?: string | undefined;
|
|
21
|
+
} | {
|
|
22
|
+
readonly [x: string]: unknown;
|
|
23
|
+
readonly summary?: string | undefined;
|
|
24
|
+
readonly description?: string | undefined;
|
|
25
|
+
readonly value?: unknown;
|
|
26
|
+
readonly externalValue?: string | undefined;
|
|
27
|
+
};
|
|
28
|
+
} | undefined;
|
|
29
|
+
readonly encoding?: {
|
|
30
|
+
readonly [x: string]: {
|
|
31
|
+
readonly [x: string]: unknown;
|
|
32
|
+
readonly contentType?: string | undefined;
|
|
33
|
+
readonly headers?: {
|
|
34
|
+
readonly [x: string]: OpenApiHeader | {
|
|
35
|
+
readonly [x: string]: unknown;
|
|
36
|
+
readonly $ref: string;
|
|
37
|
+
readonly summary?: string | undefined;
|
|
38
|
+
readonly description?: string | undefined;
|
|
39
|
+
};
|
|
40
|
+
} | undefined;
|
|
41
|
+
readonly style?: "deepObject" | "form" | "pipeDelimited" | "spaceDelimited" | undefined;
|
|
42
|
+
readonly explode?: boolean | undefined;
|
|
43
|
+
readonly allowReserved?: boolean | undefined;
|
|
44
|
+
};
|
|
45
|
+
} | undefined;
|
|
46
|
+
}, {
|
|
47
|
+
readonly [x: string]: unknown;
|
|
48
|
+
readonly schema?: boolean | {
|
|
49
|
+
readonly [x: string]: unknown;
|
|
50
|
+
} | undefined;
|
|
51
|
+
readonly example?: unknown;
|
|
52
|
+
readonly examples?: {
|
|
53
|
+
readonly [x: string]: {
|
|
54
|
+
readonly [x: string]: unknown;
|
|
55
|
+
readonly $ref: string;
|
|
56
|
+
readonly summary?: string | undefined;
|
|
57
|
+
readonly description?: string | undefined;
|
|
58
|
+
} | {
|
|
59
|
+
readonly [x: string]: unknown;
|
|
60
|
+
readonly summary?: string | undefined;
|
|
61
|
+
readonly description?: string | undefined;
|
|
62
|
+
readonly value?: unknown;
|
|
63
|
+
readonly externalValue?: string | undefined;
|
|
64
|
+
};
|
|
65
|
+
} | undefined;
|
|
66
|
+
readonly encoding?: {
|
|
67
|
+
readonly [x: string]: {
|
|
68
|
+
readonly [x: string]: unknown;
|
|
69
|
+
readonly contentType?: string | undefined;
|
|
70
|
+
readonly headers?: {
|
|
71
|
+
readonly [x: string]: OpenApiHeader | {
|
|
72
|
+
readonly [x: string]: unknown;
|
|
73
|
+
readonly $ref: string;
|
|
74
|
+
readonly summary?: string | undefined;
|
|
75
|
+
readonly description?: string | undefined;
|
|
76
|
+
};
|
|
77
|
+
} | undefined;
|
|
78
|
+
readonly style?: "deepObject" | "form" | "pipeDelimited" | "spaceDelimited" | undefined;
|
|
79
|
+
readonly explode?: boolean | undefined;
|
|
80
|
+
readonly allowReserved?: boolean | undefined;
|
|
81
|
+
};
|
|
82
|
+
} | undefined;
|
|
83
|
+
}, never, never>>>>;
|
|
84
|
+
example: Schema.optionalKey<Schema.Unknown>;
|
|
85
|
+
examples: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.StructWithRest<Schema.Struct<{
|
|
86
|
+
readonly $ref: Schema.String;
|
|
87
|
+
readonly summary: Schema.optionalKey<Schema.String>;
|
|
88
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
89
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>, Schema.StructWithRest<Schema.Struct<{
|
|
90
|
+
readonly summary: Schema.optionalKey<Schema.String>;
|
|
91
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
92
|
+
readonly value: Schema.optionalKey<Schema.Unknown>;
|
|
93
|
+
readonly externalValue: Schema.optionalKey<Schema.String>;
|
|
94
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>]>>>;
|
|
95
|
+
};
|
|
96
|
+
/** The interface only ties the recursive knot; every field is inferred from its schema. */
|
|
97
|
+
export interface OpenApiHeader extends Schema.Struct.Type<typeof fields> {
|
|
98
|
+
readonly [key: string]: unknown;
|
|
99
|
+
}
|
|
100
|
+
export declare const OpenApiHeader: Schema.StructWithRest<Schema.Struct<{
|
|
101
|
+
description: Schema.optionalKey<Schema.String>;
|
|
102
|
+
required: Schema.optionalKey<Schema.Boolean>;
|
|
103
|
+
deprecated: Schema.optionalKey<Schema.Boolean>;
|
|
104
|
+
style: Schema.optionalKey<Schema.Literal<"simple">>;
|
|
105
|
+
explode: Schema.optionalKey<Schema.Boolean>;
|
|
106
|
+
schema: Schema.optionalKey<Schema.Union<readonly [Schema.$Record<Schema.String, Schema.Unknown>, Schema.Boolean]>>;
|
|
107
|
+
content: Schema.optionalKey<Schema.$Record<Schema.String, Schema.suspend<Schema.Codec<{
|
|
108
|
+
readonly [x: string]: unknown;
|
|
109
|
+
readonly schema?: boolean | {
|
|
110
|
+
readonly [x: string]: unknown;
|
|
111
|
+
} | undefined;
|
|
112
|
+
readonly example?: unknown;
|
|
113
|
+
readonly examples?: {
|
|
114
|
+
readonly [x: string]: {
|
|
115
|
+
readonly [x: string]: unknown;
|
|
116
|
+
readonly $ref: string;
|
|
117
|
+
readonly summary?: string | undefined;
|
|
118
|
+
readonly description?: string | undefined;
|
|
119
|
+
} | {
|
|
120
|
+
readonly [x: string]: unknown;
|
|
121
|
+
readonly summary?: string | undefined;
|
|
122
|
+
readonly description?: string | undefined;
|
|
123
|
+
readonly value?: unknown;
|
|
124
|
+
readonly externalValue?: string | undefined;
|
|
125
|
+
};
|
|
126
|
+
} | undefined;
|
|
127
|
+
readonly encoding?: {
|
|
128
|
+
readonly [x: string]: {
|
|
129
|
+
readonly [x: string]: unknown;
|
|
130
|
+
readonly contentType?: string | undefined;
|
|
131
|
+
readonly headers?: {
|
|
132
|
+
readonly [x: string]: OpenApiHeader | {
|
|
133
|
+
readonly [x: string]: unknown;
|
|
134
|
+
readonly $ref: string;
|
|
135
|
+
readonly summary?: string | undefined;
|
|
136
|
+
readonly description?: string | undefined;
|
|
137
|
+
};
|
|
138
|
+
} | undefined;
|
|
139
|
+
readonly style?: "deepObject" | "form" | "pipeDelimited" | "spaceDelimited" | undefined;
|
|
140
|
+
readonly explode?: boolean | undefined;
|
|
141
|
+
readonly allowReserved?: boolean | undefined;
|
|
142
|
+
};
|
|
143
|
+
} | undefined;
|
|
144
|
+
}, {
|
|
145
|
+
readonly [x: string]: unknown;
|
|
146
|
+
readonly schema?: boolean | {
|
|
147
|
+
readonly [x: string]: unknown;
|
|
148
|
+
} | undefined;
|
|
149
|
+
readonly example?: unknown;
|
|
150
|
+
readonly examples?: {
|
|
151
|
+
readonly [x: string]: {
|
|
152
|
+
readonly [x: string]: unknown;
|
|
153
|
+
readonly $ref: string;
|
|
154
|
+
readonly summary?: string | undefined;
|
|
155
|
+
readonly description?: string | undefined;
|
|
156
|
+
} | {
|
|
157
|
+
readonly [x: string]: unknown;
|
|
158
|
+
readonly summary?: string | undefined;
|
|
159
|
+
readonly description?: string | undefined;
|
|
160
|
+
readonly value?: unknown;
|
|
161
|
+
readonly externalValue?: string | undefined;
|
|
162
|
+
};
|
|
163
|
+
} | undefined;
|
|
164
|
+
readonly encoding?: {
|
|
165
|
+
readonly [x: string]: {
|
|
166
|
+
readonly [x: string]: unknown;
|
|
167
|
+
readonly contentType?: string | undefined;
|
|
168
|
+
readonly headers?: {
|
|
169
|
+
readonly [x: string]: OpenApiHeader | {
|
|
170
|
+
readonly [x: string]: unknown;
|
|
171
|
+
readonly $ref: string;
|
|
172
|
+
readonly summary?: string | undefined;
|
|
173
|
+
readonly description?: string | undefined;
|
|
174
|
+
};
|
|
175
|
+
} | undefined;
|
|
176
|
+
readonly style?: "deepObject" | "form" | "pipeDelimited" | "spaceDelimited" | undefined;
|
|
177
|
+
readonly explode?: boolean | undefined;
|
|
178
|
+
readonly allowReserved?: boolean | undefined;
|
|
179
|
+
};
|
|
180
|
+
} | undefined;
|
|
181
|
+
}, never, never>>>>;
|
|
182
|
+
example: Schema.optionalKey<Schema.Unknown>;
|
|
183
|
+
examples: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.StructWithRest<Schema.Struct<{
|
|
184
|
+
readonly $ref: Schema.String;
|
|
185
|
+
readonly summary: Schema.optionalKey<Schema.String>;
|
|
186
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
187
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>, Schema.StructWithRest<Schema.Struct<{
|
|
188
|
+
readonly summary: Schema.optionalKey<Schema.String>;
|
|
189
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
190
|
+
readonly value: Schema.optionalKey<Schema.Unknown>;
|
|
191
|
+
readonly externalValue: Schema.optionalKey<Schema.String>;
|
|
192
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>]>>>;
|
|
193
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>;
|
|
194
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { OpenApiExample } from "./example.js";
|
|
3
|
+
import { OpenApiMediaType } from "./media-type.js";
|
|
4
|
+
import { openApiObject } from "./object.js";
|
|
5
|
+
import { withReference } from "./reference.js";
|
|
6
|
+
import { OpenApiSchema } from "./schema.js";
|
|
7
|
+
const fields = {
|
|
8
|
+
description: Schema.optionalKey(Schema.String),
|
|
9
|
+
required: Schema.optionalKey(Schema.Boolean),
|
|
10
|
+
deprecated: Schema.optionalKey(Schema.Boolean),
|
|
11
|
+
style: Schema.optionalKey(Schema.Literal("simple")),
|
|
12
|
+
explode: Schema.optionalKey(Schema.Boolean),
|
|
13
|
+
schema: Schema.optionalKey(OpenApiSchema),
|
|
14
|
+
content: Schema.optionalKey(Schema.Record(Schema.String, Schema.suspend(() => OpenApiMediaType))),
|
|
15
|
+
example: Schema.optionalKey(Schema.Unknown),
|
|
16
|
+
examples: Schema.optionalKey(Schema.Record(Schema.String, withReference(OpenApiExample))),
|
|
17
|
+
};
|
|
18
|
+
export const OpenApiHeader = openApiObject(fields).check(Schema.makeFilter((value) => {
|
|
19
|
+
if ((value.schema === undefined) === (value.content === undefined)) {
|
|
20
|
+
return "A header must have exactly one of schema or content";
|
|
21
|
+
}
|
|
22
|
+
if (value.content !== undefined && Object.keys(value.content).length !== 1) {
|
|
23
|
+
return "Header content must contain exactly one media type";
|
|
24
|
+
}
|
|
25
|
+
if (Object.hasOwn(value, "example") && value.examples !== undefined) {
|
|
26
|
+
return "Header example and examples are mutually exclusive";
|
|
27
|
+
}
|
|
28
|
+
return undefined;
|
|
29
|
+
}));
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
/** Path item keys that hold operations, in traversal order. */
|
|
3
|
+
export declare const OpenApiHttpMethod: Schema.Literals<readonly ["get", "put", "post", "delete", "options", "head", "patch", "trace"]>;
|
|
4
|
+
export type OpenApiHttpMethod = typeof OpenApiHttpMethod.Type;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export { OpenApiCallback } from "./callback.ts";
|
|
2
|
+
export { OpenApiComponents } from "./components.ts";
|
|
3
|
+
export { OpenApiContact } from "./contact.ts";
|
|
4
|
+
export { ParsedOpenApi } from "./document.ts";
|
|
5
|
+
export { OpenApiEncoding } from "./encoding.ts";
|
|
6
|
+
export { OpenApiExample } from "./example.ts";
|
|
7
|
+
export { OpenApiExternalDocs } from "./external-docs.ts";
|
|
8
|
+
export { OpenApiHeader } from "./header.ts";
|
|
9
|
+
export { OpenApiHttpMethod } from "./http-method.ts";
|
|
10
|
+
export { OpenApiInfo } from "./info.ts";
|
|
11
|
+
export { OpenApiLicense } from "./license.ts";
|
|
12
|
+
export { OpenApiLink } from "./link.ts";
|
|
13
|
+
export { OpenApiMediaType } from "./media-type.ts";
|
|
14
|
+
export { OpenApiOAuthFlow } from "./oauth-flow.ts";
|
|
15
|
+
export { OpenApiOAuthFlows } from "./oauth-flows.ts";
|
|
16
|
+
export { OpenApiOperation } from "./operation.ts";
|
|
17
|
+
export { OpenApiParameter } from "./parameter.ts";
|
|
18
|
+
export { OpenApiPathItem } from "./path-item.ts";
|
|
19
|
+
export { OpenApiPaths } from "./paths.ts";
|
|
20
|
+
export { OpenApiReference } from "./reference.ts";
|
|
21
|
+
export { OpenApiRequestBody } from "./request-body.ts";
|
|
22
|
+
export { OpenApiResponse } from "./response.ts";
|
|
23
|
+
export { OpenApiResponses } from "./responses.ts";
|
|
24
|
+
export { OpenApiSchema } from "./schema.ts";
|
|
25
|
+
export { OpenApiSecurityRequirement } from "./security-requirement.ts";
|
|
26
|
+
export { OpenApiSecurityScheme } from "./security-scheme.ts";
|
|
27
|
+
export { OpenApiServerVariable } from "./server-variable.ts";
|
|
28
|
+
export { OpenApiServer } from "./server.ts";
|
|
29
|
+
export { OpenApiTag } from "./tag.ts";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export { OpenApiCallback } from "./callback.js";
|
|
2
|
+
export { OpenApiComponents } from "./components.js";
|
|
3
|
+
export { OpenApiContact } from "./contact.js";
|
|
4
|
+
export { ParsedOpenApi } from "./document.js";
|
|
5
|
+
export { OpenApiEncoding } from "./encoding.js";
|
|
6
|
+
export { OpenApiExample } from "./example.js";
|
|
7
|
+
export { OpenApiExternalDocs } from "./external-docs.js";
|
|
8
|
+
export { OpenApiHeader } from "./header.js";
|
|
9
|
+
export { OpenApiHttpMethod } from "./http-method.js";
|
|
10
|
+
export { OpenApiInfo } from "./info.js";
|
|
11
|
+
export { OpenApiLicense } from "./license.js";
|
|
12
|
+
export { OpenApiLink } from "./link.js";
|
|
13
|
+
export { OpenApiMediaType } from "./media-type.js";
|
|
14
|
+
export { OpenApiOAuthFlow } from "./oauth-flow.js";
|
|
15
|
+
export { OpenApiOAuthFlows } from "./oauth-flows.js";
|
|
16
|
+
export { OpenApiOperation } from "./operation.js";
|
|
17
|
+
export { OpenApiParameter } from "./parameter.js";
|
|
18
|
+
export { OpenApiPathItem } from "./path-item.js";
|
|
19
|
+
export { OpenApiPaths } from "./paths.js";
|
|
20
|
+
export { OpenApiReference } from "./reference.js";
|
|
21
|
+
export { OpenApiRequestBody } from "./request-body.js";
|
|
22
|
+
export { OpenApiResponse } from "./response.js";
|
|
23
|
+
export { OpenApiResponses } from "./responses.js";
|
|
24
|
+
export { OpenApiSchema } from "./schema.js";
|
|
25
|
+
export { OpenApiSecurityRequirement } from "./security-requirement.js";
|
|
26
|
+
export { OpenApiSecurityScheme } from "./security-scheme.js";
|
|
27
|
+
export { OpenApiServerVariable } from "./server-variable.js";
|
|
28
|
+
export { OpenApiServer } from "./server.js";
|
|
29
|
+
export { OpenApiTag } from "./tag.js";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const OpenApiInfo: Schema.StructWithRest<Schema.Struct<{
|
|
3
|
+
readonly title: Schema.String;
|
|
4
|
+
readonly version: Schema.String;
|
|
5
|
+
readonly summary: Schema.optionalKey<Schema.String>;
|
|
6
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
7
|
+
readonly termsOfService: Schema.optionalKey<Schema.String>;
|
|
8
|
+
readonly contact: Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
9
|
+
readonly name: Schema.optionalKey<Schema.String>;
|
|
10
|
+
readonly url: Schema.optionalKey<Schema.String>;
|
|
11
|
+
readonly email: Schema.optionalKey<Schema.String>;
|
|
12
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>;
|
|
13
|
+
readonly license: Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
14
|
+
readonly name: Schema.String;
|
|
15
|
+
readonly identifier: Schema.optionalKey<Schema.String>;
|
|
16
|
+
readonly url: Schema.optionalKey<Schema.String>;
|
|
17
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>;
|
|
18
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>;
|
|
19
|
+
export type OpenApiInfo = typeof OpenApiInfo.Type;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { OpenApiContact } from "./contact.js";
|
|
3
|
+
import { OpenApiLicense } from "./license.js";
|
|
4
|
+
import { openApiObject } from "./object.js";
|
|
5
|
+
export const OpenApiInfo = openApiObject({
|
|
6
|
+
title: Schema.String,
|
|
7
|
+
version: Schema.String,
|
|
8
|
+
summary: Schema.optionalKey(Schema.String),
|
|
9
|
+
description: Schema.optionalKey(Schema.String),
|
|
10
|
+
termsOfService: Schema.optionalKey(Schema.String),
|
|
11
|
+
contact: Schema.optionalKey(OpenApiContact),
|
|
12
|
+
license: Schema.optionalKey(OpenApiLicense),
|
|
13
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const OpenApiLicense: Schema.StructWithRest<Schema.Struct<{
|
|
3
|
+
readonly name: Schema.String;
|
|
4
|
+
readonly identifier: Schema.optionalKey<Schema.String>;
|
|
5
|
+
readonly url: Schema.optionalKey<Schema.String>;
|
|
6
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>;
|
|
7
|
+
export type OpenApiLicense = typeof OpenApiLicense.Type;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { openApiObject } from "./object.js";
|
|
3
|
+
export const OpenApiLicense = openApiObject({
|
|
4
|
+
name: Schema.String,
|
|
5
|
+
identifier: Schema.optionalKey(Schema.String),
|
|
6
|
+
url: Schema.optionalKey(Schema.String),
|
|
7
|
+
}).check(Schema.makeFilter((value) => value.identifier !== undefined && value.url !== undefined
|
|
8
|
+
? "License identifier and url are mutually exclusive"
|
|
9
|
+
: undefined));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const OpenApiLink: Schema.StructWithRest<Schema.Struct<{
|
|
3
|
+
readonly operationRef: Schema.optionalKey<Schema.String>;
|
|
4
|
+
readonly operationId: Schema.optionalKey<Schema.String>;
|
|
5
|
+
readonly parameters: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
6
|
+
readonly requestBody: Schema.optionalKey<Schema.Unknown>;
|
|
7
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
8
|
+
readonly server: Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
9
|
+
readonly url: Schema.String;
|
|
10
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
11
|
+
readonly variables: Schema.optionalKey<Schema.$Record<Schema.String, Schema.StructWithRest<Schema.Struct<{
|
|
12
|
+
readonly default: Schema.String;
|
|
13
|
+
readonly enum: Schema.optionalKey<Schema.NonEmptyArray<Schema.String>>;
|
|
14
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
15
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>>;
|
|
16
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>;
|
|
17
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>;
|
|
18
|
+
export type OpenApiLink = typeof OpenApiLink.Type;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { openApiObject } from "./object.js";
|
|
3
|
+
import { OpenApiServer } from "./server.js";
|
|
4
|
+
export const OpenApiLink = openApiObject({
|
|
5
|
+
operationRef: Schema.optionalKey(Schema.String),
|
|
6
|
+
operationId: Schema.optionalKey(Schema.String),
|
|
7
|
+
parameters: Schema.optionalKey(Schema.Record(Schema.String, Schema.Unknown)),
|
|
8
|
+
requestBody: Schema.optionalKey(Schema.Unknown),
|
|
9
|
+
description: Schema.optionalKey(Schema.String),
|
|
10
|
+
server: Schema.optionalKey(OpenApiServer),
|
|
11
|
+
}).check(Schema.makeFilter((value) => value.operationRef !== undefined && value.operationId !== undefined
|
|
12
|
+
? "Link operationRef and operationId are mutually exclusive"
|
|
13
|
+
: undefined));
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const OpenApiMediaType: Schema.StructWithRest<Schema.Struct<{
|
|
3
|
+
readonly schema: Schema.optionalKey<Schema.Union<readonly [Schema.$Record<Schema.String, Schema.Unknown>, Schema.Boolean]>>;
|
|
4
|
+
readonly example: Schema.optionalKey<Schema.Unknown>;
|
|
5
|
+
readonly examples: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.StructWithRest<Schema.Struct<{
|
|
6
|
+
readonly $ref: Schema.String;
|
|
7
|
+
readonly summary: Schema.optionalKey<Schema.String>;
|
|
8
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
9
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>, Schema.StructWithRest<Schema.Struct<{
|
|
10
|
+
readonly summary: Schema.optionalKey<Schema.String>;
|
|
11
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
12
|
+
readonly value: Schema.optionalKey<Schema.Unknown>;
|
|
13
|
+
readonly externalValue: Schema.optionalKey<Schema.String>;
|
|
14
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>]>>>;
|
|
15
|
+
readonly encoding: Schema.optionalKey<Schema.$Record<Schema.String, Schema.StructWithRest<Schema.Struct<{
|
|
16
|
+
readonly contentType: Schema.optionalKey<Schema.String>;
|
|
17
|
+
readonly headers: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.StructWithRest<Schema.Struct<{
|
|
18
|
+
readonly $ref: Schema.String;
|
|
19
|
+
readonly summary: Schema.optionalKey<Schema.String>;
|
|
20
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
21
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>, Schema.suspend<Schema.Codec<import("./header.ts").OpenApiHeader, import("./header.ts").OpenApiHeader, never, never>>]>>>;
|
|
22
|
+
readonly style: Schema.optionalKey<Schema.Literals<readonly ["form", "spaceDelimited", "pipeDelimited", "deepObject"]>>;
|
|
23
|
+
readonly explode: Schema.optionalKey<Schema.Boolean>;
|
|
24
|
+
readonly allowReserved: Schema.optionalKey<Schema.Boolean>;
|
|
25
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>>;
|
|
26
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>;
|
|
27
|
+
export type OpenApiMediaType = typeof OpenApiMediaType.Type;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { OpenApiEncoding } from "./encoding.js";
|
|
3
|
+
import { OpenApiExample } from "./example.js";
|
|
4
|
+
import { openApiObject } from "./object.js";
|
|
5
|
+
import { withReference } from "./reference.js";
|
|
6
|
+
import { OpenApiSchema } from "./schema.js";
|
|
7
|
+
export const OpenApiMediaType = openApiObject({
|
|
8
|
+
schema: Schema.optionalKey(OpenApiSchema),
|
|
9
|
+
example: Schema.optionalKey(Schema.Unknown),
|
|
10
|
+
examples: Schema.optionalKey(Schema.Record(Schema.String, withReference(OpenApiExample))),
|
|
11
|
+
encoding: Schema.optionalKey(Schema.Record(Schema.String, OpenApiEncoding)),
|
|
12
|
+
}).check(Schema.makeFilter((value) => Object.hasOwn(value, "example") && value.examples !== undefined
|
|
13
|
+
? "Media type example and examples are mutually exclusive"
|
|
14
|
+
: undefined));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const OpenApiOAuthFlow: Schema.StructWithRest<Schema.Struct<{
|
|
3
|
+
readonly authorizationUrl: Schema.optionalKey<Schema.String>;
|
|
4
|
+
readonly tokenUrl: Schema.optionalKey<Schema.String>;
|
|
5
|
+
readonly refreshUrl: Schema.optionalKey<Schema.String>;
|
|
6
|
+
readonly scopes: Schema.$Record<Schema.String, Schema.String>;
|
|
7
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>;
|
|
8
|
+
export type OpenApiOAuthFlow = typeof OpenApiOAuthFlow.Type;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { openApiObject } from "./object.js";
|
|
3
|
+
export const OpenApiOAuthFlow = openApiObject({
|
|
4
|
+
authorizationUrl: Schema.optionalKey(Schema.String),
|
|
5
|
+
tokenUrl: Schema.optionalKey(Schema.String),
|
|
6
|
+
refreshUrl: Schema.optionalKey(Schema.String),
|
|
7
|
+
scopes: Schema.Record(Schema.String, Schema.String),
|
|
8
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const OpenApiOAuthFlows: Schema.StructWithRest<Schema.Struct<{
|
|
3
|
+
readonly implicit: Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
4
|
+
readonly tokenUrl: Schema.optionalKey<Schema.String>;
|
|
5
|
+
readonly refreshUrl: Schema.optionalKey<Schema.String>;
|
|
6
|
+
readonly scopes: Schema.$Record<Schema.String, Schema.String>;
|
|
7
|
+
readonly authorizationUrl: Schema.String;
|
|
8
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>;
|
|
9
|
+
readonly password: Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
10
|
+
readonly authorizationUrl: Schema.optionalKey<Schema.String>;
|
|
11
|
+
readonly refreshUrl: Schema.optionalKey<Schema.String>;
|
|
12
|
+
readonly scopes: Schema.$Record<Schema.String, Schema.String>;
|
|
13
|
+
readonly tokenUrl: Schema.String;
|
|
14
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>;
|
|
15
|
+
readonly clientCredentials: Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
16
|
+
readonly authorizationUrl: Schema.optionalKey<Schema.String>;
|
|
17
|
+
readonly refreshUrl: Schema.optionalKey<Schema.String>;
|
|
18
|
+
readonly scopes: Schema.$Record<Schema.String, Schema.String>;
|
|
19
|
+
readonly tokenUrl: Schema.String;
|
|
20
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>;
|
|
21
|
+
readonly authorizationCode: Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
22
|
+
readonly refreshUrl: Schema.optionalKey<Schema.String>;
|
|
23
|
+
readonly scopes: Schema.$Record<Schema.String, Schema.String>;
|
|
24
|
+
readonly authorizationUrl: Schema.String;
|
|
25
|
+
readonly tokenUrl: Schema.String;
|
|
26
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>;
|
|
27
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>;
|
|
28
|
+
export type OpenApiOAuthFlows = typeof OpenApiOAuthFlows.Type;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { OpenApiOAuthFlow } from "./oauth-flow.js";
|
|
3
|
+
import { openApiObject } from "./object.js";
|
|
4
|
+
export const OpenApiOAuthFlows = openApiObject({
|
|
5
|
+
implicit: Schema.optionalKey(openApiObject({ ...OpenApiOAuthFlow.schema.fields, authorizationUrl: Schema.String })),
|
|
6
|
+
password: Schema.optionalKey(openApiObject({ ...OpenApiOAuthFlow.schema.fields, tokenUrl: Schema.String })),
|
|
7
|
+
clientCredentials: Schema.optionalKey(openApiObject({ ...OpenApiOAuthFlow.schema.fields, tokenUrl: Schema.String })),
|
|
8
|
+
authorizationCode: Schema.optionalKey(openApiObject({
|
|
9
|
+
...OpenApiOAuthFlow.schema.fields,
|
|
10
|
+
authorizationUrl: Schema.String,
|
|
11
|
+
tokenUrl: Schema.String,
|
|
12
|
+
})),
|
|
13
|
+
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
/** Preserve extensions and unrecognized fields while validating every declared field. */
|
|
3
|
+
export declare function openApiObject<const Fields extends Schema.Struct.Fields>(fields: Fields): Schema.StructWithRest<Schema.Struct<Fields>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>;
|
|
4
|
+
/** Patterned objects also allow specification extensions alongside their entries. */
|
|
5
|
+
export declare function openApiMap<K extends Schema.Record.Key, V extends Schema.Constraint>(key: K, value: V): Schema.StructWithRest<Schema.$Record<K, V>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
/** Preserve extensions and unrecognized fields while validating every declared field. */
|
|
3
|
+
export function openApiObject(fields) {
|
|
4
|
+
return Schema.StructWithRest(Schema.Struct(fields), [
|
|
5
|
+
Schema.Record(Schema.String, Schema.Unknown),
|
|
6
|
+
]);
|
|
7
|
+
}
|
|
8
|
+
/** Patterned objects also allow specification extensions alongside their entries. */
|
|
9
|
+
export function openApiMap(key, value) {
|
|
10
|
+
const isKey = Schema.is(key);
|
|
11
|
+
return Schema.StructWithRest(Schema.Record(key, value), [
|
|
12
|
+
Schema.Record(Schema.String, Schema.Unknown),
|
|
13
|
+
]).check(Schema.makeFilter((entries) => {
|
|
14
|
+
const invalid = Object.keys(entries).find((name) => !name.startsWith("x-") && !isKey(name));
|
|
15
|
+
return invalid === undefined ? undefined : `Unexpected key ${JSON.stringify(invalid)}`;
|
|
16
|
+
}));
|
|
17
|
+
}
|