OpenAPITools / OpenAPITools/openapi-generator
[BUG][GO] Compilation error, undefined OneOf
Open
Nobody has claimed this yet.
Issue: Bug
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
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
Generated code doesn't compile due to undefined OneOf.
openapi-generator version
7.0.0 and 7.0.1
OpenAPI declaration file content or url
https://gist.github.com/morus12/d99446557841985e4912a5453422956d
Generation Details
openapi-generator generate -i spec.yaml -o client -g go
Steps to reproduce
- Generate client
- Run
go test
./api_default.go:28:8: undefined: OneOf
./api_default.go:31:38: undefined: OneOf
Related issues/PRs
Suggest a fix
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the OpenAPI declaration linked in the issue and reproduce it using openapi-generator generate -i spec.yaml -o client -g go. Inspect the generated api_default.go around the reported OneOf references, then run go test; done means the generated client compiles without undefined OneOf errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100