@ttoss/http-server-mcp-openapi 0.2.0 → 0.2.1
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 +4 -1
- package/dist/index.mjs +4 -1
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -45,6 +45,7 @@ var dereferenceValue = args => {
|
|
|
45
45
|
const refName = obj.$ref.replace("#/components/schemas/", "");
|
|
46
46
|
if (seenRefs.has(refName)) return {};
|
|
47
47
|
const resolved = spec.components?.schemas?.[refName];
|
|
48
|
+
if (resolved === void 0) return {};
|
|
48
49
|
return dereferenceValue({
|
|
49
50
|
value: resolved,
|
|
50
51
|
spec,
|
|
@@ -236,7 +237,9 @@ var buildInputSchema = (pathParams, queryParams, bodyProps) => {
|
|
|
236
237
|
return {
|
|
237
238
|
type: "object",
|
|
238
239
|
properties,
|
|
239
|
-
|
|
240
|
+
...(requiredFields.length > 0 ? {
|
|
241
|
+
required: requiredFields
|
|
242
|
+
} : {})
|
|
240
243
|
};
|
|
241
244
|
};
|
|
242
245
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -42,6 +42,7 @@ var dereferenceValue = args => {
|
|
|
42
42
|
const refName = obj.$ref.replace("#/components/schemas/", "");
|
|
43
43
|
if (seenRefs.has(refName)) return {};
|
|
44
44
|
const resolved = spec.components?.schemas?.[refName];
|
|
45
|
+
if (resolved === void 0) return {};
|
|
45
46
|
return dereferenceValue({
|
|
46
47
|
value: resolved,
|
|
47
48
|
spec,
|
|
@@ -233,7 +234,9 @@ var buildInputSchema = (pathParams, queryParams, bodyProps) => {
|
|
|
233
234
|
return {
|
|
234
235
|
type: "object",
|
|
235
236
|
properties,
|
|
236
|
-
|
|
237
|
+
...(requiredFields.length > 0 ? {
|
|
238
|
+
required: requiredFields
|
|
239
|
+
} : {})
|
|
237
240
|
};
|
|
238
241
|
};
|
|
239
242
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/http-server-mcp-openapi",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Generate Model Context Protocol (MCP) tools from an OpenAPI specification for @ttoss/http-server-mcp",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"@ttoss/http-server-mcp": "^0.24.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
+
"@modelcontextprotocol/server": "^2.0.0",
|
|
41
42
|
"jest": "^30.4.2",
|
|
42
43
|
"supertest": "^7.2.2",
|
|
43
44
|
"tsdown": "^0.22.2",
|