Title: Relationship without data property · Issue #92 · json-api-php/json-api · GitHub
Open Graph Title: Relationship without data property · Issue #92 · json-api-php/json-api
X Title: Relationship without data property · Issue #92 · json-api-php/json-api
Description: Hi, I'd like to create resource with following relationship my_relation, which only contains links property, ie. there is no data property with resource linkage: { "data": { "type": "...", "id": "...", "relationships": { "my_relation": {...
Open Graph Description: Hi, I'd like to create resource with following relationship my_relation, which only contains links property, ie. there is no data property with resource linkage: { "data": { "type": "...", "id": "....
X Description: Hi, I'd like to create resource with following relationship my_relation, which only contains links property, ie. there is no data property with resource linkage: { "data": { "typ...
Opengraph URL: https://github.com/json-api-php/json-api/issues/92
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Relationship without data property","articleBody":"Hi,\r\nI'd like to create resource with following relationship `my_relation`, which only contains `links` property, ie. there is no `data` property with resource linkage:\r\n\r\n```json\r\n{\r\n \"data\": {\r\n \"type\": \"...\",\r\n \"id\": \"...\",\r\n \"relationships\": {\r\n \"my_relation\": {\r\n \"links\": {\r\n \"related\": \"/foo\"\r\n }\r\n }\r\n }\r\n }\r\n}\r\n```\r\n\r\nThis is allowed as per [JSON:API spec](https://jsonapi.org/format/#document-resource-object-relationships): \r\n\r\n> A “relationship object” MUST contain at least one of the following:\r\n> - links: a links object \r\n> - data: resource linkage\r\n> - meta: a meta object that contains non-standard meta-information about the relationship.\r\n\r\nIs there any way how to accomplish this now, with version 2 of the library? It was possible with version 1:\r\n```php\r\n$resourceObject->setRelationship('my_relation', Relationship::fromRelatedLink('/foo'));\r\n```\r\n\r\nHowever now there seems to be only `ToNull`, `ToOne` and `ToMany` relation, neither of which accomplishes exactly this (eg. ToNull adds `data: null` to the relationship).","author":{"url":"https://github.com/OndraM","@type":"Person","name":"OndraM"},"datePublished":"2019-02-19T13:27:02Z","url":"https://github.com/json-api-php/json-api/issues/92"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:63c71733-0ee9-05d0-c648-b0c1da82f0b2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9A06:2AAD2E:B7EA8D:F6E4C9:6B00F6B9 |
| html-safe-nonce | 4a67532b8a10a434285f54d496211534660dad43751bac56a154a356d1fd84fa |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QTA2OjJBQUQyRTpCN0VBOEQ6RjZFNEM5OjZCMDBGNkI5IiwidmlzaXRvcl9pZCI6IjY2NTA4MTAzMDUyMDE0MTQ5NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 79fdd294791fc72c89b7329cfc22edaa4096f0e80dfbe37d1ed8023b9a5f8fd2 |
| hovercard-subject-tag | issue:411922818 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/json-api-php/json-api/92/issue_layout |
| twitter:image | https://opengraph.githubassets.com/38bf8b3c5b6f52c9438fe78d29d4219b9dbf209c9a989b8f6614fc136161c433/json-api-php/json-api/issues/92 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/38bf8b3c5b6f52c9438fe78d29d4219b9dbf209c9a989b8f6614fc136161c433/json-api-php/json-api/issues/92 |
| og:image:alt | Hi, I'd like to create resource with following relationship my_relation, which only contains links property, ie. there is no data property with resource linkage: { "data": { "type": "...", "id": ".... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | OndraM |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| turbo-cache-control | no-preview |
| go-import | github.com/json-api-php/json-api git https://github.com/json-api-php/json-api.git |
| octolytics-dimension-user_id | 26732274 |
| octolytics-dimension-user_login | json-api-php |
| octolytics-dimension-repository_id | 86419223 |
| octolytics-dimension-repository_nwo | json-api-php/json-api |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 86419223 |
| octolytics-dimension-repository_network_root_nwo | json-api-php/json-api |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9983dd5da06943f833c971dd5b6bc988e2858be5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width