Skip to content

Multipart request spec file upload #845

Closed Answered by obmarg
djkato asked this question in Q&A
Discussion options

You must be logged in to vote

That error looks a lot like a JSON decoding error.

If you look at the docs for CategoryInput description is a JSONString, which I assume should be a string containing JSON. You can see from your request dump that description is being set to "lol" which isn't valid JSON.

You probably want to make it valid JSON, I think that will fix your issue.

I see you're doing this:

description: Some(Jsonstring {
                    0: "lol".to_string(),
                }),

So I assume you've defined something like struct Jsonstring(String). You could either use serde_json::to_string to populate that string with JSON, or hardcode the JSON by hand.

A slightly better (but definitely more effort) solution…

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@obmarg
Comment options

Answer selected by djkato
@djkato
Comment options

Comment options

You must be logged in to vote
1 reply
@obmarg
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants