You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a HTTP message digest needs to be calculated for inclusion in a HTTP signature, the serializeToString() helper function is invoked to serialize the HTTP body, then that serialized value is used to calculate a cryptographic hash of the body, which is set in the Digest header. There are several use cases:
The body is not set (obj argument is null). For example, HTTP GET requests must have an empty body.
The body is set to the empty string. For example a HTTP POST request where the body is the empty string.
The body is the JSON value null. For example, a HTTP POST request body may contain the JSON null value.
The body is the JSON string "null". For example, a HTTP POST request body may contain the JSON "null" value.
The body is some other non-null value.
For use case (1), the serializeToString() function incorrectly returns the String null. Instead the function should return the empty string "". Note: in the case of HTTP GET, the isBodyNullable argument is false and the obj argument is null.
openapi-generator version
master July 15 2020
OpenAPI declaration file content or url
Command line used for generation
Steps to reproduce
Related issues/PRs
Suggest a fix
I had opened a PR earlier: #6634, it was properly handling the HTTP GET case, but the code has diverged since then.
The text was updated successfully, but these errors were encountered:
Bug Report Checklist
Description
When a HTTP message digest needs to be calculated for inclusion in a HTTP signature, the serializeToString() helper function is invoked to serialize the HTTP body, then that serialized value is used to calculate a cryptographic hash of the body, which is set in the
Digest
header. There are several use cases:obj
argument isnull
). For example, HTTP GET requests must have an empty body.null
. For example, a HTTP POST request body may contain the JSONnull
value."null"
. For example, a HTTP POST request body may contain the JSON"null"
value.For use case (1), the serializeToString() function incorrectly returns the String
null
. Instead the function should return the empty string "". Note: in the case of HTTP GET, theisBodyNullable
argument isfalse
and theobj
argument isnull
.openapi-generator version
master July 15 2020
OpenAPI declaration file content or url
Command line used for generation
Steps to reproduce
Related issues/PRs
Suggest a fix
I had opened a PR earlier: #6634, it was properly handling the HTTP GET case, but the code has diverged since then.
The text was updated successfully, but these errors were encountered: