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

Fizz does not work with generic structs #80

Open
LorenzoWF opened this issue Jun 6, 2022 · 4 comments
Open

Fizz does not work with generic structs #80

LorenzoWF opened this issue Jun 6, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@LorenzoWF
Copy link

LorenzoWF commented Jun 6, 2022

With the 1.18 version of Go, we can have this:

type MyStruct[T ObjA | ObjB] struct {
    Result T `json:"result"`
}

But unfortunately the fizz cannot generate the spec for this :(

@wI2L
Copy link
Owner

wI2L commented Aug 18, 2022

Indeed, the reflect part of the code has not been updated to work with generic code introduced by Go1.18. I might work on it at some point (really depends if there's a need for projects at OVH), but otherwise I would be happy to accept contributions.

@wI2L wI2L added the enhancement New feature or request label Aug 18, 2022
@LorenzoWF
Copy link
Author

Ok, probably i will be send a PR or a draft ideia here 👍 .

@wI2L
Copy link
Owner

wI2L commented Aug 19, 2022

Changes made to fizz should be made to tonic first, since the former depends on the latter to work.
I'd need to document myself on the reflect package changes introduced by the addition of generics to get a better understanding of how it can be done.

@nadilas
Copy link

nadilas commented Apr 7, 2023

I'd like to help out. @LorenzoWF did you manage to get to a draft?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants