Comments (4)
@yanivbh1 that json is invalid json.
You can paste it in here and see: https://jsonlint.com
It's actually really messed up in a lot of places. Where did you get that from?
I think it should return an error for those messages though.
Checking with functions,
"error": "json: cannot unmarshal string into Go value of type map[string]interface {}"
I am seeing it go to the DLS like it should, because it is invalid json.
from memphis-dev-functions.
Pull request changes the format for nested elements to use the period syntax that was mentioned above.
from memphis-dev-functions.
hey @John-Memphis , that's a Stripe webhook, meaning they are the creator. Pretty sure it's ok unless I paste it wrong.
Fixing:
{
"object": "event",
"api_version": "2022-11-15",
"created": 1701341837,
"data": {
"object": {
"object": "subscription",
"application": "ca_L********Qeytbv2s",
"application_fee_percent": null,
"automatic_tax": {
"enabled": true
},
"billing_thresholds": null,
"cancel_at": null,
"cancel_at_period_end": false,
"canceled_at": null,
"cancellation_details": {
"comment": null,
"feedback": null,
"reason": null
},
"collection_method": "charge_automatically",
"created": 1701341836,
"currency": "usd",
"current_period_end": 1701388800,
"current_period_start": 1701341836,
"days_until_due": null,
"default_payment_method": null,
"default_source": null,
"default_tax_rates": [
],
"description": null,
"discount": null,
"ended_at": null,
"items": {
"object": "list",
"data": [
{
"object": "subscription_item",
"billing_thresholds": null,
"created": 1701341836,
"metadata": {
},
"plan": {
"object": "plan",
"active": true,
"aggregate_usage": null,
"amount": null,
"amount_decimal": null,
"billing_scheme": "tiered",
"currency": "usd",
"interval": "month",
"interval_count": 1,
"livemode": true,
"metadata": {
},
"nickname": null,
"tiers_mode": "volume",
"transform_usage": null,
"trial_period_days": null,
"usage_type": "licensed"
},
"price": {
"object": "price",
"active": true,
"billing_scheme": "tiered",
"currency": "usd",
"custom_unit_amount": null,
"livemode": true,
"lookup_key": null,
"metadata": {
},
"nickname": null,
"recurring": {
"aggregate_usage": null,
"interval": "month",
"interval_count": 1,
"trial_period_days": null,
"usage_type": "licensed"
},
"tax_behavior": "unspecified",
"tiers_mode": "volume",
"transform_quantity": null,
"type": "recurring",
"unit_amount": null,
"unit_amount_decimal": null
},
"quantity": 1,
"tax_rates": [
]
}
],
"has_more": false,
"total_count": 1,
},
"livemode": true,
"metadata": {
"stiggCustomerId": "asdvvcc123",
"stiggEntityUrl": "https://test.com"
},
"next_pending_invoice_item_invoice": null,
"on_behalf_of": null,
"pause_collection": null,
"payment_settings": {
"payment_method_options": null,
"payment_method_types": null,
"save_default_payment_method": "off"
},
"pending_invoice_item_interval": null,
"pending_setup_intent": null,
"pending_update": null,
"plan": {
"object": "plan",
"active": true,
"aggregate_usage": null,
"amount": null,
"amount_decimal": null,
"billing_scheme": "tiered",
"created": 1700385798,
"currency": "usd",
"interval": "month",
"interval_count": 1,
"livemode": true,
"metadata": {
},
"nickname": null,
"tiers_mode": "volume",
"transform_usage": null,
"trial_period_days": null,
"usage_type": "licensed"
},
"quantity": 1,
"schedule": null,
"start_date": 1701341836,
"status": "active",
"test_clock": null,
"transfer_data": null,
"trial_end": null,
"trial_settings": {
"end_behavior": {
"missing_payment_method": "create_invoice"
}
},
"trial_start": null
}
},
"livemode": true,
"pending_webhooks": 3,
"request": {
"id": "req_s1hv7ppNSUy4R8",
},
"type": "customer.subscription.created"
}
from memphis-dev-functions.
On lines 150 and 94 there are trailing commas there.
The go marshalling is failing there with the error:
invalid character '}' looking for beginning of object key string
Removing those commas, I see that empty data structures are missing.
I fixed this, and it's updated in the PR. @yanivbh1
from memphis-dev-functions.
Related Issues (3)
- Integration with benthos.dev HOT 1
- Flatten JSON HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from memphis-dev-functions.