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

Tag API: move to primary document format #2605

Closed
ErisDS opened this issue Apr 17, 2014 · 0 comments · Fixed by #2626
Closed

Tag API: move to primary document format #2605

ErisDS opened this issue Apr 17, 2014 · 0 comments · Fixed by #2626
Labels
affects:api Affects the Ghost API good first issue [triage] Start here if you've never contributed before.
Milestone

Comments

@ErisDS
Copy link
Member

ErisDS commented Apr 17, 2014

This issue is a result of the API format discussion in #2362, and is part of a larger project to move our API towards the JSON-API format which is documented in the Epic: #2124. This is one step in the journey towards achieving the Tag JSON object format laid out in #2348.


The equivalent task for Posts (#2580) has been done with the PR #2596 and should serve as an example of how to do this for Tags.

There is only one API route / method for tags which is browse accessible via /ghost/api/v0.1/tags/. The response from this method looks like:

[{...}, {...}]

The aim of this issue is to change the format of the tag object in all requests and responses so that the tag object is contained in an array with the key tags:

{
    tags: [{...}, {...}]
}

This will involve changing the response format, updating all of the places in which the response is used, updating the tests and adding coverage where it is missing.

This issue is marked beginner as there is only one API function to change, and that function is only used by the client side model for editor-tag-widget.js.

It would also be appreciated if you would add docs to this (#2125) as you go. Thanks 👍

@ErisDS ErisDS added this to the 0.4 API milestone Apr 17, 2014
jgable added a commit to jgable/Ghost that referenced this issue Apr 21, 2014
Closes TryGhost#2605

- Change tags browse() response to { tags: [...] }
- Update client side collection to use nested tags document
- Update test references to use response.tags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects:api Affects the Ghost API good first issue [triage] Start here if you've never contributed before.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant