@vkontakte/api-schema-typescript-generator 0.12.0 → 0.13.0
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.
|
@@ -154,7 +154,6 @@ class APITypingsGenerator {
|
|
|
154
154
|
let imports = {};
|
|
155
155
|
let codeBlocks = [];
|
|
156
156
|
const properties = this.getObjectProperties(object);
|
|
157
|
-
const requiredProperties = utils_1.arrayToMap(object.required);
|
|
158
157
|
const codeBlock = new TypeCodeBlock_1.TypeCodeBlock({
|
|
159
158
|
type: TypeCodeBlock_1.TypeScriptCodeTypes.Interface,
|
|
160
159
|
refName: object.name,
|
|
@@ -176,7 +175,7 @@ class APITypingsGenerator {
|
|
|
176
175
|
name: property.name,
|
|
177
176
|
description: [property.description, description].join(constants_1.newLineChar),
|
|
178
177
|
value,
|
|
179
|
-
isRequired: helpers_1.isPatternProperty(property.name) ||
|
|
178
|
+
isRequired: helpers_1.isPatternProperty(property.name) || property.isRequired,
|
|
180
179
|
});
|
|
181
180
|
});
|
|
182
181
|
return {
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from '../helpers';
|
|
16
16
|
import { CodeBlocksArray, GeneratorResultInterface } from './BaseCodeBlock';
|
|
17
17
|
import { TypeCodeBlock, TypeScriptCodeTypes } from './TypeCodeBlock';
|
|
18
|
-
import {
|
|
18
|
+
import { isObject, sortArrayAlphabetically, uniqueArray } from '../utils';
|
|
19
19
|
import {
|
|
20
20
|
baseAPIParamsInterfaceName,
|
|
21
21
|
baseBoolIntRef,
|
|
@@ -229,7 +229,6 @@ export class APITypingsGenerator {
|
|
|
229
229
|
let codeBlocks: CodeBlocksArray = [];
|
|
230
230
|
|
|
231
231
|
const properties = this.getObjectProperties(object);
|
|
232
|
-
const requiredProperties = arrayToMap(object.required);
|
|
233
232
|
|
|
234
233
|
const codeBlock = new TypeCodeBlock({
|
|
235
234
|
type: TypeScriptCodeTypes.Interface,
|
|
@@ -261,7 +260,7 @@ export class APITypingsGenerator {
|
|
|
261
260
|
name: property.name,
|
|
262
261
|
description: [property.description, description].join(newLineChar),
|
|
263
262
|
value,
|
|
264
|
-
isRequired: isPatternProperty(property.name) ||
|
|
263
|
+
isRequired: isPatternProperty(property.name) || property.isRequired,
|
|
265
264
|
});
|
|
266
265
|
});
|
|
267
266
|
|