OpenRailAssociation / osrd

An open source web application for railway infrastructure design, capacity analysis, timetabling and simulation
https://osrd.fr
459 stars 43 forks source link

editoast: better way to infer/compute error context type #6685

Open sim51 opened 8 months ago

sim51 commented 8 months ago

Description and goal

In the error derive, we compute the type of error's context ( ie list its properties and their type).

For now the code is pretty simple and do manually the cast between simple rust type and openapi. You can check the function fn error_context_to_openapi_object in src/view/mod.rs for example.

A better way can be found to do it, specially if the error derive if we can save in inventory something that be directly given to utoapi.

Acceptance criteria

A better way to compute context type which support more types with less code

sim51 commented 8 months ago

Some hints :