@travetto/openapi 3.1.14 → 3.1.15
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 +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/openapi",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.15",
|
|
4
4
|
"description": "OpenAPI integration support for the Travetto framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rest",
|
|
@@ -26,14 +26,14 @@
|
|
|
26
26
|
"directory": "module/openapi"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@travetto/config": "^3.1.
|
|
30
|
-
"@travetto/rest": "^3.1.
|
|
31
|
-
"@travetto/schema": "^3.1.
|
|
29
|
+
"@travetto/config": "^3.1.8",
|
|
30
|
+
"@travetto/rest": "^3.1.11",
|
|
31
|
+
"@travetto/schema": "^3.1.8",
|
|
32
32
|
"@travetto/yaml": "^3.1.3",
|
|
33
33
|
"openapi3-ts": "^3.2.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@travetto/cli": "^3.1.
|
|
36
|
+
"@travetto/cli": "^3.1.9",
|
|
37
37
|
"@travetto/command": "^3.1.4"
|
|
38
38
|
},
|
|
39
39
|
"peerDependenciesMeta": {
|
package/src/spec-generate.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Readable } from 'stream';
|
|
2
2
|
import type {
|
|
3
3
|
SchemaObject, SchemasObject, ParameterObject, OperationObject,
|
|
4
|
-
RequestBodyObject, TagObject, PathsObject
|
|
4
|
+
RequestBodyObject, TagObject, PathsObject, PathItemObject
|
|
5
5
|
} from 'openapi3-ts';
|
|
6
6
|
|
|
7
7
|
import { EndpointConfig, ControllerConfig, ParamConfig, EndpointIOType, ControllerVisitor } from '@travetto/rest';
|
|
@@ -20,7 +20,7 @@ function isFieldConfig(val: object): val is FieldConfig {
|
|
|
20
20
|
|
|
21
21
|
type GeneratedSpec = {
|
|
22
22
|
tags: TagObject[];
|
|
23
|
-
paths:
|
|
23
|
+
paths: Record<string, PathItemObject>;
|
|
24
24
|
components: {
|
|
25
25
|
schemas: SchemasObject;
|
|
26
26
|
};
|
|
@@ -297,7 +297,7 @@ export class OpenapiVisitor implements ControllerVisitor<GeneratedSpec> {
|
|
|
297
297
|
requestBody: field.specifiers?.includes('file') ? this.#buildUploadBody() : this.#getEndpointBody(field, this.#getHeaderValue(ep, 'accepts'))
|
|
298
298
|
};
|
|
299
299
|
} else if (field.type && SchemaRegistry.has(field.type) && (param.location === 'query' || param.location === 'header')) {
|
|
300
|
-
return { parameters: this.#schemaToDotParams(param.location, field) };
|
|
300
|
+
return { parameters: this.#schemaToDotParams(param.location, field, param.prefix ? `${param.prefix}.` : '') };
|
|
301
301
|
} else if (param.location !== 'context') {
|
|
302
302
|
const epParam: ParameterObject = {
|
|
303
303
|
in: param.location,
|