Skip to content

Handle empty application/json request bodies#1043

Merged
deepmap-marcinr merged 1 commit intooapi-codegen:masterfrom
kurtinge:master
May 13, 2023
Merged

Handle empty application/json request bodies#1043
deepmap-marcinr merged 1 commit intooapi-codegen:masterfrom
kurtinge:master

Conversation

@kurtinge
Copy link
Copy Markdown
Contributor

@kurtinge kurtinge commented May 9, 2023

If you define a POST request with an empty json body the codegen will fail with
panic: runtime error: invalid memory address or nil pointer dereference

Example of a definition that will fail:

 '/token':
    post:
      operationId: post-token
      requestBody:
        content:
          application/json: {}

@deepmap-marcinr deepmap-marcinr merged commit c1a42f7 into oapi-codegen:master May 13, 2023
adrianpk pushed a commit to foorester/oapi-codegen that referenced this pull request Jan 16, 2024
adrianpk added a commit to foorester/oapi-codegen that referenced this pull request May 31, 2024
danicc097 pushed a commit to danicc097/oapi-codegen that referenced this pull request Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants