[BUG][Go] Client tests are invalid for endpoints that do not have a response body
Created by: ctreatma
Bug Report Checklist
-
Have you provided a full/minimal spec to reproduce the issue? -
Have you validated the input using an OpenAPI validator (example)? -
Have you tested with the latest master to confirm the issue still exists? -
Have you searched for related issues/PRs? -
What's the actual output vs expected output? -
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
The Go client generator produces tests for each API client that validate the response from the API. However, the tests assume that the Execute
method for every request type returns a response body. This leads to a syntax error for tests for any request that does not receive a response body (for example: DELETE
responses do not always include content).
openapi-generator version
master
OpenAPI declaration file content or url
openapi: 3.0.0
info:
description: >-
This spec is mainly for testing Petstore server and contains fake endpoints,
models. Please do not use this for any other purpose. Special characters: "
\
version: 1.0.0
title: OpenAPI Petstore
license:
name: Apache-2.0
url: 'https://www.apache.org/licenses/LICENSE-2.0.html'
tags:
- name: pet
description: Everything about your Pets
paths:
/pet:
delete:
tags:
- pet
responses:
'204':
description: OK