DecodingFailure rejections difficult to understand
- Dominant language
- Scala
- Stars
- 301
- Forks
- 76
- PR merge metrics
- No merged PRs in 30d
Description
As an example, when attempting to create a view with the following payload:
```json
{
"@context": {},
"@id": "myview",
"@type": "ElasticSearchView",
"resourceSchemas": [],
"resourceTypes": [],
"resourceTag": "",
"includeMetadata": true,
"includeDeprecated": false,
"mapping": {}
}
```
Delta returns:
```json
{
"@context": "https://bluebrain.github.io/nexus/contexts/error.json",
"@type": "DecodingFailed",
"rejections": [
{
"@type": "DecodingFailed",
"reason": "'' did not match the expected tag label format [\\p{ASCII}]{1,64}.",
"status": 400
},
{
"@type": "DecodingFailed",
"reason": "Unable to find type discriminator for 'BlazegraphViewValue'",
"status": 400
},
{
"@type": "DecodingFailed",
"reason": "Could not extract a 'Sequence' from the path 'DownArray,DownField(https://bluebrain.github.io/nexus/vocabulary/sources)'",
"status": 400
}
]
}
```
It would be useful to at least mention in which field the error is. In this case the error is in `resourceTag`, which cannot be empty. For someone not familiar with the internals, is pretty hard to understand.
Contributor guide
Research direction
Start from the example view-creation payload and its DecodingFailed response, then locate the decoding and rejection-handling entry points in the Scala project. Determine how validation failures can identify the relevant field and verify that the response explains the invalid resourceTag instead of presenting only difficult-to-interpret rejection messages.
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
- 42/100