Conversation
merge test 1
branch check
tmp rm CROSS_FEATURES
use GH_TOKEN
hardcode docker repo, set dockerfile location
use correct dir
update rust and path
use Cargo.toml as source of truth
fix path for toml_reader.sh
debugging
Pr 56 review
anchor/http_api/src/api/handlers.rs
Outdated
|
|
||
| /// OperatorMetadataDto model | ||
| #[derive(Debug, Serialize, Deserialize, ToSchema)] | ||
| pub struct OperatorMetadataDto { |
There was a problem hiding this comment.
I think the fields should stick with rust underscore convention and just use serde rename. Something like
#[serde(rename = "operatorName")] pub operator_name: Option<String>
anchor/http_api/src/api/handlers.rs
Outdated
| use super::handlers::*; | ||
|
|
||
| pub fn create_router() -> Router { | ||
| Router::new() |
There was a problem hiding this comment.
might be nice to try to break these functions up into modules for a nice organizational hierarchy.
Something like a root handler module, than operator module, network module, cluster module, etc. Then instead of the long function name you could do handle::operator::get_operator, handle::cluster::get_id. Doesn't have to be that structure, just some separation.
There was a problem hiding this comment.
Thanks @Zacholme7 - yes, was thinking the same.
anchor/http_api/src/api/handlers.rs
Outdated
| use utoipa::ToSchema; | ||
|
|
||
|
|
||
| #[utoipa::path(GET, path = "/api/v4/{network}/accounts", tag = "Accounts", params(("network", String),("page", String),("perPage", String),), |
There was a problem hiding this comment.
these macros are quite verbose. im not very familiar with utopia so im not sure if this is the convention. is there any way to simplify these?
There was a problem hiding this comment.
The utoipa macro seems to be the most common way to add openapi / swagger docs.
I get it though, it is verbose. But these openapi annotations do make it easier for api consumers.
These function signatures are generated from templates. So we can tweak the templates to our liking.
|
Nice start on this its good to get all these down and now we can start to nail down specifics! Left some early feedback with nitpick comments. |
|
closing this -- appreciate the effort but I think we should work on adding features as required for the http-api |
Issue Addressed
This is related to #26 and related testing issues.
Proposed Changes
Proposal to use identical paths / endpoints and method names as the ssv openapi spec.
But, as these spec is incomplete in terms of response types, to improve it by being more rigorous with, in particular, response types.