diff options
author | Colin Reeder <colin@vpzom.click> | 2020-10-15 09:52:59 -0600 |
---|---|---|
committer | Colin Reeder <colin@vpzom.click> | 2020-10-15 09:52:59 -0600 |
commit | 61adafd107ca48e8c5999e6a97c533dd073fb6be (patch) | |
tree | 2a412f0ccf8a10667fa1b1d3bf1cabf0f13d2e70 | |
parent | ea9370a21336e9ed026380c90de8256b124fbbc3 (diff) |
Breaking API change: rename comments to replies in post info
-rw-r--r-- | openapi/openapi.json | 4 | ||||
-rw-r--r-- | src/routes/api/posts.rs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/openapi/openapi.json b/openapi/openapi.json index e00281f..38dfa96 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -1105,11 +1105,11 @@ "schema": { "allOf": [{"$ref": "#/components/schemas/PostListPost"}], "type": "object", - "required": ["approved", "score", "comments"], + "required": ["approved", "score", "replies"], "properties": { "approved": {"type": "boolean"}, "score": {"type": "integer"}, - "comments": { + "replies": { "type": "array", "items": {"$ref": "#/components/schemas/PostCommentInfo"} }, diff --git a/src/routes/api/posts.rs b/src/routes/api/posts.rs index cc62b38..0a54c30 100644 --- a/src/routes/api/posts.rs +++ b/src/routes/api/posts.rs @@ -254,7 +254,7 @@ async fn route_unstable_posts_get( post: &'a RespPostListPost<'a>, approved: bool, score: i64, - comments: Vec<RespPostCommentInfo<'a>>, + replies: Vec<RespPostCommentInfo<'a>>, #[serde(skip_serializing_if = "Option::is_none")] your_vote: Option<Option<crate::Empty>>, } @@ -344,7 +344,7 @@ async fn route_unstable_posts_get( let output = RespPostInfo { post: &post, - comments, + replies: comments, approved: row.get(14), score: row.get(13), your_vote, |