Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Consider strongly typing JSON Schema types, or using an existing open source lib #54

Open
KendallWeihe opened this issue Apr 30, 2024 · 1 comment

Comments

@KendallWeihe
Copy link
Contributor

Right now, for example we have this

pub struct PaymentMethod {
    /// Type of payment method (i.e. `DEBIT_CARD`, `BITCOIN_ADDRESS`, `SQUARE_PAY`)
    pub kind: String,
    /// A JSON Schema containing the fields that need to be collected in order to use this
    /// payment method
    pub required_payment_details: Option<JsonValue>,
    /// The fee expressed in the currency's sub units to make use of this payment method
    pub fee_subunits: Option<String>,
}

You'll notice required_payment_details is of type Option<JsonValue>

Rather than JsonValue, let's consider implementing a dedicated type for JSON Schemas, or better yet, use an existing open source lib if one exists which meets out requirements

@KendallWeihe
Copy link
Contributor Author

Actually, we may consider solving this first and subsequently using the functionality here decentralized-identity/web5-rs#137

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant