@travetto/openapi 6.0.0-rc.6 → 6.0.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.
- package/package.json +5 -5
- package/src/spec-generate.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/openapi",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.1",
|
|
4
4
|
"description": "OpenAPI integration support for the Travetto framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web",
|
|
@@ -26,14 +26,14 @@
|
|
|
26
26
|
"directory": "module/openapi"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@travetto/config": "^6.0.0
|
|
30
|
-
"@travetto/schema": "^6.0.0
|
|
31
|
-
"@travetto/web": "^6.0.
|
|
29
|
+
"@travetto/config": "^6.0.0",
|
|
30
|
+
"@travetto/schema": "^6.0.0",
|
|
31
|
+
"@travetto/web": "^6.0.1",
|
|
32
32
|
"openapi3-ts": "^4.4.0",
|
|
33
33
|
"yaml": "^2.7.1"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@travetto/cli": "^6.0.0
|
|
36
|
+
"@travetto/cli": "^6.0.0"
|
|
37
37
|
},
|
|
38
38
|
"peerDependenciesMeta": {
|
|
39
39
|
"@travetto/cli": {
|
package/src/spec-generate.ts
CHANGED
|
@@ -267,7 +267,7 @@ export class OpenapiVisitor implements ControllerVisitor<GeneratedSpec> {
|
|
|
267
267
|
const complex = field.type && SchemaRegistry.has(field.type);
|
|
268
268
|
if (param.location) {
|
|
269
269
|
if (param.location === 'body') {
|
|
270
|
-
const acceptsMime = ep.
|
|
270
|
+
const acceptsMime = ep.finalizedResponseHeaders.get('accepts');
|
|
271
271
|
return {
|
|
272
272
|
requestBody: field.specifiers?.includes('file') ? this.#buildUploadBody() : this.#getEndpointBody(field, acceptsMime)
|
|
273
273
|
};
|
|
@@ -305,7 +305,7 @@ export class OpenapiVisitor implements ControllerVisitor<GeneratedSpec> {
|
|
|
305
305
|
parameters: []
|
|
306
306
|
};
|
|
307
307
|
|
|
308
|
-
const contentTypeMime = ep.
|
|
308
|
+
const contentTypeMime = ep.finalizedResponseHeaders.get('content-type');
|
|
309
309
|
const pConf = this.#getEndpointBody(ep.responseType, contentTypeMime);
|
|
310
310
|
const code = Object.keys(pConf.content).length ? 200 : 201;
|
|
311
311
|
op.responses![code] = pConf;
|