Add Problem Json

Adds a problem to the database based on its JSON definition.

Args: json_file (UploadFile): a file in JSON format describing the problem. user (Annotated[User, Depends): the usr for which the problem is added. session (Annotated[Session, Depends): the database session.

Raises: HTTPException: if the provided json_file is empty. HTTPException: if the content in the provided json_file is not in JSON format.annotations

Returns: ProblemInfo: a description of the added problem.

post/problem/add_json

Response

Successful Response

namestring required
descriptionstring required
is_convexboolean nullable required
is_linearboolean nullable required
is_twice_differentiableboolean nullable required
scenario_keysstring[] nullable required
variable_domain'continuous' | 'binary' | 'integer' | 'mixed' required

An enumerator for the possible variable type domains of a problem.

idinteger required
user_idinteger required
objectivesObjectiveDB[] required— unresolved $ref
constraintsConstraintDB[] nullable required— unresolved $ref
extra_funcsExtraFunctionDB[] nullable required— unresolved $ref
simulatorsSimulatorDB[] nullable required— unresolved $ref

Changes

Changed in 2 of the 2 revisions of this API.11