@tahminator/sapling 2.0.5-beta.aa3623ee → 2.0.5-beta.ac279593

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,16 +552,16 @@ 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, "input");
555
+ const responseSchema = this.toJsonSchema(schemas.responseBody, "output");
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, "input");
562
+ const responseSchema = this.toJsonSchema(resp.schema, "output");
563
563
  responses[String(resp.statusCode)] = {
564
- description: responseSchema.description ?? `Response ${resp.statusCode}`,
564
+ description: resp.description ?? responseSchema.description ?? `Response ${resp.statusCode}`,
565
565
  content: { "application/json": { schema: responseSchema } }
566
566
  };
567
567
  }
package/dist/index.d.cts CHANGED
@@ -892,6 +892,7 @@ declare function _setOnce(def: ValidatorSchema, key: keyof ValidatorSchema, sche
892
892
  //#region src/annotation/schema.d.ts
893
893
  type ResponseSchema = {
894
894
  statusCode: HttpStatus;
895
+ description?: string;
895
896
  schema: StandardSchemaV1 & StandardJSONSchemaV1;
896
897
  };
897
898
  type RouteSchemaDefinition = {
package/dist/index.d.mts CHANGED
@@ -892,6 +892,7 @@ declare function _setOnce(def: ValidatorSchema, key: keyof ValidatorSchema, sche
892
892
  //#region src/annotation/schema.d.ts
893
893
  type ResponseSchema = {
894
894
  statusCode: HttpStatus;
895
+ description?: string;
895
896
  schema: StandardSchemaV1 & StandardJSONSchemaV1;
896
897
  };
897
898
  type RouteSchemaDefinition = {
package/dist/index.mjs CHANGED
@@ -527,16 +527,16 @@ 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, "input");
530
+ const responseSchema = this.toJsonSchema(schemas.responseBody, "output");
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, "input");
537
+ const responseSchema = this.toJsonSchema(resp.schema, "output");
538
538
  responses[String(resp.statusCode)] = {
539
- description: responseSchema.description ?? `Response ${resp.statusCode}`,
539
+ description: resp.description ?? responseSchema.description ?? `Response ${resp.statusCode}`,
540
540
  content: { "application/json": { schema: responseSchema } }
541
541
  };
542
542
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tahminator/sapling",
3
- "version": "2.0.5-beta.aa3623ee",
3
+ "version": "2.0.5-beta.ac279593",
4
4
  "author": "Tahmid Ahmed",
5
5
  "description": "A library to help you write cleaner Express.js code",
6
6
  "repository": {