Skip to content

Commit c63fa25

Browse files
committed
refactor(project): Use enum in component schema
1 parent f99dadb commit c63fa25

File tree

2 files changed

+5
-5
lines changed
  • packages/project

2 files changed

+5
-5
lines changed

packages/project/lib/validation/schema/specVersion/kind/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"then": {
1818
"properties": {
1919
"specVersion": {
20-
"const": "5.0",
20+
"enum": ["5.0"],
2121
"errorMessage": "The 'component' type is only supported with specVersion '5.0' and higher."
2222
}
2323
}

packages/project/test/lib/validation/schema/specVersion/kind/project.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,12 @@ test("Type component, legacy specVersion", async (t) => {
117117
params: {
118118
errors: [{
119119
dataPath: "/specVersion",
120-
keyword: "const",
121-
message: "should be equal to constant",
120+
keyword: "enum",
121+
message: "should be equal to one of the allowed values",
122122
params: {
123-
allowedValue: "5.0",
123+
allowedValues: ["5.0"],
124124
},
125-
schemaPath: "#/allOf/0/then/properties/specVersion/const",
125+
schemaPath: "#/allOf/0/then/properties/specVersion/enum",
126126
}],
127127
}
128128
}]);

0 commit comments

Comments
 (0)