Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow include in included and data resourses with same id #75

Closed
v1t3 opened this issue Mar 6, 2024 · 1 comment
Closed

Allow include in included and data resourses with same id #75

v1t3 opened this issue Mar 6, 2024 · 1 comment

Comments

@v1t3
Copy link

v1t3 commented Mar 6, 2024

Say, I have resource structure like this:

{
    "data": [
        {
            "type": "news",
            "id": "item1",
            "attributes": {
                "title": "item1"
            },
            "relationships": {
                "also": {
                    "data": [{
                            "type": "news",
                            "id": "item2"
                        }]
                }
            }
        },
        {
            "type": "news",
            "id": "item2",
            "attributes": {
                "title": "item2"
            },
            "relationships": {
                "also": {
                    "data": [{
                            "type": "news",
                            "id": "item3"
                        }]
                }
            }
        }
    ]
}

And I want to get resources like this:

{
    "data": [
        {
            "type": "news",
            "id": "item1",
            "attributes": {
                "title": "item1"
            },
            "relationships": {
                "also": {
                    "data": [{
                            "type": "news",
                            "id": "item2"
                        }]
                }
            }
        },
        {
            "type": "news",
            "id": "item2",
            "attributes": {
                "title": "item2"
            },
            "relationships": {
                "also": {
                    "data": [{
                            "type": "news",
                            "id": "item3"
                        }]
                }
            }
        }
    ],
    "included": [
        {
            "type": "other_companies",
            "id": "item2",
            "attributes": {
                "title": "item2",
                "link": "link",
                "code": "item2",
                ...
            }
        }
    ]
}

For now there will be triggered error "can not have multiple resources with the same identification".

Can we add individual id validation for included?
Just make another claimUsedResourceIdentifier for included.
Or add option for validator.

@v1t3
Copy link
Author

v1t3 commented Aug 21, 2024

not relevant

@v1t3 v1t3 closed this as completed Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant