Skip to content

Commit

Permalink
Remove newAddresses from documentation (helius-labs#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmantica11 authored Dec 12, 2024
1 parent 5ac2955 commit 211513f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/api/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use solana_client::nonblocking::rpc_client::RpcClient;
use utoipa::openapi::{ObjectBuilder, RefOr, Schema, SchemaType};
use utoipa::ToSchema;

use crate::api::method::get_validity_proof::GetValidityProofRequestDocumentation;
use crate::api::method::utils::GetNonPaginatedSignaturesResponse;
use crate::common::typedefs::unsigned_integer::UnsignedInteger;

Expand Down Expand Up @@ -375,7 +376,7 @@ impl PhotonApi {
},
OpenApiSpec {
name: "getValidityProof".to_string(),
request: Some(GetValidityProofRequest::schema().1),
request: Some(GetValidityProofRequestDocumentation::schema().1),
response: GetValidityProofResponse::schema().1,
},
OpenApiSpec {
Expand Down
11 changes: 11 additions & 0 deletions src/api/method/get_validity_proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,17 @@ pub struct GetValidityProofRequest {
pub newAddressesWithTrees: Vec<AddressWithTree>,
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, ToSchema)]
#[serde(deny_unknown_fields, rename_all = "camelCase")]
#[allow(non_snake_case)]
// Create to hide the deprecated newAddresses field from the documentation
pub struct GetValidityProofRequestDocumentation {
#[serde(default)]
pub hashes: Vec<Hash>,
#[serde(default)]
pub newAddressesWithTrees: Vec<AddressWithTree>,
}

#[derive(Serialize, Deserialize, ToSchema)]
#[serde(deny_unknown_fields, rename_all = "camelCase")]
pub struct GetValidityProofResponse {
Expand Down
5 changes: 0 additions & 5 deletions src/openapi/specs/getValidityProof.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ paths:
type: array
items:
$ref: '#/components/schemas/Hash'
newAddresses:
type: array
items:
$ref: '#/components/schemas/SerializablePubkey'
deprecated: true
newAddressesWithTrees:
type: array
items:
Expand Down

0 comments on commit 211513f

Please sign in to comment.