Skip to content

Commit 25cf8f8

Browse files
authored
[hermes] fix v2 endpoints return format (#1299)
* remove outermost array * bump
1 parent e14a82c commit 25cf8f8

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

hermes/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

hermes/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "hermes"
3-
version = "0.5.1"
3+
version = "0.5.2"
44
description = "Hermes is an agent that provides Verified Prices from the Pythnet Pyth Oracle."
55
edition = "2021"
66

hermes/src/api/rest/v2/latest_price_updates.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ fn default_true() -> bool {
6666
get,
6767
path = "/v2/updates/price/latest",
6868
responses(
69-
(status = 200, description = "Price updates retrieved successfully", body = Vec<PriceUpdate>),
69+
(status = 200, description = "Price updates retrieved successfully", body = PriceUpdate),
7070
(status = 404, description = "Price ids not found", body = String)
7171
),
7272
params(
@@ -76,7 +76,7 @@ fn default_true() -> bool {
7676
pub async fn latest_price_updates(
7777
State(state): State<crate::api::ApiState>,
7878
QsQuery(params): QsQuery<LatestPriceUpdatesQueryParams>,
79-
) -> Result<Json<Vec<PriceUpdate>>, RestError> {
79+
) -> Result<Json<PriceUpdate>, RestError> {
8080
let price_ids: Vec<PriceIdentifier> = params.ids.into_iter().map(|id| id.into()).collect();
8181

8282
verify_price_ids_exist(&state, &price_ids).await?;
@@ -126,5 +126,5 @@ pub async fn latest_price_updates(
126126
};
127127

128128

129-
Ok(Json(vec![compressed_price_update]))
129+
Ok(Json(compressed_price_update))
130130
}

hermes/src/api/rest/v2/timestamp_price_updates.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ fn default_true() -> bool {
7979
get,
8080
path = "/v2/updates/price/{publish_time}",
8181
responses(
82-
(status = 200, description = "Price updates retrieved successfully", body = Vec<PriceUpdate>),
82+
(status = 200, description = "Price updates retrieved successfully", body = PriceUpdate),
8383
(status = 404, description = "Price ids not found", body = String)
8484
),
8585
params(
@@ -91,7 +91,7 @@ pub async fn timestamp_price_updates(
9191
State(state): State<crate::api::ApiState>,
9292
Path(path_params): Path<TimestampPriceUpdatesPathParams>,
9393
QsQuery(query_params): QsQuery<TimestampPriceUpdatesQueryParams>,
94-
) -> Result<Json<Vec<PriceUpdate>>, RestError> {
94+
) -> Result<Json<PriceUpdate>, RestError> {
9595
let price_ids: Vec<PriceIdentifier> =
9696
query_params.ids.into_iter().map(|id| id.into()).collect();
9797

@@ -139,5 +139,5 @@ pub async fn timestamp_price_updates(
139139
};
140140

141141

142-
Ok(Json(vec![compressed_price_update]))
142+
Ok(Json(compressed_price_update))
143143
}

0 commit comments

Comments
 (0)