Skip to content

Bug: Marshaling Content omits medadata #631

@IAmSurajBobade

Description

@IAmSurajBobade

Describe the bug
Content interface has wireContent method - which marshals bytes to struct implementing Content interface.

Meta property in wireContent, has JSON tag _meta.

type wireContent struct {
        ....
	Meta        Meta              `json:"_meta,omitempty"`
}

however, structs do not have json tag defined, so it expects meta, instead of _meta from byte array.

type ResourceLink struct {
	...
	Meta        Meta
}

We should add json tag for Meta in all structs implementing Content interface. So ResourceLink would become

type ResourceLink struct {
	...
	Meta        Meta              `json:"_meta,omitempty"`
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions