Skip to content

Commit

Permalink
Changes to the schema to include difficulty and hint
Browse files Browse the repository at this point in the history
  • Loading branch information
joeypark743 committed Jul 10, 2024
1 parent 671a74f commit fc496ee
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file added validation/.DS_Store
Binary file not shown.
20 changes: 17 additions & 3 deletions validation/schemas/code-assessment.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,29 @@ module.exports = {
errorMessage: {
type: "The expected should be an array",
},
}
},
"difficulty": {
type: "string",
enum: ["beginner", "intermediate", "advanced"],
errorMessage: {
enum: "Difficulty can only be: beginner, intermediate or advanced"
}
},
"hint": {
type: "string",
errorMessage: {
type: "The hint should be a string",
},
},
},
required: ["problem name", "description", "inputs", "expected"],
required: ["problem name", "description", "inputs", "expected", "difficulty"],
errorMessage: {
required: {
"problem name": "The name of the problem field is required",
"description": "The description is required",
"inputs": "The inputs field is required",
"expected": "The expected field is required"
"expected": "The expected field is required",
"difficulty": "The difficulty field is required"
}
},
},
Expand Down

0 comments on commit fc496ee

Please sign in to comment.