Skip to content

Ensure variable names get preserved in all ResponseModels #653

Description

@JavierGOrdonnez

Currently helpers.py contains

_DEFAULT_PRESERVE_NESTED_KEYS = frozenset(
{
"properties",
"inputs",
"outputs",
"default_inputs",
"slider_values",
"distributions",
"output_var_selection",
"project_inputs",
"correlations",
"sobol",
"sobol_second_order",
"predictions",
"grid_data",
"optimization_results",
"metrics",
}
)

Instead, create a common Request / Response Model base which allows input variables (aka parameters) and output variables (aka responses) always getting allocated to the same field, and provide the tooling to NOT modify it; or rather than case being converted at all API points, the flaskapi could take the itis-sumo calls (always snake_case) and form a typed ResponseModel which is camelCase to be sent to the frontend - thus the transformation is explicit and intended. TBD.

Please also see comments in #652

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    criticalBreaking error - needs to be fixed asapflaskapiRelated to request handling / data manipulation in the FlaskAPI backend itselftechnical debt

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions