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.
Adds a notion of partial resources which are an extension of the
PrimaryData
internal type. This allows for separate definitions ofmodels that do not have
id
fields and are not expected to have includeddata.
This is useful in cases where a server should generate the IDs for
resources: https://jsonapi.org/format/1.0/#crud-creating-client-ids
There may be a few edge cases where a user wants support included resources
without an id in the primary data, or wants to only submit relationships
with an ID, but this can be resolved separately.
TODO:
Hi,
Have been thinking about how to resolve #74 and therefore implemented the suggestion of PartialResources to what I would understand them to be. I have added a test, but this change requires an extra macro for implementing a new
PartialJsonApiModel
trait, with the idea that users would invoke this macro for a separate struct, though I am unsure on the ergonomics of this.If there is any feedback on these changes I would appreciate it, otherwise I will try to fixup this PR over the course of the next few weeks with docs and tests.