-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Closed
Labels
Description
Is your feature request related to a problem? Please describe.
A generated bash client can only send JSON objects, not JSON arrays or ordinary string payloads.
Example:
Creating the following operation with a request body requiring a non-JSON string:
{
"put": {
"operationId": "bar",
"parameters": [
],
"requestBody": {
"description": "String to be parsed",
"content": {
"application/json": {
"schema": {
"type": "string"
}
}
},
"required": true
}
}
}On the server I would like to receive the raw string:
@PUT
public void bar(String body) {
System.out.println("Request body: " + body);
}At the time of writing my only option is to write the payload to a file or send it as JSON:
./client.sh --host http://localhost:8080 bar body==hello
The above results in the JSON blob:
{"body": "hello world"}
Describe the solution you'd like
I would like to instead write:
./client.sh --host http://localhost:8080 bar --body=hello
And receive the string: hello
Describe alternatives you've considered
I have considered a file with the payload but it is very awkward and cumbersome to use.
Reactions are currently unavailable