From 3b665eb7cfe0c73d55883d1b3ca272e1067a1de4 Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Thu, 3 Oct 2024 17:47:18 -0500 Subject: [PATCH] rest: enable all unstable apis by default Until the rest service as a whole is "stabalized" with a sane set of default stable apis, have the default be to enable all unstable apis. --- crates/sui-rest-api/src/health.rs | 2 +- crates/sui-rest-api/src/info.rs | 2 +- crates/sui-rest-api/src/lib.rs | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/crates/sui-rest-api/src/health.rs b/crates/sui-rest-api/src/health.rs index ea3eced64efae..cf45ae8a95382 100644 --- a/crates/sui-rest-api/src/health.rs +++ b/crates/sui-rest-api/src/health.rs @@ -11,10 +11,10 @@ use axum::{ http::StatusCode, response::IntoResponse, }; +use documented::Documented; use std::time::{Duration, SystemTime}; use sui_types::storage::ReadStore; use tap::Pipe; -use documented::Documented; /// Perform a service health check /// diff --git a/crates/sui-rest-api/src/info.rs b/crates/sui-rest-api/src/info.rs index 152fa521b4ab0..29ba245ba5146 100644 --- a/crates/sui-rest-api/src/info.rs +++ b/crates/sui-rest-api/src/info.rs @@ -7,9 +7,9 @@ use crate::openapi::{ApiEndpoint, OperationBuilder, ResponseBuilder, RouteHandle use crate::{RestService, Result}; use axum::extract::State; use axum::Json; +use documented::Documented; use sui_sdk_types::types::CheckpointDigest; use tap::Pipe; -use documented::Documented; /// Get basic information about the state of a Node #[derive(Documented)] diff --git a/crates/sui-rest-api/src/lib.rs b/crates/sui-rest-api/src/lib.rs index 2589d4cce96dc..21a438529e3eb 100644 --- a/crates/sui-rest-api/src/lib.rs +++ b/crates/sui-rest-api/src/lib.rs @@ -77,7 +77,6 @@ const ENDPOINTS: &[&dyn ApiEndpoint] = &[ &health::HealthCheck, &checkpoints::ListCheckpoints, &checkpoints::GetCheckpoint, - // unstable APIs &accounts::ListAccountObjects, &objects::GetObject, @@ -241,7 +240,10 @@ pub struct Config { impl Config { pub fn enable_unstable_apis(&self) -> bool { - self.enable_unstable_apis.unwrap_or(false) + // TODO + // Until the rest service as a whole is "stabalized" with a sane set of default stable + // apis, have the default be to enable all apis + self.enable_unstable_apis.unwrap_or(true) } }