Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Operationのserialize方法を変える #35

Closed
shugo256 opened this issue Apr 27, 2021 · 0 comments · Fixed by #38
Closed

Operationのserialize方法を変える #35

shugo256 opened this issue Apr 27, 2021 · 0 comments · Fixed by #38

Comments

@shugo256
Copy link
Member

shugo256 commented Apr 27, 2021

現状、GET routes/{id}をすると以下のようなレスポンスとなる

{"id":"7I5cHtC69mQ","name":"sample2","polyline":[{"latitude":0.0,"longitude":100.0},{"latitude":10.0,"longitude":110.0},{"latitude":20.0,"longitude":120.0}],"operation_history":{"op_list":[{"InitWithList":{"list":[{"latitude":10.0,"longitude":110.0},{"latitude":50.0,"longitude":150.0}]}},{"Add":{"pos":0,"coord":{"latitude":0.0,"longitude":100.0}}},{"Add":{"pos":2,"coord":{"latitude":20.0,"longitude":120.0}}},{"Remove":{"pos":3,"coord":{"latitude":50.0,"longitude":150.0}}},{"Clear":{"org_list":[{"latitude":0.0,"longitude":100.0},{"latitude":10.0,"longitude":110.0},{"latitude":20.0,"longitude":120.0}]}}],"pos":4}}

op_listの各要素のスキーマが適当(Addなどの操作名がkeyになってしまっている)なので、ちゃんとやる

各operationを一つのschemaにまとめる時にskip_serializing_ifというserdeのオプションが使えそう
serde-rs/serde#947

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant