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

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 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