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