Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jimbeaudoin Thanks for this! mind taking a look at #1782 and see what you think? cc @beauby
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bf4 I don't know about moving root at the adapter level. I think it's fine
here but it's my opinion.
Ex: if I have a model
Api::V1:Postthe root object name of the payload isgoing to be
api/v1/postsnotposts. This is why I used this settings inthe serializer.
But this is the first time I separate my models like that (Api::V1::x). I
don't know if it's a good practice or not. This is a new experience on a
new API in development.
What you can do is merge this small documentation block to master because
this is how you can update root right now and it can help others on
v0.10.x.
And then update the doc in PR #1782 if she got merged. Like you, I think
it's going to need a deprecation warning before removing the old code.
On Thu, Jun 9, 2016 at 8:48 PM, Benjamin Fleischer <notifications@github.com
Jimmy Beaudoin
email@jimmy-beaudoin.com
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jimbeaudoin well, the thing is that
rootat this time is an options that is passed into the serializer. The method you would want to override is actuallyjson_keyor even set thetype. (That's why I referenced the other pr which describes some of this in the diff). I'd certainly merge this change as an option to setting the resource root, but am hesitant for the documentation to advocate an unintended usage...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bf4 Ok I see, this PR can be closed then.
json_keyto the rescue! Thanks! :)