@effect/platform 0.70.6 → 0.70.7

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.
@@ -1,499 +1,40 @@
1
1
  /**
2
2
  * @since 1.0.0
3
3
  */
4
- import * as Arr from "effect/Array";
5
- import * as Option from "effect/Option";
6
- import * as Predicate from "effect/Predicate";
4
+ import * as JSONSchema from "effect/JSONSchema";
7
5
  import * as Record from "effect/Record";
8
- import * as AST from "effect/SchemaAST";
9
6
  /**
10
7
  * @category encoding
11
8
  * @since 1.0.0
12
9
  */
13
10
  export const make = schema => {
14
- const $defs = {};
11
+ const defs = {};
15
12
  const out = makeWithDefs(schema, {
16
- defs: $defs
13
+ defs
17
14
  });
18
- if (!Record.isEmptyRecord($defs)) {
19
- out.$defs = $defs;
15
+ if (!Record.isEmptyRecord(defs)) {
16
+ out.$defs = defs;
20
17
  }
21
18
  return out;
22
19
  };
23
20
  /**
21
+ * Creates a schema with additional options and definitions.
22
+ *
23
+ * - `defs`: A record of definitions that are included in the schema.
24
+ * - `defsPath`: The path to the definitions within the schema (defaults to "#/$defs/").
25
+ * - `topLevelReferenceStrategy`: Controls the handling of the top-level reference. Possible values are:
26
+ * - `"keep"`: Keep the top-level reference (default behavior).
27
+ * - `"skip"`: Skip the top-level reference.
28
+ *
24
29
  * @category encoding
25
30
  * @since 1.0.0
26
31
  */
27
32
  export const makeWithDefs = (schema, options) => {
28
- const defsPath = options.defsPath ?? "#/$defs/";
29
- const getRef = id => `${defsPath}${id}`;
30
- const out = go(schema.ast, options.defs, true, [], {
31
- getRef
33
+ return JSONSchema.fromAST(schema.ast, {
34
+ definitions: options.defs,
35
+ definitionPath: options.defsPath ?? "#/components/schemas/",
36
+ target: "openApi3.1",
37
+ topLevelReferenceStrategy: options.topLevelReferenceStrategy ?? "keep"
32
38
  });
33
- for (const id in options.defs) {
34
- if (options.defs[id]["$ref"] === getRef(id)) {
35
- delete options.defs[id];
36
- }
37
- }
38
- return out;
39
- };
40
- const constAny = {
41
- $id: "/schemas/any"
42
- };
43
- const constUnknown = {
44
- $id: "/schemas/unknown"
45
- };
46
- const constVoid = {
47
- $id: "/schemas/void"
48
- };
49
- const constAnyObject = {
50
- "$id": "/schemas/object",
51
- "anyOf": [{
52
- "type": "object"
53
- }, {
54
- "type": "array"
55
- }]
56
- };
57
- const constEmpty = {
58
- "$id": "/schemas/{}",
59
- "anyOf": [{
60
- "type": "object"
61
- }, {
62
- "type": "array"
63
- }]
64
- };
65
- const getJsonSchemaAnnotations = annotated => Record.getSomes({
66
- description: AST.getDescriptionAnnotation(annotated),
67
- title: AST.getTitleAnnotation(annotated),
68
- examples: AST.getExamplesAnnotation(annotated),
69
- default: AST.getDefaultAnnotation(annotated)
70
- });
71
- const removeDefaultJsonSchemaAnnotations = (jsonSchemaAnnotations, ast) => {
72
- if (jsonSchemaAnnotations["title"] === ast.annotations[AST.TitleAnnotationId]) {
73
- delete jsonSchemaAnnotations["title"];
74
- }
75
- if (jsonSchemaAnnotations["description"] === ast.annotations[AST.DescriptionAnnotationId]) {
76
- delete jsonSchemaAnnotations["description"];
77
- }
78
- return jsonSchemaAnnotations;
79
- };
80
- const getASTJsonSchemaAnnotations = ast => {
81
- const jsonSchemaAnnotations = getJsonSchemaAnnotations(ast);
82
- switch (ast._tag) {
83
- case "StringKeyword":
84
- return removeDefaultJsonSchemaAnnotations(jsonSchemaAnnotations, AST.stringKeyword);
85
- case "NumberKeyword":
86
- return removeDefaultJsonSchemaAnnotations(jsonSchemaAnnotations, AST.numberKeyword);
87
- case "BooleanKeyword":
88
- return removeDefaultJsonSchemaAnnotations(jsonSchemaAnnotations, AST.booleanKeyword);
89
- default:
90
- return jsonSchemaAnnotations;
91
- }
92
- };
93
- const pruneUndefinedFromPropertySignature = ast => {
94
- if (Option.isNone(AST.getJSONSchemaAnnotation(ast))) {
95
- switch (ast._tag) {
96
- case "Union":
97
- {
98
- const types = ast.types.filter(type => !AST.isUndefinedKeyword(type));
99
- if (types.length < ast.types.length) {
100
- return AST.Union.make(types, ast.annotations);
101
- }
102
- break;
103
- }
104
- case "Transformation":
105
- return pruneUndefinedFromPropertySignature(isParseJsonTransformation(ast.from) ? ast.to : ast.from);
106
- }
107
- }
108
- };
109
- const getRefinementInnerTransformation = ast => {
110
- switch (ast.from._tag) {
111
- case "Transformation":
112
- return ast.from;
113
- case "Refinement":
114
- return getRefinementInnerTransformation(ast.from);
115
- case "Suspend":
116
- {
117
- const from = ast.from.f();
118
- if (AST.isRefinement(from)) {
119
- return getRefinementInnerTransformation(from);
120
- }
121
- }
122
- }
123
- };
124
- const isParseJsonTransformation = ast => ast.annotations[AST.SchemaIdAnnotationId] === AST.ParseJsonSchemaId;
125
- const isOverrideAnnotation = jsonSchema => {
126
- return "type" in jsonSchema || "oneOf" in jsonSchema || "anyOf" in jsonSchema || "const" in jsonSchema || "enum" in jsonSchema || "$ref" in jsonSchema;
127
- };
128
- const go = (ast, $defs, handleIdentifier, path, options) => {
129
- const hook = AST.getJSONSchemaAnnotation(ast);
130
- if (Option.isSome(hook)) {
131
- const handler = hook.value;
132
- if (AST.isRefinement(ast)) {
133
- const t = getRefinementInnerTransformation(ast);
134
- if (t === undefined) {
135
- try {
136
- return {
137
- ...go(ast.from, $defs, true, path, options),
138
- ...getJsonSchemaAnnotations(ast),
139
- ...handler
140
- };
141
- } catch (e) {
142
- return {
143
- ...getJsonSchemaAnnotations(ast),
144
- ...handler
145
- };
146
- }
147
- } else if (!isOverrideAnnotation(handler)) {
148
- return {
149
- ...go(t, $defs, true, path, options),
150
- ...getJsonSchemaAnnotations(ast)
151
- };
152
- }
153
- }
154
- return handler;
155
- }
156
- const surrogate = AST.getSurrogateAnnotation(ast);
157
- if (handleIdentifier && !AST.isRefinement(ast)) {
158
- const identifier = AST.getJSONIdentifier(Option.isSome(surrogate) ? {
159
- annotations: {
160
- ...(ast._tag === "Transformation" ? ast.to.annotations : {}),
161
- ...ast.annotations
162
- }
163
- } : ast);
164
- if (Option.isSome(identifier)) {
165
- const id = identifier.value;
166
- const out = {
167
- $ref: options.getRef(id)
168
- };
169
- if (!Record.has($defs, id)) {
170
- $defs[id] = out;
171
- $defs[id] = go(ast, $defs, false, path, options);
172
- }
173
- return out;
174
- }
175
- }
176
- if (Option.isSome(surrogate)) {
177
- return {
178
- ...go(surrogate.value, $defs, handleIdentifier, path, options),
179
- ...(ast._tag === "Transformation" ? getJsonSchemaAnnotations(ast.to) : {}),
180
- ...getJsonSchemaAnnotations(ast)
181
- };
182
- }
183
- switch (ast._tag) {
184
- case "Declaration":
185
- throw new Error(getJSONSchemaMissingAnnotationErrorMessage(path, ast));
186
- case "Literal":
187
- {
188
- const literal = ast.literal;
189
- if (literal === null) {
190
- return {
191
- enum: [null],
192
- ...getJsonSchemaAnnotations(ast)
193
- };
194
- } else if (Predicate.isString(literal) || Predicate.isNumber(literal) || Predicate.isBoolean(literal)) {
195
- return {
196
- enum: [literal],
197
- ...getJsonSchemaAnnotations(ast)
198
- };
199
- }
200
- throw new Error(getJSONSchemaMissingAnnotationErrorMessage(path, ast));
201
- }
202
- case "UniqueSymbol":
203
- throw new Error(getJSONSchemaMissingAnnotationErrorMessage(path, ast));
204
- case "UndefinedKeyword":
205
- throw new Error(getJSONSchemaMissingAnnotationErrorMessage(path, ast));
206
- case "VoidKeyword":
207
- return {
208
- ...constVoid,
209
- ...getJsonSchemaAnnotations(ast)
210
- };
211
- case "NeverKeyword":
212
- throw new Error(getJSONSchemaMissingAnnotationErrorMessage(path, ast));
213
- case "UnknownKeyword":
214
- return {
215
- ...constUnknown,
216
- ...getJsonSchemaAnnotations(ast)
217
- };
218
- case "AnyKeyword":
219
- return {
220
- ...constAny,
221
- ...getJsonSchemaAnnotations(ast)
222
- };
223
- case "ObjectKeyword":
224
- return {
225
- ...constAnyObject,
226
- ...getJsonSchemaAnnotations(ast)
227
- };
228
- case "StringKeyword":
229
- return {
230
- type: "string",
231
- ...getASTJsonSchemaAnnotations(ast)
232
- };
233
- case "NumberKeyword":
234
- return {
235
- type: "number",
236
- ...getASTJsonSchemaAnnotations(ast)
237
- };
238
- case "BooleanKeyword":
239
- return {
240
- type: "boolean",
241
- ...getASTJsonSchemaAnnotations(ast)
242
- };
243
- case "BigIntKeyword":
244
- throw new Error(getJSONSchemaMissingAnnotationErrorMessage(path, ast));
245
- case "SymbolKeyword":
246
- throw new Error(getJSONSchemaMissingAnnotationErrorMessage(path, ast));
247
- case "TupleType":
248
- {
249
- const elements = ast.elements.map((e, i) => ({
250
- ...go(e.type, $defs, true, path.concat(i), options),
251
- ...getJsonSchemaAnnotations(e)
252
- }));
253
- const rest = ast.rest.map(annotatedAST => ({
254
- ...go(annotatedAST.type, $defs, true, path, options),
255
- ...getJsonSchemaAnnotations(annotatedAST)
256
- }));
257
- const output = {
258
- type: "array"
259
- };
260
- // ---------------------------------------------
261
- // handle elements
262
- // ---------------------------------------------
263
- const len = ast.elements.length;
264
- if (len > 0) {
265
- output.minItems = len - ast.elements.filter(element => element.isOptional).length;
266
- output.items = elements;
267
- }
268
- // ---------------------------------------------
269
- // handle rest element
270
- // ---------------------------------------------
271
- const restLength = rest.length;
272
- if (restLength > 0) {
273
- const head = rest[0];
274
- const isHomogeneous = restLength === 1 && ast.elements.every(e => e.type === ast.rest[0].type);
275
- if (isHomogeneous) {
276
- output.items = head;
277
- } else {
278
- output.additionalItems = head;
279
- }
280
- // ---------------------------------------------
281
- // handle post rest elements
282
- // ---------------------------------------------
283
- if (restLength > 1) {
284
- throw new Error(getJSONSchemaUnsupportedPostRestElementsErrorMessage(path));
285
- }
286
- } else {
287
- if (len > 0) {
288
- output.additionalItems = false;
289
- } else {
290
- output.maxItems = 0;
291
- }
292
- }
293
- return {
294
- ...output,
295
- ...getJsonSchemaAnnotations(ast)
296
- };
297
- }
298
- case "TypeLiteral":
299
- {
300
- if (ast.propertySignatures.length === 0 && ast.indexSignatures.length === 0) {
301
- return {
302
- ...constEmpty,
303
- ...getJsonSchemaAnnotations(ast)
304
- };
305
- }
306
- let patternProperties = undefined;
307
- let propertyNames = undefined;
308
- for (const is of ast.indexSignatures) {
309
- const parameter = is.parameter;
310
- switch (parameter._tag) {
311
- case "StringKeyword":
312
- {
313
- patternProperties = go(is.type, $defs, true, path, options);
314
- break;
315
- }
316
- case "TemplateLiteral":
317
- {
318
- patternProperties = go(is.type, $defs, true, path, options);
319
- propertyNames = {
320
- type: "string",
321
- pattern: AST.getTemplateLiteralRegExp(parameter).source
322
- };
323
- break;
324
- }
325
- case "Refinement":
326
- {
327
- patternProperties = go(is.type, $defs, true, path, options);
328
- propertyNames = go(parameter, $defs, true, path, options);
329
- break;
330
- }
331
- case "SymbolKeyword":
332
- throw new Error(getJSONSchemaUnsupportedParameterErrorMessage(path, parameter));
333
- }
334
- }
335
- const output = {
336
- type: "object",
337
- required: [],
338
- properties: {},
339
- additionalProperties: false
340
- };
341
- // ---------------------------------------------
342
- // handle property signatures
343
- // ---------------------------------------------
344
- for (let i = 0; i < ast.propertySignatures.length; i++) {
345
- const ps = ast.propertySignatures[i];
346
- const name = ps.name;
347
- if (Predicate.isString(name)) {
348
- const pruned = pruneUndefinedFromPropertySignature(ps.type);
349
- output.properties[name] = {
350
- ...go(pruned ? pruned : ps.type, $defs, true, path.concat(ps.name), options),
351
- ...getJsonSchemaAnnotations(ps)
352
- };
353
- // ---------------------------------------------
354
- // handle optional property signatures
355
- // ---------------------------------------------
356
- if (!ps.isOptional && pruned === undefined) {
357
- output.required.push(name);
358
- }
359
- } else {
360
- throw new Error(getJSONSchemaUnsupportedKeyErrorMessage(name, path));
361
- }
362
- }
363
- // ---------------------------------------------
364
- // handle index signatures
365
- // ---------------------------------------------
366
- if (patternProperties !== undefined) {
367
- delete output.additionalProperties;
368
- output.patternProperties = {
369
- "": patternProperties
370
- };
371
- }
372
- if (propertyNames !== undefined) {
373
- output.propertyNames = propertyNames;
374
- }
375
- return {
376
- ...output,
377
- ...getJsonSchemaAnnotations(ast)
378
- };
379
- }
380
- case "Union":
381
- {
382
- const enums = [];
383
- const anyOf = [];
384
- for (const type of ast.types) {
385
- const schema = go(type, $defs, true, path, options);
386
- if ("enum" in schema) {
387
- if (Object.keys(schema).length > 1) {
388
- anyOf.push(schema);
389
- } else {
390
- for (const e of schema.enum) {
391
- enums.push(e);
392
- }
393
- }
394
- } else {
395
- anyOf.push(schema);
396
- }
397
- }
398
- if (anyOf.length === 0) {
399
- return {
400
- enum: enums,
401
- ...getJsonSchemaAnnotations(ast)
402
- };
403
- } else {
404
- if (enums.length >= 1) {
405
- anyOf.push({
406
- enum: enums
407
- });
408
- }
409
- return {
410
- anyOf,
411
- ...getJsonSchemaAnnotations(ast)
412
- };
413
- }
414
- }
415
- case "Enums":
416
- {
417
- return {
418
- $comment: "/schemas/enums",
419
- anyOf: ast.enums.map(e => ({
420
- title: e[0],
421
- enum: [e[1]]
422
- })),
423
- ...getJsonSchemaAnnotations(ast)
424
- };
425
- }
426
- case "Refinement":
427
- {
428
- if (AST.encodedBoundAST(ast) === ast) {
429
- throw new Error(getJSONSchemaMissingAnnotationErrorMessage(path, ast));
430
- }
431
- return go(ast.from, $defs, true, path, options);
432
- }
433
- case "TemplateLiteral":
434
- {
435
- const regex = AST.getTemplateLiteralRegExp(ast);
436
- return {
437
- type: "string",
438
- description: "a template literal",
439
- pattern: regex.source,
440
- ...getJsonSchemaAnnotations(ast)
441
- };
442
- }
443
- case "Suspend":
444
- {
445
- const identifier = Option.orElse(AST.getJSONIdentifier(ast), () => AST.getJSONIdentifier(ast.f()));
446
- if (Option.isNone(identifier)) {
447
- throw new Error(getJSONSchemaMissingIdentifierAnnotationErrorMessage(path, ast));
448
- }
449
- return {
450
- ...go(ast.f(), $defs, true, path, options),
451
- ...getJsonSchemaAnnotations(ast)
452
- };
453
- }
454
- case "Transformation":
455
- {
456
- // Properly handle S.parseJson transformations by focusing on
457
- // the 'to' side of the AST. This approach prevents the generation of useless schemas
458
- // derived from the 'from' side (type: string), ensuring the output matches the intended
459
- // complex schema type.
460
- if (isParseJsonTransformation(ast.from)) {
461
- return {
462
- type: "string",
463
- contentMediaType: "application/json",
464
- contentSchema: go(ast.to, $defs, true, path, options),
465
- ...getJsonSchemaAnnotations(ast)
466
- };
467
- }
468
- return {
469
- ...getASTJsonSchemaAnnotations(ast.to),
470
- ...go(ast.from, $defs, true, path, options),
471
- ...getJsonSchemaAnnotations(ast)
472
- };
473
- }
474
- }
475
- };
476
- const getJSONSchemaMissingAnnotationErrorMessage = (path, ast) => getMissingAnnotationErrorMessage(`Generating a JSON Schema for this schema requires a "jsonSchema" annotation`, path, ast);
477
- const getJSONSchemaMissingIdentifierAnnotationErrorMessage = (path, ast) => getMissingAnnotationErrorMessage(`Generating a JSON Schema for this schema requires an "identifier" annotation`, path, ast);
478
- const getJSONSchemaUnsupportedParameterErrorMessage = (path, parameter) => getErrorMessage("Unsupported index signature parameter", undefined, path, parameter);
479
- const getJSONSchemaUnsupportedPostRestElementsErrorMessage = path => getErrorMessage("Generating a JSON Schema for post-rest elements is not currently supported. You're welcome to contribute by submitting a Pull Request", undefined, path);
480
- const getJSONSchemaUnsupportedKeyErrorMessage = (key, path) => getErrorMessage("Unsupported key", `Cannot encode ${formatPropertyKey(key)} key to JSON Schema`, path);
481
- const getMissingAnnotationErrorMessage = (details, path, ast) => getErrorMessage("Missing annotation", details, path, ast);
482
- const getErrorMessage = (reason, details, path, ast) => {
483
- let out = reason;
484
- if (path && Arr.isNonEmptyReadonlyArray(path)) {
485
- out += `\nat path: ${formatPath(path)}`;
486
- }
487
- if (details !== undefined) {
488
- out += `\ndetails: ${details}`;
489
- }
490
- if (ast) {
491
- out += `\nschema (${ast._tag}): ${ast}`;
492
- }
493
- return out;
494
39
  };
495
- const formatPathKey = key => `[${formatPropertyKey(key)}]`;
496
- const formatPath = path => isNonEmpty(path) ? path.map(formatPathKey).join("") : formatPathKey(path);
497
- const isNonEmpty = x => Array.isArray(x);
498
- const formatPropertyKey = name => typeof name === "string" ? JSON.stringify(name) : String(name);
499
40
  //# sourceMappingURL=OpenApiJsonSchema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OpenApiJsonSchema.js","names":["Arr","Option","Predicate","Record","AST","make","schema","$defs","out","makeWithDefs","defs","isEmptyRecord","options","defsPath","getRef","id","go","ast","constAny","$id","constUnknown","constVoid","constAnyObject","constEmpty","getJsonSchemaAnnotations","annotated","getSomes","description","getDescriptionAnnotation","title","getTitleAnnotation","examples","getExamplesAnnotation","default","getDefaultAnnotation","removeDefaultJsonSchemaAnnotations","jsonSchemaAnnotations","annotations","TitleAnnotationId","DescriptionAnnotationId","getASTJsonSchemaAnnotations","_tag","stringKeyword","numberKeyword","booleanKeyword","pruneUndefinedFromPropertySignature","isNone","getJSONSchemaAnnotation","types","filter","type","isUndefinedKeyword","length","Union","isParseJsonTransformation","from","to","getRefinementInnerTransformation","f","isRefinement","SchemaIdAnnotationId","ParseJsonSchemaId","isOverrideAnnotation","jsonSchema","handleIdentifier","path","hook","isSome","handler","value","t","undefined","e","surrogate","getSurrogateAnnotation","identifier","getJSONIdentifier","$ref","has","Error","getJSONSchemaMissingAnnotationErrorMessage","literal","enum","isString","isNumber","isBoolean","elements","map","i","concat","rest","annotatedAST","output","len","minItems","element","isOptional","items","restLength","head","isHomogeneous","every","additionalItems","getJSONSchemaUnsupportedPostRestElementsErrorMessage","maxItems","propertySignatures","indexSignatures","patternProperties","propertyNames","is","parameter","pattern","getTemplateLiteralRegExp","source","getJSONSchemaUnsupportedParameterErrorMessage","required","properties","additionalProperties","ps","name","pruned","push","getJSONSchemaUnsupportedKeyErrorMessage","enums","anyOf","Object","keys","$comment","encodedBoundAST","regex","orElse","getJSONSchemaMissingIdentifierAnnotationErrorMessage","contentMediaType","contentSchema","getMissingAnnotationErrorMessage","getErrorMessage","key","formatPropertyKey","details","reason","isNonEmptyReadonlyArray","formatPath","formatPathKey","isNonEmpty","join","x","Array","isArray","JSON","stringify","String"],"sources":["../../src/OpenApiJsonSchema.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAGA,OAAO,KAA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AACC,SAAS,CAAC9B,IAAI,CAAC,GAAG+B,MAAM,CAAC/B,IAAI,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"OpenApiJsonSchema.js","names":["JSONSchema","Record","make","schema","defs","out","makeWithDefs","isEmptyRecord","$defs","options","fromAST","ast","definitions","definitionPath","defsPath","target","topLevelReferenceStrategy"],"sources":["../../src/OpenApiJsonSchema.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAGA,OAAO,KAAKA,UAAU,MAAM,mBAAmB;AAC/C,OAAO,KAAKC,MAAM,MAAM,eAAe;AAkOvC;;;;AAIA,OAAO,MAAMC,IAAI,GAAaC,MAA8B,IAAU;EACpE,MAAMC,IAAI,GAA+B,EAAE;EAC3C,MAAMC,GAAG,GAASC,YAAY,CAACH,MAAM,EAAE;IAAEC;EAAI,CAAE,CAAC;EAChD,IAAI,CAACH,MAAM,CAACM,aAAa,CAACH,IAAI,CAAC,EAAE;IAC/BC,GAAG,CAACG,KAAK,GAAGJ,IAAI;EAClB;EACA,OAAOC,GAAG;AACZ,CAAC;AAED;;;;;;;;;;;;AAYA,OAAO,MAAMC,YAAY,GAAGA,CAAUH,MAA8B,EAAEM,OAIrE,KAAgB;EACf,OAAOT,UAAU,CAACU,OAAO,CAACP,MAAM,CAACQ,GAAG,EAAE;IACpCC,WAAW,EAAEH,OAAO,CAACL,IAAI;IACzBS,cAAc,EAAEJ,OAAO,CAACK,QAAQ,IAAI,uBAAuB;IAC3DC,MAAM,EAAE,YAAY;IACpBC,yBAAyB,EAAEP,OAAO,CAACO,yBAAyB,IAAI;GACjE,CAAC;AACJ,CAAC","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effect/platform",
3
- "version": "0.70.6",
3
+ "version": "0.70.7",
4
4
  "description": "Unified interfaces for common platform-specific services",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -14,7 +14,7 @@
14
14
  "multipasta": "^0.2.5"
15
15
  },
16
16
  "peerDependencies": {
17
- "effect": "^3.11.4"
17
+ "effect": "^3.11.5"
18
18
  },
19
19
  "publishConfig": {
20
20
  "provenance": true
package/src/OpenApi.ts CHANGED
@@ -171,8 +171,7 @@ export const fromApi = <A extends HttpApi.HttpApi.Any>(self: A): OpenAPISpec =>
171
171
  }
172
172
  function makeJsonSchemaOrRef(schema: Schema.Schema.All): JsonSchema.JsonSchema {
173
173
  return JsonSchema.makeWithDefs(schema as any, {
174
- defs: jsonSchemaDefs,
175
- defsPath: "#/components/schemas/"
174
+ defs: jsonSchemaDefs
176
175
  })
177
176
  }
178
177
  function registerSecurity(