Could be a map from jsonschema type to python casting function? Not sure if that's really much better but it prevents mistakes in these if/else statements.