@@ -183,19 +183,19 @@ void from_json(const nlohmann::json& obj, DrawLength& output) {
183183void to_json (nlohmann::json& obj, const ProfileSegment& input) {
184184 if (auto value = std::get_if<Line>(&input)) {
185185 obj[" type" ] = " line" ;
186- obj[" parameters " ] = *value;
186+ obj[" value " ] = *value;
187187 }
188188 else if (auto value = std::get_if<Arc>(&input)) {
189189 obj[" type" ] = " arc" ;
190- obj[" parameters " ] = *value;
190+ obj[" value " ] = *value;
191191 }
192192 else if (auto value = std::get_if<Spiral>(&input)) {
193193 obj[" type" ] = " spiral" ;
194- obj[" parameters " ] = *value;
194+ obj[" value " ] = *value;
195195 }
196196 else if (auto value = std::get_if<Spline>(&input)) {
197197 obj[" type" ] = " spline" ;
198- obj[" parameters " ] = *value;
198+ obj[" value " ] = *value;
199199 }
200200 else {
201201 throw std::runtime_error (" Unknown segment type" );
@@ -204,16 +204,16 @@ void to_json(nlohmann::json& obj, const ProfileSegment& input) {
204204
205205void from_json (const nlohmann::json& obj, ProfileSegment& output) {
206206 if (obj.at (" type" ) == " line" ) {
207- output = obj.at (" parameters " ).get <Line>();
207+ output = obj.at (" value " ).get <Line>();
208208 }
209209 else if (obj.at (" type" ) == " arc" ) {
210- output = obj.at (" parameters " ).get <Arc>();
210+ output = obj.at (" value " ).get <Arc>();
211211 }
212212 else if (obj.at (" type" ) == " spiral" ) {
213- output = obj.at (" parameters " ).get <Spiral>();
213+ output = obj.at (" value " ).get <Spiral>();
214214 }
215215 else if (obj.at (" type" ) == " spline" ) {
216- output = obj.at (" parameters " ).get <Spline>();
216+ output = obj.at (" value " ).get <Spline>();
217217 }
218218 else {
219219 throw std::runtime_error (" Unknown segment type" );
@@ -232,15 +232,15 @@ void to_json(nlohmann::json& obj, const LayerAlignment& input) {
232232 }
233233 else if (auto value = std::get_if<LayerBack>(&input)) {
234234 obj[" type" ] = " layer_back" ;
235- obj[" layer " ] = value->layer ;
235+ obj[" value " ] = value->layer ;
236236 }
237237 else if (auto value = std::get_if<LayerBelly>(&input)) {
238238 obj[" type" ] = " layer_belly" ;
239- obj[" layer " ] = value->layer ;
239+ obj[" value " ] = value->layer ;
240240 }
241241 else if (auto value = std::get_if<LayerCenter>(&input)) {
242242 obj[" type" ] = " layer_center" ;
243- obj[" layer " ] = value->layer ;
243+ obj[" value " ] = value->layer ;
244244 }
245245 else {
246246 throw std::runtime_error (" Unknown alignment type" );
@@ -259,17 +259,17 @@ void from_json(const nlohmann::json& obj, LayerAlignment& output) {
259259 }
260260 else if (obj.at (" type" ) == " layer_back" ) {
261261 output = LayerBack {
262- .layer = obj.at (" layer " )
262+ .layer = obj.at (" value " )
263263 };
264264 }
265265 else if (obj.at (" type" ) == " layer_belly" ) {
266266 output = LayerBelly {
267- .layer = obj.at (" layer " )
267+ .layer = obj.at (" value " )
268268 };
269269 }
270270 else if (obj.at (" type" ) == " layer_center" ) {
271271 output = LayerCenter {
272- .layer = obj.at (" layer " )
272+ .layer = obj.at (" value " )
273273 };
274274 }
275275 else {
0 commit comments