add variable name to the path when there is an error, closes #2050 (#2051)

This commit is contained in:
Vamshi Surabhi
2019-04-24 12:02:53 +05:30
committed by GitHub
parent 91f4d7b5e2
commit 83c3094936
6 changed files with 7 additions and 7 deletions

View File

@@ -74,7 +74,7 @@ getAnnVarVals
=> [G.VariableDefinition]
-> VariableValues
-> m AnnVarVals
getAnnVarVals varDefsL inpVals = do
getAnnVarVals varDefsL inpVals = withPathK "variableValues" $ do
varDefs <- onLeft (mkMapWith G._vdVariable varDefsL) $ \dups ->
throwVE $ "the following variables are defined more than once: " <>
@@ -96,7 +96,7 @@ getAnnVarVals varDefsL inpVals = do
annDefM <- withPathK "defaultValue" $
mapM (validateInputValue constValueParser ty) defM'
let inpValM = Map.lookup var inpVals
annInpValM <- withPathK "variableValues" $
annInpValM <- withPathK (G.unName $ G.unVariable var) $
mapM (validateInputValue jsonParser ty) inpValM
let varValM = annInpValM <|> annDefM
onNothing varValM $ throwVE $

View File

@@ -5,7 +5,7 @@ response:
errors:
- extensions:
code: parse-failed
path: $.variableValues[0].area.coordinates[0]
path: $.variableValues.areas[0].area.coordinates[0]
message: A LinearRing needs at least 4 Positions
query:
variables:

View File

@@ -5,7 +5,7 @@ response:
errors:
- extensions:
code: parse-failed
path: $.variableValues[0].location
path: $.variableValues.landmarks[0].location
message: 'unexpected geometry type: Random'
query:
variables:

View File

@@ -4,7 +4,7 @@ status: 400
response:
errors:
- extensions:
path: '$.variableValues[0].location.coordinates'
path: '$.variableValues.landmarks[0].location.coordinates'
code: parse-failed
message: A Position needs at least 2 elements
query:

View File

@@ -5,7 +5,7 @@ response:
errors:
- extensions:
code: parse-failed
path: $.variableValues[0].area.coordinates[0]
path: $.variableValues.areas[0].area.coordinates[0]
message: the first and last locations have to be equal for a LinearRing
query:
variables:

View File

@@ -4,7 +4,7 @@ status: 400
response:
errors:
- extensions:
path: $.variableValues[0].path.coordinates
path: $.variableValues.roads[0].path.coordinates
code: parse-failed
message: A LineString needs at least 2 Positions
query: