@tahminator/sapling 2.0.5-beta.8f108a3e → 2.0.5-beta.aa3623ee

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 CHANGED
@@ -552,14 +552,14 @@ var OpenAPIGenerator = class {
552
552
  if (!paths[openApiPath]) paths[openApiPath] = {};
553
553
  const responses = {};
554
554
  if (schemas?.responseBody) {
555
- const responseSchema = this.toJsonSchema(schemas.responseBody, "output");
555
+ const responseSchema = this.toJsonSchema(schemas.responseBody, "input");
556
556
  responses["200"] = {
557
557
  description: responseSchema.description ?? "Successful response",
558
558
  content: { "application/json": { schema: responseSchema } }
559
559
  };
560
560
  } else responses["200"] = { description: "Successful response" };
561
561
  if (routeSchema?.responses) for (const resp of routeSchema.responses) {
562
- const responseSchema = this.toJsonSchema(resp.schema, "output");
562
+ const responseSchema = this.toJsonSchema(resp.schema, "input");
563
563
  responses[String(resp.statusCode)] = {
564
564
  description: responseSchema.description ?? `Response ${resp.statusCode}`,
565
565
  content: { "application/json": { schema: responseSchema } }
package/dist/index.mjs CHANGED
@@ -527,14 +527,14 @@ var OpenAPIGenerator = class {
527
527
  if (!paths[openApiPath]) paths[openApiPath] = {};
528
528
  const responses = {};
529
529
  if (schemas?.responseBody) {
530
- const responseSchema = this.toJsonSchema(schemas.responseBody, "output");
530
+ const responseSchema = this.toJsonSchema(schemas.responseBody, "input");
531
531
  responses["200"] = {
532
532
  description: responseSchema.description ?? "Successful response",
533
533
  content: { "application/json": { schema: responseSchema } }
534
534
  };
535
535
  } else responses["200"] = { description: "Successful response" };
536
536
  if (routeSchema?.responses) for (const resp of routeSchema.responses) {
537
- const responseSchema = this.toJsonSchema(resp.schema, "output");
537
+ const responseSchema = this.toJsonSchema(resp.schema, "input");
538
538
  responses[String(resp.statusCode)] = {
539
539
  description: responseSchema.description ?? `Response ${resp.statusCode}`,
540
540
  content: { "application/json": { schema: responseSchema } }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tahminator/sapling",
3
- "version": "2.0.5-beta.8f108a3e",
3
+ "version": "2.0.5-beta.aa3623ee",
4
4
  "author": "Tahmid Ahmed",
5
5
  "description": "A library to help you write cleaner Express.js code",
6
6
  "repository": {