forked from loafle/openapi-generator-original
[dart2] Include request body on DELETE call (#10100)
* Include request body on DELETE call This change updates the generated `ApiClient` to include the request body on DELETE calls. [Per the RFC on page 2][1], DELETE calls are allowed to have a request body, even though the behavior may be undefined. I've not come across many APIs that use this behavior but there are a few, in particular the [Ory Kratos API][2] does so, not forwarding the body prevents such an API from being used. An API spec that does not define a request body should continue to function as expected. [1] https://datatracker.ietf.org/doc/html/rfc7231#section-4.3.5 [2] https://www.ory.sh/kratos/docs/reference/api/#operation/submitSelfServiceLogoutFlowWithoutBrowser * Samples generated with dart2 template change
This commit is contained in:
@@ -127,7 +127,7 @@ class ApiClient {
|
||||
switch(method) {
|
||||
case 'POST': return await _client.post(uri, headers: nullableHeaderParams, body: msgBody,);
|
||||
case 'PUT': return await _client.put(uri, headers: nullableHeaderParams, body: msgBody,);
|
||||
case 'DELETE': return await _client.delete(uri, headers: nullableHeaderParams,);
|
||||
case 'DELETE': return await _client.delete(uri, headers: nullableHeaderParams, body: msgBody,);
|
||||
case 'PATCH': return await _client.patch(uri, headers: nullableHeaderParams, body: msgBody,);
|
||||
case 'HEAD': return await _client.head(uri, headers: nullableHeaderParams,);
|
||||
case 'GET': return await _client.get(uri, headers: nullableHeaderParams,);
|
||||
|
||||
@@ -120,7 +120,7 @@ class ApiClient {
|
||||
switch(method) {
|
||||
case 'POST': return await _client.post(uri, headers: nullableHeaderParams, body: msgBody,);
|
||||
case 'PUT': return await _client.put(uri, headers: nullableHeaderParams, body: msgBody,);
|
||||
case 'DELETE': return await _client.delete(uri, headers: nullableHeaderParams,);
|
||||
case 'DELETE': return await _client.delete(uri, headers: nullableHeaderParams, body: msgBody,);
|
||||
case 'PATCH': return await _client.patch(uri, headers: nullableHeaderParams, body: msgBody,);
|
||||
case 'HEAD': return await _client.head(uri, headers: nullableHeaderParams,);
|
||||
case 'GET': return await _client.get(uri, headers: nullableHeaderParams,);
|
||||
|
||||
@@ -123,7 +123,7 @@ class ApiClient {
|
||||
switch(method) {
|
||||
case 'POST': return await _client.post(uri, headers: nullableHeaderParams, body: msgBody,);
|
||||
case 'PUT': return await _client.put(uri, headers: nullableHeaderParams, body: msgBody,);
|
||||
case 'DELETE': return await _client.delete(uri, headers: nullableHeaderParams,);
|
||||
case 'DELETE': return await _client.delete(uri, headers: nullableHeaderParams, body: msgBody,);
|
||||
case 'PATCH': return await _client.patch(uri, headers: nullableHeaderParams, body: msgBody,);
|
||||
case 'HEAD': return await _client.head(uri, headers: nullableHeaderParams,);
|
||||
case 'GET': return await _client.get(uri, headers: nullableHeaderParams,);
|
||||
|
||||
@@ -123,7 +123,7 @@ class ApiClient {
|
||||
switch(method) {
|
||||
case 'POST': return await _client.post(uri, headers: nullableHeaderParams, body: msgBody,);
|
||||
case 'PUT': return await _client.put(uri, headers: nullableHeaderParams, body: msgBody,);
|
||||
case 'DELETE': return await _client.delete(uri, headers: nullableHeaderParams,);
|
||||
case 'DELETE': return await _client.delete(uri, headers: nullableHeaderParams, body: msgBody,);
|
||||
case 'PATCH': return await _client.patch(uri, headers: nullableHeaderParams, body: msgBody,);
|
||||
case 'HEAD': return await _client.head(uri, headers: nullableHeaderParams,);
|
||||
case 'GET': return await _client.get(uri, headers: nullableHeaderParams,);
|
||||
|
||||
Reference in New Issue
Block a user