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

Allow interface values in notification payload #11

Merged
merged 2 commits into from
Jan 18, 2024
Merged

Conversation

roeierez
Copy link
Member

Small change to allow generic json as payload rather than limit to string values.

http/router.go Outdated
@@ -48,7 +48,7 @@ func (p *LnurlPayInfoPayload) ToNotification(query *MobilePushWebHookQuery) *not
type LnurlPayInvoicePayload struct {
Template string `json:"template" binding:"required,eq=lnurlpay_invoice"`
Data struct {
Amount string `json:"amount" binding:"required"`
Amount int `json:"amount" binding:"required"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we validate the amount here, or should the validation take place in the application/SDK? I've seen the breez-lnurl server parses a uint, but I would say breez-lnurl and notify should not be dependent on each other to validate data, especially when vendors have differing implementations.

Suggested change
Amount int `json:"amount" binding:"required"`
Amount int `json:"amount" binding:"required,min=1"`

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, fixed.

@roeierez roeierez merged commit 217f50f into main Jan 18, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants