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

Feature request: support JSON formatting for application/vnd.api+json #61

Closed
jceb opened this issue Sep 2, 2021 · 4 comments
Closed
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@jceb
Copy link

jceb commented Sep 2, 2021

JSON:API uses the content-type application/vnd.api+json. It would be great if the jq formatting could be applied to it as well.

@NTBBloodbath NTBBloodbath added enhancement New feature or request good first issue Good for newcomers labels Sep 2, 2021
@NTBBloodbath
Copy link
Member

Hey, thank you for requesting this, being honest I didn't know about this haha

I think the commit that I pushed a few seconds ago should do the trick, please update and tell me if it works :)

Regards

@jceb
Copy link
Author

jceb commented Sep 2, 2021

Works great, thanks a lot!

@jceb jceb closed this as completed Sep 2, 2021
@manutepowa
Copy link

Why this json is not formatting with jq

Is a drupal JSON:API response

{"jsonapi":{"version":"1.0","meta":{"links":{"self":{"href":"http://jsonapi.org/format/1.0/"}}}},"data":[{"type":"node--libros","id":"60892248-28a3-46af-8830-8fc59de00fc7","links":{"self":{"href":"https://apiplatform.ddev.site/api/node/libros/60892248-28a3-46af-8830-8fc59de00fc7?resourceVersion=id%3A1"}},"attributes":{"drupal_internal__nid":1,"drupal_internal__vid":1,"langcode":"es","revision_timestamp":"2022-11-26T17:44:55+00:00","revision_log":null,"status":true,"title":"Libro 1","created":"2022-11-26T17:44:40+00:00","changed":"2022-11-26T17:44:55+00:00","promote":false,"sticky":false,"default_langcode":true,"revision_translation_affected":true,"path":{"alias":null,"pid":null,"langcode":"es"},"body":{"value":"\u003Cp\u003Eel libro del rey\u003C/p\u003E\r\n","format":"basic_html","processed":"\u003Cp\u003Eel libro del rey\u003C/p\u003E","summary":""}},"relationships":{"node_type":{"data":{"type":"node_type--node_type","id":"d9dc0c1b-5251-475a-b6a6-ac3497c01ddd","meta":{"drupal_internal__target_id":"libros"}},"links":{"related":{"href":"https://apiplatform.ddev.site/api/node/libros/60892248-28a3-46af-8830-8fc59de00fc7/node_type?resourceVersion=id%3A1"},"self":{"href":"https://apiplatform.ddev.site/api/node/libros/60892248-28a3-46af-8830-8fc59de00fc7/relationships/node_type?resourceVersion=id%3A1"}}},"revision_uid":{"data":{"type":"user--user","id":"ad3ca2c2-08ef-4664-b9ae-f8f956c2cf42","meta":{"drupal_internal__target_id":1}},"links":{"related":{"href":"https://apiplatform.ddev.site/api/node/libros/60892248-28a3-46af-8830-8fc59de00fc7/revision_uid?resourceVersion=id%3A1"},"self":{"href":"https://apiplatform.ddev.site/api/node/libros/60892248-28a3-46af-8830-8fc59de00fc7/relationships/revision_uid?resourceVersion=id%3A1"}}},"uid":{"data":{"type":"user--user","id":"ad3ca2c2-08ef-4664-b9ae-f8f956c2cf42","meta":{"drupal_internal__target_id":1}},"links":{"related":{"href":"https://apiplatform.ddev.site/api/node/libros/60892248-28a3-46af-8830-8fc59de00fc7/uid?resourceVersion=id%3A1"},"self":{"href":"https://apiplatform.ddev.site/api/node/libros/60892248-28a3-46af-8830-8fc59de00fc7/relationships/uid?resourceVersion=id%3A1"}}}}}],"links":{"self":{"href":"https://apiplatform.ddev.site/api/node/libros"}}}

@peterfication
Copy link

Anyone still having an issue with this, have a look here: #143 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants