Skip to content

Commit

Permalink
Fixed: enum should not have a length field in the schema validator #130
Browse files Browse the repository at this point in the history
  • Loading branch information
rizen committed Apr 26, 2024
1 parent e380ec8 commit 7f09351
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/change-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ outline: deep
* Check to make sure a job handler exists before allowing a job to be created.
* Implemented: CLI should let you search for jobs by handler name #125
* Fixed a bug in job worker where it could not error properly from a job handler that didn't exist.
* Fixed: enum should not have a length field in the schema validator #130

## 2024-04-25
* Fixed a bug where ving record fields of type 'int' were not being initialized properly.
Expand Down
2 changes: 1 addition & 1 deletion ving/schema/validator.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ export const validatePropUnique = (prop, schema) => {
* validatePropLength(prop, schema)
*/
export const validatePropLength = (prop, schema) => {
if (!['id', 'enum', 'string'].includes(prop.type)) {
if (!['id', 'string'].includes(prop.type)) {
if ('length' in prop)
throw ving.ouch(442, `${schema.kind}.props.${prop.name}.length should not exist.`);
return;
Expand Down

0 comments on commit 7f09351

Please sign in to comment.