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

All Meta REST APIs now return camelCase json fields #314

Merged
merged 1 commit into from
Apr 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/meta/src/rest_api/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ impl MetaApiError {}

/// To format the error response body.
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
struct ErrorDescriptionResponse {
message: String,
}
Expand Down
2 changes: 2 additions & 0 deletions src/meta/src/rest_api/methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use serde::Serialize;
use std::sync::Arc;

#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ListServiceMethodsResponse {
methods: Vec<GetServiceMethodResponse>,
}
Expand Down Expand Up @@ -35,6 +36,7 @@ pub async fn list_service_methods<S, M: MethodDescriptorRegistry>(
}

#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct GetServiceMethodResponse {
service_name: String,
method_name: String,
Expand Down
4 changes: 4 additions & 0 deletions src/meta/src/rest_api/services.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ use std::sync::Arc;

#[serde_as]
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct RegisterServiceEndpointRequest {
#[serde_as(as = "serde_with::DisplayFromStr")]
pub uri: Uri,
pub additional_headers: Option<HashMap<String, String>>,
}

#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct RegisterServiceEndpointResponse {
services: Vec<String>,
}
Expand Down Expand Up @@ -48,6 +50,7 @@ pub async fn discover_service_endpoint<S: ServiceEndpointRegistry, M>(
}

#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ListServicesResponse {
endpoints: Vec<GetServiceResponse>,
}
Expand All @@ -71,6 +74,7 @@ pub async fn list_services<S: ServiceEndpointRegistry, M>(
}

#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct GetServiceResponse {
service_name: String,
endpoint_metadata: EndpointMetadata,
Expand Down