@@ -19,7 +19,11 @@ use super::simulation::SimulationResponse;
19
19
use crate :: core:: AsCoreRequest ;
20
20
use crate :: core:: Json ;
21
21
22
- #[ derive( Debug , Serialize ) ]
22
+ editoast_common:: schemas! {
23
+ Response ,
24
+ }
25
+
26
+ #[ derive( Debug , Clone , Serialize , Deserialize ) ]
23
27
pub struct Request {
24
28
/// Infrastructure id
25
29
pub infra : i64 ,
@@ -61,7 +65,7 @@ pub struct Request {
61
65
pub temporary_speed_limits : Vec < TemporarySpeedLimit > ,
62
66
}
63
67
64
- #[ derive( Debug , Serialize ) ]
68
+ #[ derive( Debug , Clone , Serialize , Deserialize ) ]
65
69
pub struct PathItem {
66
70
/// The track offsets of the path item
67
71
pub locations : Vec < TrackOffset > ,
@@ -72,7 +76,7 @@ pub struct PathItem {
72
76
}
73
77
74
78
/// Contains the data of a step timing, when it is specified
75
- #[ derive( Debug , Serialize ) ]
79
+ #[ derive( Debug , Clone , Serialize , Deserialize ) ]
76
80
pub struct StepTimingData {
77
81
/// Time the train should arrive at this point
78
82
pub arrival_time : DateTime < Utc > ,
@@ -83,7 +87,7 @@ pub struct StepTimingData {
83
87
}
84
88
85
89
/// Lighter description of a work schedule, with only the relevant information for core
86
- #[ derive( Debug , Serialize ) ]
90
+ #[ derive( Debug , Clone , Serialize , Deserialize ) ]
87
91
pub struct WorkSchedule {
88
92
/// Start time as a time delta from the stdcm start time in ms
89
93
pub start_time : u64 ,
@@ -94,7 +98,7 @@ pub struct WorkSchedule {
94
98
}
95
99
96
100
/// Lighter description of a work schedule with only the relevant information for core
97
- #[ derive( Debug , Serialize ) ]
101
+ #[ derive( Debug , Clone , Serialize , Deserialize ) ]
98
102
pub struct TemporarySpeedLimit {
99
103
/// Speed limitation in m/s
100
104
pub speed_limit : f64 ,
@@ -114,7 +118,7 @@ pub struct UndirectedTrackRange {
114
118
pub end : u64 ,
115
119
}
116
120
117
- #[ derive( Serialize , Deserialize , Clone , Debug , PartialEq ) ]
121
+ #[ derive( Serialize , Deserialize , Clone , Debug , PartialEq , ToSchema ) ]
118
122
#[ serde( tag = "status" , rename_all = "snake_case" ) ]
119
123
// We accepted the difference of memory size taken by variants
120
124
// Since there is only on success and others are error cases
0 commit comments