@standard-community/standard-openapi 0.2.8 → 0.2.9

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.
@@ -77,13 +77,13 @@ function convertToOpenAPISchema(jsonSchema, context) {
77
77
  };
78
78
  } else if (_jsonSchema.$ref) {
79
79
  const { $ref, $defs } = _jsonSchema;
80
- const EFFECT_DEFS_PREFIX = "#/$defs/";
80
+ const ref = $ref.split("/").pop();
81
81
  context.components.schemas = {
82
82
  ...context.components.schemas,
83
83
  ...$defs
84
84
  };
85
85
  return {
86
- $ref: `#/components/schemas/${$ref.slice(EFFECT_DEFS_PREFIX.length)}`
86
+ $ref: `#/components/schemas/${ref}`
87
87
  };
88
88
  }
89
89
  return _jsonSchema;
@@ -75,13 +75,13 @@ function convertToOpenAPISchema(jsonSchema, context) {
75
75
  };
76
76
  } else if (_jsonSchema.$ref) {
77
77
  const { $ref, $defs } = _jsonSchema;
78
- const EFFECT_DEFS_PREFIX = "#/$defs/";
78
+ const ref = $ref.split("/").pop();
79
79
  context.components.schemas = {
80
80
  ...context.components.schemas,
81
81
  ...$defs
82
82
  };
83
83
  return {
84
- $ref: `#/components/schemas/${$ref.slice(EFFECT_DEFS_PREFIX.length)}`
84
+ $ref: `#/components/schemas/${ref}`
85
85
  };
86
86
  }
87
87
  return _jsonSchema;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@standard-community/standard-openapi",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.cjs",