Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 TBD54566975/web5-rs#137

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

No branches or pull requests

1 participant