Repository navigation
Remove YAML support for server-side custom models - #2672
Conversation
|
Wouldn't it be better to stick with vanilla JSON and rather use dedicated keys? {
"comment": "this is a little customized model used to benchmark routing with a customized weighting that is similar to the standard car profile",
"priority": [
{
"if": "road_access == PRIVATE",
"multiply_by": "0.1"
},
{
"else_if": "road_access == DESTINATION",
"multiply_by": "0.1"
}
],
"distance_influence": 0
} |
|
Not sure. Using comments this way is very verbose and please note that this would be only for the server-side config. |
|
In general using just JSON would be simple and sufficient (why couldn't they add comments to the spec!?). But somehow this feels ugly and will get uglier the more complex these models get. E.g. see when you need multiple lines: 417d4c9 |
Amen.
Unique keys are not a hard requirement AFAIK. As long as our parser doesn't choke on it: {
"comment": "to use this custom model you need to set the following option in the config.yml",
"comment": "graph.flag_encoders: roads|transportation_mode=HGV,car",
"comment": "graph.encoded_values: toll,hgv,surface,max_width,max_height",
"distance_influence": 1,
"speed": [
{
"if": "true",
"limit_to": "car_average_speed * 0.9"
},
{
"if": "true",
"limit_to": "95"
}
],
"priority": [
{
"if": "car_access == false || hgv == NO || max_width < 3 || max_height < 4",
"multiply_by": "0"
}
]
} |
|
With the Btw ideally, these comments: won't be necessary anyway :) |
Fixes #2671.
For server-side JSON files still comments with
//are allowed. See the example files.Unfortunately this does not reduce the dependencies as dropwizard still uses (and has to use) the YAMLFactory