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

Provide default value for requiredClaims #233

Open
angiejones opened this issue Apr 6, 2024 · 0 comments
Open

Provide default value for requiredClaims #233

angiejones opened this issue Apr 6, 2024 · 0 comments

Comments

@angiejones
Copy link
Member

Issue

Currently, even if a developer is creating an offering that doesnt have any required claims, they still have to add the requiredClaims value to their object. This is because, while OfferingData does have requiredClaims as optional, there's no default value. So this forces developers to pass in null to get around this.

Current usage

      OfferingData(
          description = "Selling GBP for USD",
          payin = PayinDetails(currencyCode = "USD", methods = listOf()),
          payout = PayoutDetails(currencyCode = "GBP", methods = listOf()),
          payoutUnitsPerPayinUnit = "0.00003826",
          requiredClaims = null
      )

Desired usage

      OfferingData(
          description = "Selling GBP for USD",
          payin = PayinDetails(currencyCode = "USD", methods = listOf()),
          payout = PayoutDetails(currencyCode = "GBP", methods = listOf()),
          payoutUnitsPerPayinUnit = "0.00003826"
      )

Suggested Fix

Update ResourceData to:

val requiredClaims: PresentationDefinitionV2? = null
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