Simplify geometry depending on way type

There is a setting for returning simplified geometry when querying for routes, however I’d like to make the simplification only on certain way types.

Example:
I want that all ways from type motorway should keep the original geometry, but residential should be simplified.

How would I achieve something like that?

This is currently not possible without touching the source code here

You’d need to store the highway type in the flags, that is currently only possible with the DataFlagEncoder at the moment.