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 struct embedding #244

Closed
skonto opened this issue Jul 9, 2019 · 5 comments
Closed

Support struct embedding #244

skonto opened this issue Jul 9, 2019 · 5 comments

Comments

@skonto
Copy link

skonto commented Jul 9, 2019

I am hitting this one:

ctx.pkg.AddError(loader.ErrFromNode(fmt.Errorf("enountered struct field %q without JSON tag in type %q", field.Name, ctx.info.Name), field.RawField))
(btw there is a typo there s/enountered/encountered)
While my types are valid. They just use struct embedding.

@DirectXMan12
Copy link
Contributor

can you please provide the actual struct that you're using? Embedded fields should be handled fine.

@DirectXMan12
Copy link
Contributor

you'll need to mark the field with json:",inline", though

@skonto
Copy link
Author

skonto commented Jul 16, 2019

@DirectXMan12
Copy link
Contributor

yeah, that just needs the tag

@skonto
Copy link
Author

skonto commented Jul 24, 2019

@DirectXMan12 feel free to close it. It worked thanks!

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