@trayio/tray-schema 3.5.0 → 3.6.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.
|
@@ -429,4 +429,30 @@ describe('TJSTraySchemaGenerator', () => {
|
|
|
429
429
|
};
|
|
430
430
|
expect(actual).toEqual(expected);
|
|
431
431
|
});
|
|
432
|
+
it('Generates object type overriding additionalProperties false', () => {
|
|
433
|
+
const type = 'Input';
|
|
434
|
+
const dirPath = __dirname;
|
|
435
|
+
const path = (0, path_1.join)(dirPath, 'additionalProperties.test.data.ts');
|
|
436
|
+
const result = new TJSTraySchemaGenerator_1.TJSTraySchemaGenerator().generateFromType(type, path);
|
|
437
|
+
const actual = E.getOrElse((error) => {
|
|
438
|
+
console.warn(error);
|
|
439
|
+
throw new Error(`Failed to generate JSON schema from type`);
|
|
440
|
+
})(result);
|
|
441
|
+
const expected = {
|
|
442
|
+
type: 'object',
|
|
443
|
+
properties: {
|
|
444
|
+
additionalProperties: {
|
|
445
|
+
type: 'object',
|
|
446
|
+
properties: {},
|
|
447
|
+
additionalProperties: false,
|
|
448
|
+
advanced: [],
|
|
449
|
+
},
|
|
450
|
+
},
|
|
451
|
+
advanced: [],
|
|
452
|
+
required: ['additionalProperties'],
|
|
453
|
+
additionalProperties: false,
|
|
454
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
455
|
+
};
|
|
456
|
+
expect(actual).toEqual(expected);
|
|
457
|
+
});
|
|
432
458
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"additionalProperties.test.data.d.ts","sourceRoot":"","sources":["../../src/schema/additionalProperties.test.data.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG;IACnB;;OAEG;IACH,oBAAoB,EAAE,EAAE,CAAC;CACzB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trayio/tray-schema",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0",
|
|
4
4
|
"description": "Schema for Tray connectors and authentications",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./*": "./dist/*.js"
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"access": "public"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@trayio/commons": "3.
|
|
14
|
+
"@trayio/commons": "3.6.0",
|
|
15
15
|
"@types/node": "18.11.9",
|
|
16
16
|
"lodash": "4.17.21",
|
|
17
17
|
"typescript-json-schema": "0.62.0"
|