maproulette / maproulette/maproulette-backend
Challenge creation/update - default difficulty level not set for invalid values
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 53
- Forks
- 39
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 12
Description
If the user supplies an invalid integer value for the difficulty level at challenge creation or update the default value is not set for this field.
Request JSON:
{
"name": "Misnamed Double Digitized Ways",
"parent": 2,
"identifier": "misnameddoubledigitizedways",
"difficulty": 5,
"description": "",
"blurb": "Double digitized ways with inconsistent naming",
"instruction": "Fix the inconsistent naming of what seems to be a single double-digitized road.",
"help": ""
}
Response JSON:
{"id":31,"name":"Misnamed Double Digitized Ways","description":"","parent":2,"instruction":"Fix the inconsistent naming of what seems to be a single double-digitized road.","difficulty":5,"blurb":"Double digitized ways with inconsistent naming","enabled":true,"challengeType":1,"featured":false}
If the user supplies a non-numeric invalid value for the difficulty level at challenge creation or update the operation fails. In this case the default value should be set.
Request JSON:
{
"name": "Misnamed Double Digitized Ways",
"parent": 2,
"identifier": "misnameddoubledigitizedways",
"difficulty": "blabla",
"description": "",
"blurb": "Double digitized ways with inconsistent naming",
"instruction": "Fix the inconsistent naming of what seems to be a single double-digitized road.",
"help": ""
}
Response JSON:
{"status":"KO","message":{"obj.difficulty":[{"msg":["error.expected.jsnumber"],"args":[],responseCode:400}],responseCode:400},responseCode:400}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the challenge creation and update handlers and tracing how the difficulty field is validated and defaulted. Compare the numeric and non-numeric request examples, then add or run coverage showing that both invalid forms use the existing default rather than failing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100