mirror of
https://github.com/aljazceru/cdk.git
synced 2026-01-03 21:15:22 +01:00
Merge pull request #610 from BitcreditProtocol/peanut/swagger_type
fix openApi attributes to keyset id to present it as a string
This commit is contained in:
@@ -116,6 +116,7 @@ pub struct BlindedMessage {
|
||||
///
|
||||
/// ID from which we expect a signature.
|
||||
#[serde(rename = "id")]
|
||||
#[cfg_attr(feature = "swagger", schema(value_type = String))]
|
||||
pub keyset_id: Id,
|
||||
/// Blinded secret message (B_)
|
||||
///
|
||||
@@ -161,6 +162,7 @@ pub struct BlindSignature {
|
||||
///
|
||||
/// ID of the mint keys that signed the token.
|
||||
#[serde(rename = "id")]
|
||||
#[cfg_attr(feature = "swagger", schema(value_type = String))]
|
||||
pub keyset_id: Id,
|
||||
/// Blinded signature (C_)
|
||||
///
|
||||
@@ -240,6 +242,7 @@ pub struct Proof {
|
||||
pub amount: Amount,
|
||||
/// `Keyset id`
|
||||
#[serde(rename = "id")]
|
||||
#[cfg_attr(feature = "swagger", schema(value_type = String))]
|
||||
pub keyset_id: Id,
|
||||
/// Secret message
|
||||
#[cfg_attr(feature = "swagger", schema(value_type = String))]
|
||||
|
||||
@@ -51,7 +51,6 @@ pub enum Error {
|
||||
|
||||
/// Keyset version
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
|
||||
pub enum KeySetVersion {
|
||||
/// Current Version 00
|
||||
Version00,
|
||||
@@ -88,7 +87,6 @@ impl fmt::Display for KeySetVersion {
|
||||
/// which mint or keyset it was generated from.
|
||||
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)]
|
||||
#[serde(into = "String", try_from = "String")]
|
||||
#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema), schema(as = String))]
|
||||
pub struct Id {
|
||||
version: KeySetVersion,
|
||||
id: [u8; Self::BYTELEN],
|
||||
@@ -221,6 +219,7 @@ pub struct KeysetResponse {
|
||||
#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
|
||||
pub struct KeySet {
|
||||
/// Keyset [`Id`]
|
||||
#[cfg_attr(feature = "swagger", schema(value_type = String))]
|
||||
pub id: Id,
|
||||
/// Keyset [`CurrencyUnit`]
|
||||
pub unit: CurrencyUnit,
|
||||
@@ -257,6 +256,7 @@ impl From<MintKeySet> for KeySet {
|
||||
#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
|
||||
pub struct KeySetInfo {
|
||||
/// Keyset [`Id`]
|
||||
#[cfg_attr(feature = "swagger", schema(value_type = String))]
|
||||
pub id: Id,
|
||||
/// Keyset [`CurrencyUnit`]
|
||||
pub unit: CurrencyUnit,
|
||||
|
||||
@@ -24,7 +24,7 @@ mod swagger_imports {
|
||||
BlindSignature, BlindedMessage, CurrencyUnit, PaymentMethod, Proof, Witness,
|
||||
};
|
||||
pub use cdk::nuts::nut01::{Keys, KeysResponse, PublicKey, SecretKey};
|
||||
pub use cdk::nuts::nut02::{Id, KeySet, KeySetInfo, KeySetVersion, KeysetResponse};
|
||||
pub use cdk::nuts::nut02::{KeySet, KeySetInfo, KeysetResponse};
|
||||
pub use cdk::nuts::nut03::{SwapRequest, SwapResponse};
|
||||
pub use cdk::nuts::nut04::{
|
||||
MintBolt11Request, MintBolt11Response, MintMethodSettings, MintQuoteBolt11Request,
|
||||
@@ -70,13 +70,11 @@ pub struct MintState {
|
||||
ErrorCode,
|
||||
ErrorResponse,
|
||||
HTLCWitness,
|
||||
Id,
|
||||
Keys,
|
||||
KeysResponse,
|
||||
KeysetResponse,
|
||||
KeySet,
|
||||
KeySetInfo,
|
||||
KeySetVersion,
|
||||
MeltBolt11Request<Uuid>,
|
||||
MeltQuoteBolt11Request,
|
||||
MeltQuoteBolt11Response<Uuid>,
|
||||
|
||||
Reference in New Issue
Block a user