zod-openapi 3.1.0 → 3.1.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.
|
@@ -1436,7 +1436,7 @@ const createBaseParameter = (schema, components, subpath, documentOptions) => {
|
|
|
1436
1436
|
...required && { required }
|
|
1437
1437
|
};
|
|
1438
1438
|
};
|
|
1439
|
-
const createParamOrRef = (zodSchema, components, subpath,
|
|
1439
|
+
const createParamOrRef = (zodSchema, components, subpath, type, name, documentOptions) => {
|
|
1440
1440
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
1441
1441
|
const component = components.parameters.get(zodSchema);
|
|
1442
1442
|
const paramType = ((_c = (_b = (_a = zodSchema._def) == null ? void 0 : _a.openapi) == null ? void 0 : _b.param) == null ? void 0 : _c.in) ?? (component == null ? void 0 : component.in) ?? type;
|
|
@@ -1494,9 +1494,9 @@ const createParameters = (type, zodObjectType, components, subpath, documentOpti
|
|
|
1494
1494
|
zodSchema,
|
|
1495
1495
|
components,
|
|
1496
1496
|
[...subpath, key],
|
|
1497
|
-
documentOptions,
|
|
1498
1497
|
type,
|
|
1499
|
-
key
|
|
1498
|
+
key,
|
|
1499
|
+
documentOptions
|
|
1500
1500
|
)
|
|
1501
1501
|
);
|
|
1502
1502
|
};
|
|
@@ -1540,6 +1540,8 @@ const createManualParameters = (parameters, components, subpath, documentOptions
|
|
|
1540
1540
|
param,
|
|
1541
1541
|
components,
|
|
1542
1542
|
[...subpath, `param index ${index}`],
|
|
1543
|
+
void 0,
|
|
1544
|
+
void 0,
|
|
1543
1545
|
documentOptions
|
|
1544
1546
|
);
|
|
1545
1547
|
}
|
|
@@ -2087,9 +2089,9 @@ const createParamComponents = (componentsObject, components, documentOptions) =>
|
|
|
2087
2089
|
schema,
|
|
2088
2090
|
components,
|
|
2089
2091
|
[`component parameter index ${index}`],
|
|
2090
|
-
documentOptions,
|
|
2091
2092
|
component.in,
|
|
2092
|
-
component.ref
|
|
2093
|
+
component.ref,
|
|
2094
|
+
documentOptions
|
|
2093
2095
|
);
|
|
2094
2096
|
}
|
|
2095
2097
|
});
|
|
@@ -1435,7 +1435,7 @@ const createBaseParameter = (schema, components, subpath, documentOptions) => {
|
|
|
1435
1435
|
...required && { required }
|
|
1436
1436
|
};
|
|
1437
1437
|
};
|
|
1438
|
-
const createParamOrRef = (zodSchema, components, subpath,
|
|
1438
|
+
const createParamOrRef = (zodSchema, components, subpath, type, name, documentOptions) => {
|
|
1439
1439
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
1440
1440
|
const component = components.parameters.get(zodSchema);
|
|
1441
1441
|
const paramType = ((_c = (_b = (_a = zodSchema._def) == null ? void 0 : _a.openapi) == null ? void 0 : _b.param) == null ? void 0 : _c.in) ?? (component == null ? void 0 : component.in) ?? type;
|
|
@@ -1493,9 +1493,9 @@ const createParameters = (type, zodObjectType, components, subpath, documentOpti
|
|
|
1493
1493
|
zodSchema,
|
|
1494
1494
|
components,
|
|
1495
1495
|
[...subpath, key],
|
|
1496
|
-
documentOptions,
|
|
1497
1496
|
type,
|
|
1498
|
-
key
|
|
1497
|
+
key,
|
|
1498
|
+
documentOptions
|
|
1499
1499
|
)
|
|
1500
1500
|
);
|
|
1501
1501
|
};
|
|
@@ -1539,6 +1539,8 @@ const createManualParameters = (parameters, components, subpath, documentOptions
|
|
|
1539
1539
|
param,
|
|
1540
1540
|
components,
|
|
1541
1541
|
[...subpath, `param index ${index}`],
|
|
1542
|
+
void 0,
|
|
1543
|
+
void 0,
|
|
1542
1544
|
documentOptions
|
|
1543
1545
|
);
|
|
1544
1546
|
}
|
|
@@ -2086,9 +2088,9 @@ const createParamComponents = (componentsObject, components, documentOptions) =>
|
|
|
2086
2088
|
schema,
|
|
2087
2089
|
components,
|
|
2088
2090
|
[`component parameter index ${index}`],
|
|
2089
|
-
documentOptions,
|
|
2090
2091
|
component.in,
|
|
2091
|
-
component.ref
|
|
2092
|
+
component.ref,
|
|
2093
|
+
documentOptions
|
|
2092
2094
|
);
|
|
2093
2095
|
}
|
|
2094
2096
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ZodType } from 'zod';
|
|
2
2
|
import { ParameterObject, ReferenceObject } from '../openapi3-ts/dist/model/openapi31.js';
|
|
3
3
|
import { ComponentsObject } from './components.js';
|
|
4
|
-
import {
|
|
4
|
+
import { ZodOpenApiParameters, CreateDocumentOptions } from './document.js';
|
|
5
5
|
|
|
6
|
-
declare const createParamOrRef: (zodSchema: ZodType, components: ComponentsObject, subpath: string[],
|
|
6
|
+
declare const createParamOrRef: (zodSchema: ZodType, components: ComponentsObject, subpath: string[], type?: keyof ZodOpenApiParameters, name?: string, documentOptions?: CreateDocumentOptions) => ParameterObject | ReferenceObject;
|
|
7
7
|
|
|
8
8
|
export { createParamOrRef };
|