#Sh0w3D - JSON

1 messages ยท Page 1 of 1 (latest)

grizzled scarab
#

Hi there!

weary ocean
#

I just need one specific customer

grizzled scarab
#

And is that code working? If not, what is the error message?

weary ocean
#

Yes, the code is working

grizzled scarab
#

So what is the issue?

weary ocean
#

Just the json response is too big. Like the stripeResponse object is additional and unwanted and some properties look something like:

#

testClock": null, "rawJObject": { "id": [], "object": [], "address": [ [ [] ], [ [] ], [ [] ], [ [] ], [ [] ], [ [] ] ],

#

and this:

#

stripeResponse": { "content": "private", "statusCode": 200, "headers": [

#

stripeResponse is unwanted property. when i request Customer

#

and response is like:
customer object,
stripeResponse object

#

I want only customerObject

#

this is response

#

It does not look like person class

#

some customer properties have nested rawJObject properties and that is not what customer in docs look like

#

test.json contains fake data**

weary ocean
#

@grizzled scarab, sorry to bother but please check the file i'll upload and (correct me if I am wrong) please check if this is Customer api response with customer object

autumn yarrow
#

๐Ÿ‘‹ taking over for my colleague. Let me catch up.

weary ocean
#

thank you

autumn yarrow
#

are you using await with the GetAsync?

#

you shouldn't be getting a raw body, you should receive the Customer Object

weary ocean
#

This is my code

#

Sorry for the formatting

autumn yarrow
#

no worries

weary ocean
#

i don't know how to send the code

autumn yarrow
#

you can use three `

weary ocean
#

ohh

autumn yarrow
#

that will generate a code span

weary ocean
#

Okey, thank You

weary ocean
autumn yarrow
#

what I don't understand is where are you reading the JSON response?

weary ocean
#

In Postman

autumn yarrow
#

you should only care about the Customer object

weary ocean
#

I am using Clean Architecture dot .NET 6.0

autumn yarrow
#

I don't understand the question then

#

you shouldn't concern yourself with the raw body of the request

#

this is used by our SDK to construct the correct object you are awaiting for

weary ocean
#

So I need You api to return CLEAN CUSTOMER object, but You give me additional unwanted info, and I don't know how to remove or avoid the info

weary ocean
#

I need clean customer object

autumn yarrow
#

it is a clean Customer object if you use the Customer object provided by the SDK

#

if there are info you don't need to send to the front-end you'd have to build your own object

#

and do some mappings

weary ocean
#

Ok.. Got it, thanks

#

does Stripe provide some objects like in documentation?

normal ocean
#

Hey, taking over here. Can you clarify the Q?

weary ocean
#

yes, one moment

weary ocean
#

This is Your api response for customerService.GetAsync()

#

but it does not look like Customer object in documentation

#

It contains rawJObject

normal ocean
#

Can you share the code you're using to make the API request

weary ocean
#

This is my code

#

If You need any more information, You can call me on discord in a few moments

#

I don't know if it'll be easier to explain while talking

normal ocean
#

We don't do voice calls

weary ocean
#

Ok, no problem

#

I am not mapping any returned object and everywhere I am returning type Customer

normal ocean
#

Which version of stripe-dotnet are you using?

weary ocean
#

newest

#

result of dotnet list packages command

normal ocean
weary ocean
#

So, how do I avoid returning undocumented properties?

normal ocean
#

You can't

weary ocean
#

Oh

#

I get it, thanks

#

I'll just create new Customer and fill it with retrieved data from api

#

This way I can remove some of the unwanted properties

#

thank you all for your time

normal ocean
#

np!