@standard-community/standard-openapi 0.2.4 → 0.2.5

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.
@@ -74,6 +74,16 @@ function convertToOpenAPISchema(jsonSchema, context) {
74
74
  return {
75
75
  $ref: `#/components/schemas/${ref}`
76
76
  };
77
+ } else if (_jsonSchema.$ref) {
78
+ const { $ref, $defs } = _jsonSchema;
79
+ const EFFECT_DEFS_PREFIX = "#/$defs/";
80
+ context.components.schemas = {
81
+ ...context.components.schemas,
82
+ ...$defs
83
+ };
84
+ return {
85
+ $ref: `#/components/schemas/${$ref.slice(EFFECT_DEFS_PREFIX.length)}`
86
+ };
77
87
  }
78
88
  return _jsonSchema;
79
89
  }
@@ -72,6 +72,16 @@ function convertToOpenAPISchema(jsonSchema, context) {
72
72
  return {
73
73
  $ref: `#/components/schemas/${ref}`
74
74
  };
75
+ } else if (_jsonSchema.$ref) {
76
+ const { $ref, $defs } = _jsonSchema;
77
+ const EFFECT_DEFS_PREFIX = "#/$defs/";
78
+ context.components.schemas = {
79
+ ...context.components.schemas,
80
+ ...$defs
81
+ };
82
+ return {
83
+ $ref: `#/components/schemas/${$ref.slice(EFFECT_DEFS_PREFIX.length)}`
84
+ };
75
85
  }
76
86
  return _jsonSchema;
77
87
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@standard-community/standard-openapi",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.cjs",
@@ -74,6 +74,7 @@
74
74
  "@standard-community/standard-json": "^0.3.1",
75
75
  "@standard-schema/spec": "^1.0.0",
76
76
  "arktype": "^2.1.20",
77
+ "effect": "^3.17.14",
77
78
  "openapi-types": "^12.1.3",
78
79
  "valibot": "^1.1.0",
79
80
  "zod": "^3.25.0 || ^4.0.0",
@@ -83,6 +84,9 @@
83
84
  "arktype": {
84
85
  "optional": true
85
86
  },
87
+ "effect": {
88
+ "optional": true
89
+ },
86
90
  "valibot": {
87
91
  "optional": true
88
92
  },