Skip to content
This repository was archived by the owner on Sep 4, 2025. It is now read-only.

Conversation

sbelkin88
Copy link
Contributor

No description provided.

@svperfecta
Copy link

Very nice! Question on this.. I wonder if we should support creating objects with meta too? We support creating objects with relationships.

@sbelkin88
Copy link
Contributor Author

@genexp I believe this PR accomplishes that, but can you please clarify if you're looking for something different? This PR allows meta to be added at the resource object-level and relationship level. Then, in the same vein as the recent PR for Links, we can add meta at the top level by doing something like:

payload, _ := jsonapi.MarshalMany(blogPosts)

payload.Meta = &jsonapi.Meta{
	"details": "extra information here",
}

json.NewEncoder(w).Encode(payload)

@aren55555 aren55555 self-assigned this Feb 13, 2017
@svperfecta
Copy link

svperfecta commented Feb 15, 2017

Hey @sbelkin88 - I guess I was asking about UnmarshalMany, and receiving metadata. After re-reading the spec, I'm actually not sure if this is possible or not. I can see it being useful (we let games submit data to us, and having the ability to add metadata about how it was received would be handy), but I don't think we should deviate in any way from spec.

@aren55555 aren55555 changed the base branch from master to feature/meta February 17, 2017 01:40
@aren55555 aren55555 merged commit 776433d into google:feature/meta Feb 17, 2017
@sbelkin88
Copy link
Contributor Author

Hi @aren55555 - I saw the @googlebot's message above, but I believe I am the author for all the commits in this branch. Can you please help advise if there is any action needed, or where the other author is so I can contact them if necessary? Also, are you able to advise on what the feature/meta branch is, and whether that will be merged into master?

@aren55555
Copy link
Contributor

@sbelkin88 the @googlebot is because I resolved the conflict. The mixed branch authors cause that message; in this case it can be ignored.

As for the feature/meta there are a couple changes that need to be made including:

  • Making the Links objects implement the interface
  • Adding examples to the example app and fixtures

I've already started on both of those and will mention this PR when I open a PR to merge feature/meta to master. I was not able to commit directly to your branch (when you submit a PR there is an option to allow us to contribute back to your source branch that was not checked) so I had to go with this option.

@aren55555 aren55555 mentioned this pull request Feb 17, 2017
@aren55555
Copy link
Contributor

See #81 for the subsequent changes I made.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants