vovk 3.0.0-draft.215 → 3.0.0-draft.217
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.
|
@@ -4,6 +4,7 @@ exports.openAPIToVovkSchema = openAPIToVovkSchema;
|
|
|
4
4
|
const types_1 = require("../types");
|
|
5
5
|
const generateFnName_1 = require("./generateFnName");
|
|
6
6
|
const camelCase_1 = require("../utils/camelCase");
|
|
7
|
+
const EXTENSIONS_SEGMENT_NAME = 'extensions';
|
|
7
8
|
// fast clone JSON object while ignoring Date, RegExp, and Function types
|
|
8
9
|
function cloneJSON(obj) {
|
|
9
10
|
if (obj === null || typeof obj !== 'object')
|
|
@@ -119,10 +120,10 @@ function openAPIToVovkSchema({ apiRoot, source: { object: openAPIObject }, getMo
|
|
|
119
120
|
const schema = {
|
|
120
121
|
$schema: types_1.VovkSchemaIdEnum.SCHEMA,
|
|
121
122
|
segments: {
|
|
122
|
-
|
|
123
|
+
[EXTENSIONS_SEGMENT_NAME]: {
|
|
123
124
|
$schema: types_1.VovkSchemaIdEnum.SEGMENT,
|
|
124
125
|
emitSchema: true,
|
|
125
|
-
segmentName:
|
|
126
|
+
segmentName: EXTENSIONS_SEGMENT_NAME,
|
|
126
127
|
forceApiRoot,
|
|
127
128
|
controllers: {},
|
|
128
129
|
},
|
|
@@ -135,7 +136,7 @@ function openAPIToVovkSchema({ apiRoot, source: { object: openAPIObject }, getMo
|
|
|
135
136
|
openapi: openAPIObject,
|
|
136
137
|
},
|
|
137
138
|
};
|
|
138
|
-
const segment = schema.segments[
|
|
139
|
+
const segment = schema.segments[EXTENSIONS_SEGMENT_NAME];
|
|
139
140
|
getModuleName = normalizeGetModuleName(getModuleName);
|
|
140
141
|
getMethodName = normalizeGetMethodName(getMethodName);
|
|
141
142
|
return Object.entries(openAPIObject.paths ?? {}).reduce((acc, [path, operations]) => {
|
|
@@ -4,6 +4,7 @@ exports.openAPIToVovkSchema = openAPIToVovkSchema;
|
|
|
4
4
|
const types_1 = require("../types");
|
|
5
5
|
const generateFnName_1 = require("./generateFnName");
|
|
6
6
|
const camelCase_1 = require("../utils/camelCase");
|
|
7
|
+
const EXTENSIONS_SEGMENT_NAME = 'extensions';
|
|
7
8
|
// fast clone JSON object while ignoring Date, RegExp, and Function types
|
|
8
9
|
function cloneJSON(obj) {
|
|
9
10
|
if (obj === null || typeof obj !== 'object')
|
|
@@ -119,10 +120,10 @@ function openAPIToVovkSchema({ apiRoot, source: { object: openAPIObject }, getMo
|
|
|
119
120
|
const schema = {
|
|
120
121
|
$schema: types_1.VovkSchemaIdEnum.SCHEMA,
|
|
121
122
|
segments: {
|
|
122
|
-
|
|
123
|
+
[EXTENSIONS_SEGMENT_NAME]: {
|
|
123
124
|
$schema: types_1.VovkSchemaIdEnum.SEGMENT,
|
|
124
125
|
emitSchema: true,
|
|
125
|
-
segmentName:
|
|
126
|
+
segmentName: EXTENSIONS_SEGMENT_NAME,
|
|
126
127
|
forceApiRoot,
|
|
127
128
|
controllers: {},
|
|
128
129
|
},
|
|
@@ -135,7 +136,7 @@ function openAPIToVovkSchema({ apiRoot, source: { object: openAPIObject }, getMo
|
|
|
135
136
|
openapi: openAPIObject,
|
|
136
137
|
},
|
|
137
138
|
};
|
|
138
|
-
const segment = schema.segments[
|
|
139
|
+
const segment = schema.segments[EXTENSIONS_SEGMENT_NAME];
|
|
139
140
|
getModuleName = normalizeGetModuleName(getModuleName);
|
|
140
141
|
getMethodName = normalizeGetMethodName(getMethodName);
|
|
141
142
|
return Object.entries(openAPIObject.paths ?? {}).reduce((acc, [path, operations]) => {
|