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

adding meta at time of encoding #216

Open
Br3nda opened this issue May 9, 2022 · 0 comments
Open

adding meta at time of encoding #216

Br3nda opened this issue May 9, 2022 · 0 comments

Comments

@Br3nda
Copy link

Br3nda commented May 9, 2022

can you help me work out how to inject the result count into the meta? i have it in an int64 in my own function

func Encode(w io.Writer, mm interface{}, resultCount int64) error {
	return jsonapi.MarshalPayload(w, mm)
}

I see I can add it to a each of my model structs as a JSONAPIMeta() but those models don't know the count of results, I don't have a way of getting the integer into those objects.

Can't I just tell the jsonapi module what to put in the meta at time of encoding?

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

1 participant