@standard-community/standard-openapi 0.2.5 → 0.2.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.
package/dist/index.cjs CHANGED
@@ -19,6 +19,7 @@ const getToOpenAPISchemaFn = async (vendor) => {
19
19
  break;
20
20
  case "arktype":
21
21
  case "effect":
22
+ case "typebox":
22
23
  vendorFn = (await Promise.resolve().then(function () { return require('./default-DyJyARWC.cjs'); })).default();
23
24
  break;
24
25
  default:
package/dist/index.js CHANGED
@@ -15,6 +15,7 @@ const getToOpenAPISchemaFn = async (vendor) => {
15
15
  break;
16
16
  case "arktype":
17
17
  case "effect":
18
+ case "typebox":
18
19
  vendorFn = (await import('./default-u_dwuiYb.js')).default();
19
20
  break;
20
21
  default:
@@ -65,14 +65,15 @@ function convertToOpenAPISchema(jsonSchema, context) {
65
65
  }
66
66
  }
67
67
  });
68
- if (_jsonSchema.ref) {
69
- const { ref, ...component } = _jsonSchema;
68
+ if (_jsonSchema.ref || _jsonSchema.$id) {
69
+ const { ref, $id, ...component } = _jsonSchema;
70
+ const id = ref || $id;
70
71
  context.components.schemas = {
71
72
  ...context.components.schemas,
72
- [ref]: component
73
+ [id]: component
73
74
  };
74
75
  return {
75
- $ref: `#/components/schemas/${ref}`
76
+ $ref: `#/components/schemas/${id}`
76
77
  };
77
78
  } else if (_jsonSchema.$ref) {
78
79
  const { $ref, $defs } = _jsonSchema;
@@ -63,14 +63,15 @@ function convertToOpenAPISchema(jsonSchema, context) {
63
63
  }
64
64
  }
65
65
  });
66
- if (_jsonSchema.ref) {
67
- const { ref, ...component } = _jsonSchema;
66
+ if (_jsonSchema.ref || _jsonSchema.$id) {
67
+ const { ref, $id, ...component } = _jsonSchema;
68
+ const id = ref || $id;
68
69
  context.components.schemas = {
69
70
  ...context.components.schemas,
70
- [ref]: component
71
+ [id]: component
71
72
  };
72
73
  return {
73
- $ref: `#/components/schemas/${ref}`
74
+ $ref: `#/components/schemas/${id}`
74
75
  };
75
76
  } else if (_jsonSchema.$ref) {
76
77
  const { $ref, $defs } = _jsonSchema;
@@ -6,6 +6,7 @@ var convert = require('./convert.cjs');
6
6
  function getToOpenAPISchemaFn() {
7
7
  return async (schema, context) => {
8
8
  const openapiSchema = await standardJson.toJsonSchema(schema, {
9
+ errorMode: "ignore",
9
10
  // @ts-expect-error
10
11
  overrideAction: ({ valibotAction, jsonSchema }) => {
11
12
  const _jsonSchema = convert.convertToOpenAPISchema(jsonSchema, context);
@@ -4,6 +4,7 @@ import { convertToOpenAPISchema } from './convert.js';
4
4
  function getToOpenAPISchemaFn() {
5
5
  return async (schema, context) => {
6
6
  const openapiSchema = await toJsonSchema(schema, {
7
+ errorMode: "ignore",
7
8
  // @ts-expect-error
8
9
  overrideAction: ({ valibotAction, jsonSchema }) => {
9
10
  const _jsonSchema = convertToOpenAPISchema(jsonSchema, context);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@standard-community/standard-openapi",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.cjs",
@@ -71,11 +71,12 @@
71
71
  }
72
72
  },
73
73
  "peerDependencies": {
74
- "@standard-community/standard-json": "^0.3.1",
74
+ "@standard-community/standard-json": "^0.3.4",
75
75
  "@standard-schema/spec": "^1.0.0",
76
76
  "arktype": "^2.1.20",
77
77
  "effect": "^3.17.14",
78
78
  "openapi-types": "^12.1.3",
79
+ "typebox": "^1.0.0",
79
80
  "valibot": "^1.1.0",
80
81
  "zod": "^3.25.0 || ^4.0.0",
81
82
  "zod-openapi": "^4"
@@ -87,6 +88,9 @@
87
88
  "effect": {
88
89
  "optional": true
89
90
  },
91
+ "typebox": {
92
+ "optional": true
93
+ },
90
94
  "valibot": {
91
95
  "optional": true
92
96
  },