@scalar/oas-utils 0.2.74 → 0.2.76

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.
Files changed (46) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/entities/spec/collection.d.ts +292 -0
  3. package/dist/entities/spec/collection.d.ts.map +1 -1
  4. package/dist/entities/spec/collection.js +11 -1
  5. package/dist/entities/spec/index.js +2 -2
  6. package/dist/entities/spec/parameters.d.ts +2 -2
  7. package/dist/entities/spec/request-examples.d.ts +228 -70
  8. package/dist/entities/spec/request-examples.d.ts.map +1 -1
  9. package/dist/entities/spec/request-examples.js +156 -4
  10. package/dist/entities/spec/requests.d.ts +205 -11
  11. package/dist/entities/spec/requests.d.ts.map +1 -1
  12. package/dist/entities/spec/requests.js +16 -11
  13. package/dist/entities/spec/server.d.ts +2 -2
  14. package/dist/entities/spec/server.d.ts.map +1 -1
  15. package/dist/entities/spec/spec-objects.d.ts +20 -10
  16. package/dist/entities/spec/spec-objects.d.ts.map +1 -1
  17. package/dist/entities/spec/spec-objects.js +6 -1
  18. package/dist/entities/spec/x-scalar-environments.d.ts +74 -0
  19. package/dist/entities/spec/x-scalar-environments.d.ts.map +1 -0
  20. package/dist/entities/spec/x-scalar-environments.js +23 -0
  21. package/dist/entities/spec/x-scalar-secrets.d.ts +23 -0
  22. package/dist/entities/spec/x-scalar-secrets.d.ts.map +1 -0
  23. package/dist/entities/spec/x-scalar-secrets.js +9 -0
  24. package/dist/helpers/findVariables.d.ts.map +1 -1
  25. package/dist/helpers/findVariables.js +3 -5
  26. package/dist/helpers/index.js +1 -1
  27. package/dist/helpers/regexHelpers.d.ts +4 -2
  28. package/dist/helpers/regexHelpers.d.ts.map +1 -1
  29. package/dist/helpers/regexHelpers.js +5 -3
  30. package/dist/migrations/v-2.1.0/migration.d.ts +1 -1
  31. package/dist/spec-getters/getExampleFromSchema.d.ts +1 -0
  32. package/dist/spec-getters/getExampleFromSchema.d.ts.map +1 -1
  33. package/dist/spec-getters/getRequestBodyFromOperation.d.ts +1 -1
  34. package/dist/spec-getters/getRequestBodyFromOperation.d.ts.map +1 -1
  35. package/dist/spec-getters/getRequestBodyFromOperation.js +2 -5
  36. package/dist/spec-getters/getRequestFromOperation.d.ts +1 -1
  37. package/dist/spec-getters/getRequestFromOperation.d.ts.map +1 -1
  38. package/dist/spec-getters/getRequestFromOperation.js +5 -4
  39. package/dist/transforms/export-spec.d.ts +14 -71
  40. package/dist/transforms/export-spec.d.ts.map +1 -1
  41. package/dist/transforms/export-spec.js +73 -0
  42. package/dist/transforms/import-spec.js +1 -1
  43. package/dist/transforms/index.d.ts +1 -0
  44. package/dist/transforms/index.d.ts.map +1 -1
  45. package/dist/transforms/index.js +1 -0
  46. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @scalar/oas-utils
2
2
 
3
+ ## 0.2.76
4
+
5
+ ### Patch Changes
6
+
7
+ - 6894b7d: feat: passes omitEmptyAndOptionalProperties from operation
8
+ - c87353e: Add serialization back to OpenAPI spec for custom entities
9
+
10
+ ## 0.2.75
11
+
12
+ ### Patch Changes
13
+
14
+ - 49ccdee: refactor: updates regexHelpers
15
+
3
16
  ## 0.2.74
4
17
 
5
18
  ### Patch Changes
@@ -1,4 +1,226 @@
1
1
  import { z } from 'zod';
