Pass arbitrary JSON objects in request body
See original GitHub issueHow can I pass JSON objects with arbitrary structure in the body of a request? For responses, it is possible to just specify application/json: {}
but that seems not to work for request bodies. Thanks!
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Accept arbitrary JSON as RequestBody in Spring
You can receive a JsonNode object for an arbitrary JSON. Like this: @RequestMapping(value = "test/data", method = RequestMethod.POST ...
Read more >Java – Accept arbitrary JSON as RequestBody in Spring
Is there a simple solution to receiving arbitrary, nested JSON data as part of the RequestBody , or am I forced to either...
Read more >Arbitrary JSON data in API reference
Hi, we have an API endpoint that can take arbitrary JSON in a part of its request body. We tried to express that...
Read more >Describing Request Body
The requestBody is more flexible in that it lets you consume different media types, such as JSON, XML, form data, plain text, and...
Read more >JSON - HTTPie 3.2.1 (latest) docs
If your use case involves sending complex JSON objects as part of the request body, HTTPie can help you build them right from...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Not sure if the OP really meant “arbitrary JSON objects”, as in the title of the issue. If it was meant “JSON objects”, I guess the right schema for the request body would be:
Otherwise, the schema mentioned above (
schema: {}
) would be satisfied by, e.g., an array, a boolean, a string… well, anything, as long as it is valid JSON.This raises an interesting point – how does one specify “the body can be anything at all, including being empty”? An empty body is not valid json. Or, as a corollary: how does one specify “there should not be a body; if there is anything, this is a violation”? Perhaps there is a FAQ or cookbook that I have not found yet 😃