8000 adding meta at time of encoding · Issue #216 · google/jsonapi · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
adding meta at time of encoding #216
Open
@Br3nda

Description

@Br3nda

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0