2
+ export declare const oasCollectionSchema: z.ZodObject<{
3
+ /**
4
+ * @deprecated
5
+ *
6
+ * Needs to be remove as it is not a spec property
7
+ */
8
+ type: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"collection">>>;
9
+ openapi: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<"3.0.0">, z.ZodLiteral<"3.1.0">, z.ZodLiteral<"4.0.0">]>>>;
10
+ jsonSchemaDialect: z.ZodOptional<z.ZodString>;
11
+ info: z.ZodOptional<z.ZodObject<{
12
+ title: z.ZodDefault<z.ZodOptional<z.ZodString>>;
13
+ summary: z.ZodOptional<z.ZodString>;
14
+ description: z.ZodOptional<z.ZodString>;
15
+ termsOfService: z.ZodOptional<z.ZodString>;
16
+ contact: z.ZodOptional<z.ZodObject<{
17
+ name: z.ZodOptional<z.ZodString>;
18
+ url: z.ZodOptional<z.ZodString>;
19
+ email: z.ZodOptional<z.ZodString>;
20
+ }, "strip", z.ZodTypeAny, {
21
+ name?: string | undefined;
22
+ url?: string | undefined;
23
+ email?: string | undefined;
24
+ }, {
25
+ name?: string | undefined;
26
+ url?: string | undefined;
27
+ email?: string | undefined;
28
+ }>>;
29
+ license: z.ZodOptional<z.ZodObject<{
30
+ name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
31
+ identifier: z.ZodOptional<z.ZodString>;
32
+ url: z.ZodOptional<z.ZodString>;
33
+ }, "strip", z.ZodTypeAny, {
34
+ name: string;
35
+ identifier?: string | undefined;
36
+ url?: string | undefined;
37
+ }, {
38
+ name?: string | undefined;
39
+ identifier?: string | undefined;
40
+ url?: string | undefined;
41
+ }>>;
42
+ version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
43
+ }, "strip", z.ZodTypeAny, {
44
+ title: string;
45
+ version: string;
46
+ description?: string | undefined;
47
+ summary?: string | undefined;
48
+ termsOfService?: string | undefined;
49
+ contact?: {
50
+ name?: string | undefined;
51
+ url?: string | undefined;
52
+ email?: string | undefined;
53
+ } | undefined;
54
+ license?: {
55
+ name: string;
56
+ identifier?: string | undefined;
57
+ url?: string | undefined;
58
+ } | undefined;
59
+ }, {
60
+ description?: string | undefined;
61
+ title?: string | undefined;
62
+ summary?: string | undefined;
63
+ termsOfService?: string | undefined;
64
+ contact?: {
65
+ name?: string | undefined;
66
+ url?: string | undefined;
67
+ email?: string | undefined;
68
+ } | undefined;
69
+ license?: {
70
+ name?: string | undefined;
71
+ identifier?: string | undefined;
72
+ url?: string | undefined;
73
+ } | undefined;
74
+ version?: string | undefined;
75
+ }>>;
76
+ /**
77
+ * A declaration of which security mechanisms can be used across the API. The list of
78
+ * values includes alternative security requirement objects that can be used. Only
79
+ * one of the security requirement objects need to be satisfied to authorize a request.
80
+ * Individual operations can override this definition. To make security optional, an empty
81
+ * security requirement ({}) can be included in the array.
82
+ */
83
+ security: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>>, "many">>>;
84
+ externalDocs: z.ZodOptional<z.ZodObject<{
85
+ description: z.ZodOptional<z.ZodString>;
86
+ url: z.ZodDefault<z.ZodString>;
87
+ }, "strip", z.ZodTypeAny, {
88
+ url: string;
89
+ description?: string | undefined;
90
+ }, {
91
+ description?: string | undefined;
92
+ url?: string | undefined;
93
+ }>>;
94
+ /** TODO: Type these */
95
+ components: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
96
+ /** TODO: Type these */
97
+ webhooks: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
98
+ /** A custom icon representing the collection */
99
+ 'x-scalar-icon': z.ZodDefault<z.ZodOptional<z.ZodString>>;
100
+ 'x-scalar-environment': z.ZodOptional<z.ZodString>;
101
+ 'x-scalar-environments': z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
102
+ description: z.ZodOptional<z.ZodString>;
103
+ color: z.ZodOptional<z.ZodString>;
104
+ variables: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
105
+ description: z.ZodOptional<z.ZodString>;
106
+ default: z.ZodDefault<z.ZodString>;
107
+ }, "strip", z.ZodTypeAny, {
108
+ default: string;
109
+ description?: string | undefined;
110
+ }, {
111
+ default?: string | undefined;
112
+ description?: string | undefined;
113
+ }>, z.ZodString]>>;
114
+ }, "strip", z.ZodTypeAny, {
115
+ variables: Record<string, string | {
116
+ default: string;
117
+ description?: string | undefined;
118
+ }>;
119
+ description?: string | undefined;
120
+ color?: string | undefined;
121
+ }, {
122
+ variables: Record<string, string | {
123
+ default?: string | undefined;
124
+ description?: string | undefined;
125
+ }>;
126
+ description?: string | undefined;
127
+ color?: string | undefined;
128
+ }>>>;
129
+ 'x-scalar-secrets': z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
130
+ description: z.ZodOptional<z.ZodString>;
131
+ example: z.ZodOptional<z.ZodString>;
132
+ }, "strip", z.ZodTypeAny, {
133
+ description?: string | undefined;
134
+ example?: string | undefined;
135
+ }, {
136
+ description?: string | undefined;
137
+ example?: string | undefined;
138
+ }>>>;
139
+ }, "strip", z.ZodTypeAny, {
140
+ type: "collection";
141
+ openapi: string;
142
+ security: Record<string, string[]>[];
143
+ 'x-scalar-icon': string;
144
+ externalDocs?: {
145
+ url: string;
146
+ description?: string | undefined;
147
+ } | undefined;
148
+ jsonSchemaDialect?: string | undefined;
149
+ info?: {
150
+ title: string;
151
+ version: string;
152
+ description?: string | undefined;
153
+ summary?: string | undefined;
154
+ termsOfService?: string | undefined;
155
+ contact?: {
156
+ name?: string | undefined;
157
+ url?: string | undefined;
158
+ email?: string | undefined;
159
+ } | undefined;
160
+ license?: {
161
+ name: string;
162
+ identifier?: string | undefined;
163
+ url?: string | undefined;
164
+ } | undefined;
165
+ } | undefined;
166
+ components?: Record<string, unknown> | undefined;
167
+ webhooks?: Record<string, unknown> | undefined;
168
+ 'x-scalar-environment'?: string | undefined;
169
+ 'x-scalar-environments'?: Record<string, {
170
+ variables: Record<string, string | {
171
+ default: string;
172
+ description?: string | undefined;
173
+ }>;
174
+ description?: string | undefined;
175
+ color?: string | undefined;
176
+ }> | undefined;
177
+ 'x-scalar-secrets'?: Record<string, {
178
+ description?: string | undefined;
179
+ example?: string | undefined;
180
+ }> | undefined;
181
+ }, {
182
+ type?: "collection" | undefined;
183
+ externalDocs?: {
184
+ description?: string | undefined;
185
+ url?: string | undefined;
186
+ } | undefined;
187
+ openapi?: string | undefined;
188
+ jsonSchemaDialect?: string | undefined;
189
+ info?: {
190
+ description?: string | undefined;
191
+ title?: string | undefined;
192
+ summary?: string | undefined;
193
+ termsOfService?: string | undefined;
194
+ contact?: {
195
+ name?: string | undefined;
196
+ url?: string | undefined;
197
+ email?: string | undefined;
198
+ } | undefined;
199
+ license?: {
200
+ name?: string | undefined;
201
+ identifier?: string | undefined;
202
+ url?: string | undefined;
203
+ } | undefined;
204
+ version?: string | undefined;
205
+ } | undefined;
206
+ security?: Record<string, string[] | undefined>[] | undefined;
207
+ components?: Record<string, unknown> | undefined;
208
+ webhooks?: Record<string, unknown> | undefined;
209
+ 'x-scalar-icon'?: string | undefined;
210
+ 'x-scalar-environment'?: string | undefined;
211
+ 'x-scalar-environments'?: Record<string, {
212
+ variables: Record<string, string | {
213
+ default?: string | undefined;
214
+ description?: string | undefined;
215
+ }>;
216
+ description?: string | undefined;
217
+ color?: string | undefined;
218
+ }> | undefined;
219
+ 'x-scalar-secrets'?: Record<string, {
220
+ description?: string | undefined;
221
+ example?: string | undefined;
222
+ }> | undefined;
223
+ }>;
2
224
  export declare const extendedCollectionSchema: z.ZodObject<{
3
225
  uid: z.ZodDefault<z.ZodOptional<z.ZodString>>;
4
226
  /** A list of security schemes UIDs associated with the collection */
@@ -198,6 +420,11 @@ export declare const extendedCollectionSchema: z.ZodObject<{
198
420
  watchModeStatus?: "IDLE" | "WATCHING" | "ERROR" | undefined;
199
421
  }>;
200
422
  export declare const collectionSchema: z.ZodObject<z.objectUtil.extendShape<{
423
+ /**
424
+ * @deprecated
425
+ *
426
+ * Needs to be remove as it is not a spec property
427
+ */
201
428
  type: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"collection">>>;
202
429
  openapi: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<"3.0.0">, z.ZodLiteral<"3.1.0">, z.ZodLiteral<"4.0.0">]>>>;
203
430
  jsonSchemaDialect: z.ZodOptional<z.ZodString>;
@@ -290,6 +517,45 @@ export declare const collectionSchema: z.ZodObject<z.objectUtil.extendShape<{
290
517
  webhooks: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
291
518
  /** A custom icon representing the collection */
292
519
  'x-scalar-icon': z.ZodDefault<z.ZodOptional<z.ZodString>>;
520
+ 'x-scalar-environment': z.ZodOptional<z.ZodString>;
521
+ 'x-scalar-environments': z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
522
+ description: z.ZodOptional<z.ZodString>;
523
+ color: z.ZodOptional<z.ZodString>;
524
+ variables: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
525
+ description: z.ZodOptional<z.ZodString>;
526
+ default: z.ZodDefault<z.ZodString>;
527
+ }, "strip", z.ZodTypeAny, {
528
+ default: string;
529
+ description?: string | undefined;
530
+ }, {
531
+ default?: string | undefined;
532
+ description?: string | undefined;
533
+ }>, z.ZodString]>>;
534
+ }, "strip", z.ZodTypeAny, {
535
+ variables: Record<string, string | {
536
+ default: string;
537
+ description?: string | undefined;
538
+ }>;
539
+ description?: string | undefined;
540
+ color?: string | undefined;
541
+ }, {
542
+ variables: Record<string, string | {
543
+ default?: string | undefined;
544
+ description?: string | undefined;
545
+ }>;
546
+ description?: string | undefined;
547
+ color?: string | undefined;
548
+ }>>>;
549
+ 'x-scalar-secrets': z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
550
+ description: z.ZodOptional<z.ZodString>;
551
+ example: z.ZodOptional<z.ZodString>;
552
+ }, "strip", z.ZodTypeAny, {
553
+ description?: string | undefined;
554
+ example?: string | undefined;
555
+ }, {
556
+ description?: string | undefined;
557
+ example?: string | undefined;
558
+ }>>>;
293
559
  }, {
294
560
  uid: z.ZodDefault<z.ZodOptional<z.ZodString>>;
295
561
  /** A list of security schemes UIDs associated with the collection */
@@ -473,6 +739,19 @@ export declare const collectionSchema: z.ZodObject<z.objectUtil.extendShape<{
473
739
  } | undefined;
474
740
  components?: Record<string, unknown> | undefined;
475
741
  webhooks?: Record<string, unknown> | undefined;
742
+ 'x-scalar-environment'?: string | undefined;
743
+ 'x-scalar-environments'?: Record<string, {
744
+ variables: Record<string, string | {
745
+ default: string;
746
+ description?: string | undefined;
747
+ }>;
748
+ description?: string | undefined;
749
+ color?: string | undefined;
750
+ }> | undefined;
751
+ 'x-scalar-secrets'?: Record<string, {
752
+ description?: string | undefined;
753
+ example?: string | undefined;
754
+ }> | undefined;
476
755
  documentUrl?: string | undefined;
477
756
  integration?: string | null | undefined;
478
757
  }, {
@@ -506,6 +785,19 @@ export declare const collectionSchema: z.ZodObject<z.objectUtil.extendShape<{
506
785
  components?: Record<string, unknown> | undefined;
507
786
  webhooks?: Record<string, unknown> | undefined;
508
787
  'x-scalar-icon'?: string | undefined;
788
+ 'x-scalar-environment'?: string | undefined;
789
+ 'x-scalar-environments'?: Record<string, {
790
+ variables: Record<string, string | {
791
+ default?: string | undefined;
792
+ description?: string | undefined;
793
+ }>;
794
+ description?: string | undefined;
795
+ color?: string | undefined;
796
+ }> | undefined;
797
+ 'x-scalar-secrets'?: Record<string, {
798
+ description?: string | undefined;
799
+ example?: string | undefined;
800
+ }> | undefined;
509
801
  securitySchemes?: string[] | undefined;
510
802
  selectedSecuritySchemeUids?: (string | undefined)[] | undefined;
511
803
  selectedServerUid?: string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/collection.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAyCvB,eAAO,MAAM,wBAAwB;;IAEnC,qEAAqE;;IAErE,2FAA2F;;IAE3F,oCAAoC;;IAEpC,wDAAwD;;IAExD,gDAAgD;;IAEhD,8CAA8C;;IAE9C,gEAAgE;;IAEhE;;;;;OAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEH,wGAAwG;;IAExG;;;;OAIG;;IAEH,kFAAkF;;IAElF;;;;OAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASJ,CAAA;AACD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AACzD,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA"}
@@ -1,9 +1,16 @@
1
1
  import { oasSecurityRequirementSchema, securitySchemeExampleValueSchema } from './security.js';
2
+ import { xScalarEnvironmentsSchema } from './x-scalar-environments.js';
3
+ import { xScalarSecretsSchema } from './x-scalar-secrets.js';
2
4
  import { z } from 'zod';
3
5
  import { oasInfoSchema, oasExternalDocumentationSchema } from './spec-objects.js';
4
6
  import { nanoidSchema } from '../shared/utility.js';
5
7
 
6
8
  const oasCollectionSchema = z.object({
9
+ /**
10
+ * @deprecated
11
+ *
12
+ * Needs to be remove as it is not a spec property
13
+ */
7
14
  'type': z.literal('collection').optional().default('collection'),
8
15
  'openapi': z
9
16
  .union([
@@ -31,6 +38,9 @@ const oasCollectionSchema = z.object({
31
38
  'webhooks': z.record(z.string(), z.unknown()).optional(),
32
39
  /** A custom icon representing the collection */
33
40
  'x-scalar-icon': z.string().optional().default('interface-content-folder'),
41
+ 'x-scalar-environment': z.string().optional(),
42
+ 'x-scalar-environments': xScalarEnvironmentsSchema.optional(),
43
+ 'x-scalar-secrets': xScalarSecretsSchema.optional(),
34
44
  // These properties will be stripped out and mapped back as id lists
35
45
  // servers
36
46
  // paths/**
@@ -83,4 +93,4 @@ const extendedCollectionSchema = z.object({
83
93
  });
84
94
  const collectionSchema = oasCollectionSchema.merge(extendedCollectionSchema);
85
95
 
86
- export { collectionSchema, extendedCollectionSchema };
96
+ export { collectionSchema, extendedCollectionSchema, oasCollectionSchema };
@@ -1,7 +1,7 @@
1
- export { collectionSchema, extendedCollectionSchema } from './collection.js';
1
+ export { collectionSchema, extendedCollectionSchema, oasCollectionSchema } from './collection.js';
2
2
  export { oasServerSchema, oasServerVariableSchema, serverSchema } from './server.js';
3
3
  export { oasRequestSchema, requestMethods, requestSchema } from './requests.js';
4
- export { createExampleFromRequest, createParamInstance, exampleRequestBodyEncoding, exampleRequestBodySchema, requestExampleParametersSchema, requestExampleSchema } from './request-examples.js';
4
+ export { convertExampleToXScalar, createExampleFromRequest, createParamInstance, exampleBodyMime, exampleRequestBodyEncoding, exampleRequestBodySchema, requestExampleParametersSchema, requestExampleSchema, xScalarExampleBodySchema, xScalarExampleSchema, xScalarFileValueSchema, xScalarFormDataValue } from './request-examples.js';
5
5
  export { oasContactSchema, oasExternalDocumentationSchema, oasInfoSchema, oasLicenseSchema, oasTagSchema, tagSchema, xScalarNestedSchema } from './spec-objects.js';
6
6
  export { oasParameterSchema, parameterStyleSchema, parameterTypeSchema } from './parameters.js';
7
7
  export { authExampleFromSchema, oasOauthFlowSchema, oasSecurityRequirementSchema, oasSecuritySchemeSchema, pkceOptions, securityApiKeySchema, securityHttpSchema, securityOauthSchema, securityOpenIdSchema, securitySchemeApiKeyIn, securitySchemeExampleValueSchema, securitySchemeSchema } from './security.js';
@@ -35,10 +35,10 @@ export declare const oasParameterSchema: z.ZodObject<{
35
35
  in: "path" | "query" | "header" | "cookie";
36
36
  deprecated: boolean;
37
37
  description?: string | undefined;
38
+ example?: unknown;
38
39
  schema?: unknown;
39
40
  content?: unknown;
40
41
  style?: "matrix" | "simple" | "form" | "label" | "spaceDelimited" | "pipeDelimited" | "deepObject" | undefined;
41
- example?: unknown;
42
42
  examples?: Record<string, {
43
43
  value?: unknown;
44
44
  summary?: string | undefined;
@@ -48,11 +48,11 @@ export declare const oasParameterSchema: z.ZodObject<{
48
48
  in: "path" | "query" | "header" | "cookie";
49
49
  required?: boolean | undefined;
50
50
  description?: string | undefined;
51
+ example?: unknown;
51
52
  deprecated?: boolean | undefined;
52
53
  schema?: unknown;
53
54
  content?: unknown;
54
55
  style?: "matrix" | "simple" | "form" | "label" | "spaceDelimited" | "pipeDelimited" | "deepObject" | undefined;
55
- example?: unknown;
56
56
  examples?: Record<string, {
57
57
  value?: unknown;
58
58
  summary?: string | undefined;