transit-kit 0.6.1 → 0.6.3

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.
@@ -17,7 +17,7 @@ function extractPathAndParameters(path) {
17
17
  return { openApiPath, parameters };
18
18
  }
19
19
  function extractQueryParameters(querySchema) {
20
- const querySchemaObject = z.toJSONSchema(querySchema);
20
+ const querySchemaObject = z.toJSONSchema(querySchema, { io: "input" });
21
21
  if (querySchemaObject.properties) {
22
22
  return Object.entries(querySchemaObject.properties).map(([name, schema]) => ({
23
23
  name: name,
@@ -63,7 +63,9 @@ function translateToOpenAPIPathItem(definition) {
63
63
  required: true,
64
64
  content: {
65
65
  "application/json": {
66
- schema: z.toJSONSchema(requestBodySchema), // Type assertion
66
+ schema: z.toJSONSchema(requestBodySchema, {
67
+ io: "input",
68
+ }), // Type assertion
67
69
  },
68
70
  },
69
71
  },
@@ -74,7 +76,7 @@ function translateToOpenAPIPathItem(definition) {
74
76
  .map(([statusCode, responseDef]) => {
75
77
  if (isJsonResponseSchema(responseDef)) {
76
78
  const zodSchema = responseDef.dataSchema;
77
- const responseSchema = z.toJSONSchema(zodSchema);
79
+ const responseSchema = z.toJSONSchema(zodSchema, { io: "input" });
78
80
  return {
79
81
  [statusCode]: {
80
82
  description: `Response for status code ${statusCode}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "transit-kit",
3
- "version": "0.6.1",
3
+ "version": "0.6.3",
4
4
  "description": "A declarative TypeScript framework for building type-safe Express.js APIs with automatic OpenAPI generation",
5
5
  "keywords": [
6
6
  "express",