Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for type: object and {} #3

Closed
ysamlan opened this issue May 2, 2019 · 3 comments
Closed

Support for type: object and {} #3

ysamlan opened this issue May 2, 2019 · 3 comments

Comments

@ysamlan
Copy link

ysamlan commented May 2, 2019

This project is great, glad I found it. Noticed this running against my own project:

The Java OpenAPI Tools code generator templates for go support type: object and Any Type ({} in OpenApi syntax) types, which I believe should just translate to map[string]interface{} and interface{} respectively, I think.

object just errors out in the current oapi-codegen, and using {} results in an empty anonymous struct type, which isn't quite right.

@deepmap-marcinr
Copy link
Contributor

You're right, I'll patch that soon, it should be simple enough.

@deepmap-marcinr
Copy link
Contributor

I'm guessing if I support map[string]interface{}, I might as well add additionalProperties support, since that's the same thing.

@deepmap-marcinr
Copy link
Contributor

Done, at least for type:object and {}, additionalProperties is a bit harder, so I'm punting it.

fenngwd added a commit to fenngwd/oapi-codegen that referenced this issue Mar 26, 2021
Generate interface{} for openapi's Any
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

No branches or pull requests

2 participants