schema improvements: add additionalProperties: false to ensure closed types
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
"additionalProperties": false,
|
||||||
"properties": {
|
"properties": {
|
||||||
"name": {
|
"name": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -38,6 +39,7 @@
|
|||||||
},
|
},
|
||||||
"services": {
|
"services": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
"additionalProperties": false,
|
||||||
"properties": {
|
"properties": {
|
||||||
"opt": {
|
"opt": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
|||||||
@@ -278,6 +278,7 @@ in
|
|||||||
expr = slib.parseOption (evalType (lib.types.submodule subModule) { });
|
expr = slib.parseOption (evalType (lib.types.submodule subModule) { });
|
||||||
expected = {
|
expected = {
|
||||||
type = "object";
|
type = "object";
|
||||||
|
additionalProperties = false;
|
||||||
properties = {
|
properties = {
|
||||||
opt = {
|
opt = {
|
||||||
type = "boolean";
|
type = "boolean";
|
||||||
@@ -301,6 +302,7 @@ in
|
|||||||
expr = slib.parseOption (evalType (lib.types.submodule subModule) { });
|
expr = slib.parseOption (evalType (lib.types.submodule subModule) { });
|
||||||
expected = {
|
expected = {
|
||||||
type = "object";
|
type = "object";
|
||||||
|
additionalProperties = false;
|
||||||
properties = {
|
properties = {
|
||||||
opt = {
|
opt = {
|
||||||
type = "boolean";
|
type = "boolean";
|
||||||
@@ -331,6 +333,7 @@ in
|
|||||||
type = "object";
|
type = "object";
|
||||||
additionalProperties = {
|
additionalProperties = {
|
||||||
type = "object";
|
type = "object";
|
||||||
|
additionalProperties = false;
|
||||||
properties = {
|
properties = {
|
||||||
opt = {
|
opt = {
|
||||||
type = "boolean";
|
type = "boolean";
|
||||||
@@ -363,6 +366,7 @@ in
|
|||||||
type = "array";
|
type = "array";
|
||||||
items = {
|
items = {
|
||||||
type = "object";
|
type = "object";
|
||||||
|
additionalProperties = false;
|
||||||
properties = {
|
properties = {
|
||||||
opt = {
|
opt = {
|
||||||
type = "boolean";
|
type = "boolean";
|
||||||
|
|||||||
@@ -26,8 +26,10 @@ in
|
|||||||
{
|
{
|
||||||
expr = slib.parseOptions evaled.options;
|
expr = slib.parseOptions evaled.options;
|
||||||
expected = {
|
expected = {
|
||||||
|
additionalProperties = false;
|
||||||
properties = {
|
properties = {
|
||||||
foo = {
|
foo = {
|
||||||
|
additionalProperties = false;
|
||||||
properties = {
|
properties = {
|
||||||
bar = {
|
bar = {
|
||||||
type = "boolean";
|
type = "boolean";
|
||||||
|
|||||||
Reference in New Issue
Block a user