@orpc/openapi 1.7.7 → 1.7.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.
package/dist/index.mjs
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { c as customOpenAPIOperation } from './shared/openapi.
|
2
|
-
export { C as CompositeSchemaConverter, L as LOGIC_KEYWORDS, O as OpenAPIGenerator, a as applyCustomOpenAPIOperation, n as applySchemaOptionality, h as checkParamsSchema, p as expandArrayableSchema, o as expandUnionSchema, m as filterSchemaBranches, g as getCustomOpenAPIOperation, l as isAnySchema, j as isFileSchema, k as isObjectSchema, q as isPrimitiveSchema, r as resolveOpenAPIJsonSchemaRef, s as separateObjectSchema, d as toOpenAPIContent, e as toOpenAPIEventIteratorContent, b as toOpenAPIMethod, f as toOpenAPIParameters, t as toOpenAPIPath, i as toOpenAPISchema } from './shared/openapi.
|
1
|
+
import { c as customOpenAPIOperation } from './shared/openapi.C4JezVzx.mjs';
|
2
|
+
export { C as CompositeSchemaConverter, L as LOGIC_KEYWORDS, O as OpenAPIGenerator, a as applyCustomOpenAPIOperation, n as applySchemaOptionality, h as checkParamsSchema, p as expandArrayableSchema, o as expandUnionSchema, m as filterSchemaBranches, g as getCustomOpenAPIOperation, l as isAnySchema, j as isFileSchema, k as isObjectSchema, q as isPrimitiveSchema, r as resolveOpenAPIJsonSchemaRef, s as separateObjectSchema, d as toOpenAPIContent, e as toOpenAPIEventIteratorContent, b as toOpenAPIMethod, f as toOpenAPIParameters, t as toOpenAPIPath, i as toOpenAPISchema } from './shared/openapi.C4JezVzx.mjs';
|
3
3
|
import { createORPCErrorFromJson } from '@orpc/client';
|
4
4
|
import { StandardOpenAPISerializer, StandardOpenAPIJsonSerializer, StandardBracketNotationSerializer } from '@orpc/openapi-client/standard';
|
5
5
|
import { ORPCError, createRouterClient } from '@orpc/server';
|
package/dist/plugins/index.mjs
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { stringifyJSON, once, value } from '@orpc/shared';
|
2
|
-
import { O as OpenAPIGenerator } from '../shared/openapi.
|
2
|
+
import { O as OpenAPIGenerator } from '../shared/openapi.C4JezVzx.mjs';
|
3
3
|
import '@orpc/client';
|
4
4
|
import '@orpc/client/standard';
|
5
5
|
import '@orpc/contract';
|
@@ -411,17 +411,17 @@ class OpenAPIGenerator {
|
|
411
411
|
});
|
412
412
|
const errors = [];
|
413
413
|
for (const { contract, path } of contracts) {
|
414
|
-
const
|
414
|
+
const stringPath = path.join(".");
|
415
415
|
try {
|
416
416
|
const def = contract["~orpc"];
|
417
417
|
const method = toOpenAPIMethod(fallbackContractConfig("defaultMethod", def.route.method));
|
418
418
|
const httpPath = toOpenAPIPath(def.route.path ?? toHttpPath(path));
|
419
419
|
let operationObjectRef;
|
420
|
-
if (def.route.spec !== void 0) {
|
420
|
+
if (def.route.spec !== void 0 && typeof def.route.spec !== "function") {
|
421
421
|
operationObjectRef = def.route.spec;
|
422
422
|
} else {
|
423
423
|
operationObjectRef = {
|
424
|
-
operationId,
|
424
|
+
operationId: def.route.operationId ?? stringPath,
|
425
425
|
summary: def.route.summary,
|
426
426
|
description: def.route.description,
|
427
427
|
deprecated: def.route.deprecated,
|
@@ -431,6 +431,9 @@ class OpenAPIGenerator {
|
|
431
431
|
await this.#successResponse(doc, operationObjectRef, def, baseSchemaConvertOptions);
|
432
432
|
await this.#errorResponse(operationObjectRef, def, baseSchemaConvertOptions, undefinedErrorJsonSchema);
|
433
433
|
}
|
434
|
+
if (typeof def.route.spec === "function") {
|
435
|
+
operationObjectRef = def.route.spec(operationObjectRef);
|
436
|
+
}
|
434
437
|
doc.paths ??= {};
|
435
438
|
doc.paths[httpPath] ??= {};
|
436
439
|
doc.paths[httpPath][method] = applyCustomOpenAPIOperation(operationObjectRef, contract);
|
@@ -439,7 +442,7 @@ class OpenAPIGenerator {
|
|
439
442
|
throw e;
|
440
443
|
}
|
441
444
|
errors.push(
|
442
|
-
`[OpenAPIGenerator] Error occurred while generating OpenAPI for procedure at path: ${
|
445
|
+
`[OpenAPIGenerator] Error occurred while generating OpenAPI for procedure at path: ${stringPath}
|
443
446
|
${e.message}`
|
444
447
|
);
|
445
448
|
}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@orpc/openapi",
|
3
3
|
"type": "module",
|
4
|
-
"version": "1.7.
|
4
|
+
"version": "1.7.9",
|
5
5
|
"license": "MIT",
|
6
6
|
"homepage": "https://orpc.unnoq.com",
|
7
7
|
"repository": {
|
@@ -51,12 +51,12 @@
|
|
51
51
|
"dependencies": {
|
52
52
|
"json-schema-typed": "^8.0.1",
|
53
53
|
"rou3": "^0.7.3",
|
54
|
-
"@orpc/client": "1.7.
|
55
|
-
"@orpc/contract": "1.7.
|
56
|
-
"@orpc/
|
57
|
-
"@orpc/
|
58
|
-
"@orpc/
|
59
|
-
"@orpc/standard-server": "1.7.
|
54
|
+
"@orpc/client": "1.7.9",
|
55
|
+
"@orpc/contract": "1.7.9",
|
56
|
+
"@orpc/openapi-client": "1.7.9",
|
57
|
+
"@orpc/server": "1.7.9",
|
58
|
+
"@orpc/shared": "1.7.9",
|
59
|
+
"@orpc/standard-server": "1.7.9"
|
60
60
|
},
|
61
61
|
"devDependencies": {
|
62
62
|
"zod": "^4.0.14"
|