google / google/gnostic

OpenAPI 3 empty object responses generate invalid Go clients

Open
#86 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2.3k
Forks
279
PR merge metrics
No merged PRs in 30d

Description

Empty object responses are causing gnostic to produce invalid go stanzas:

Given a schema response such as:
```
responses:
'200':
description: Any endpoint that yields "{}"
content:
application/json:
schema:
type: object
```

gnostic produces a client method whose result is:

`result := &interface{}{}`

I've also tried adding the implicit: `properties: {}`, but the generated client includes the same bug (`expected ';', found '{'`).

More details can be found here, https://gist.github.com/displague/31700ba03009d1a183297949c54e7471 including the schema being used and the full client output.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.