apeframework 0.0.0-dev.39 → 0.0.0-dev.40

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.
@@ -1,5 +1,6 @@
1
1
  import type { OpenAPIV3 } from 'openapi-types';
2
2
  interface Schema {
3
+ contentType?: string;
3
4
  params?: OpenAPIV3.SchemaObject;
4
5
  query?: OpenAPIV3.SchemaObject;
5
6
  headers?: OpenAPIV3.SchemaObject;
@@ -77,11 +77,24 @@ class Server {
77
77
  schema: {
78
78
  summary: route.name ?? route.path,
79
79
  description: route.description,
80
- ...route.schema.params ? { params: route.schema.params } : {},
81
- ...route.schema.query ? { query: route.schema.query } : {},
82
- ...route.schema.headers ? { headers: route.schema.headers } : {},
83
- ...route.schema.body ? { body: route.schema.body } : {},
84
- ...route.schema.response ? { response: route.schema.response } : {},
80
+ ...route.schema.contentType
81
+ ? { consumes: [route.schema.contentType] }
82
+ : {},
83
+ ...route.schema.params
84
+ ? { params: route.schema.params }
85
+ : {},
86
+ ...route.schema.query
87
+ ? { query: route.schema.query }
88
+ : {},
89
+ ...route.schema.headers
90
+ ? { headers: route.schema.headers }
91
+ : {},
92
+ ...route.schema.body
93
+ ? { body: route.schema.body }
94
+ : {},
95
+ ...route.schema.response
96
+ ? { response: route.schema.response }
97
+ : {},
85
98
  },
86
99
  handler: route.handler,
87
100
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apeframework",
3
- "version": "0.0.0-dev.39",
3
+ "version": "0.0.0-dev.40",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },