Skip to content

Field options#5518

Merged
sebgie merged 1 commit intoTryGhost:masterfrom
ErisDS:fetch-options
Aug 29, 2015
Merged

Field options#5518
sebgie merged 1 commit intoTryGhost:masterfrom
ErisDS:fetch-options

Conversation

@ErisDS
Copy link
Member

@ErisDS ErisDS commented Jul 4, 2015

This adds a fields parameter to the browse API endpoints. it's super basic - no tests, validation, etc but it works!

refs #5601, #5463, #5343

cc @kevinansfield this should be enough to work with for the auto complete :)

@ErisDS ErisDS changed the title [WIP] Fetch options [WIP] Field options Jul 25, 2015
@ErisDS ErisDS mentioned this pull request Jul 25, 2015
@ErisDS
Copy link
Member Author

ErisDS commented Aug 9, 2015

For clarity, this PR is in a bit of a weird state. I found specifying columns works fine, except when you choose one which is custom / not part of the model itself. E.g.

  • posts.notathing - it returns an empty "notathing" field - where the name is wrapped in quotes
  • posts.url - it returns 2 forms of url one wrapped in quotes, and one not.

Need to upgrade bookshelf & knex and see if the behaviour is still there, and then perhaps raise a bug.

@ErisDS ErisDS force-pushed the fetch-options branch 2 times, most recently from c56fd8e to 5fda77b Compare August 28, 2015 17:39
refs TryGhost#5601, TryGhost#5463, TryGhost#5343

- adds rudimentary support for a 'fields' parameter on browse requests
@ErisDS ErisDS changed the title [WIP] Field options Field options Aug 28, 2015
@ErisDS
Copy link
Member Author

ErisDS commented Aug 28, 2015

I've rebased & fixed the tests on this PR. It's considered rudimentary support, as there's no proper validation or tests for the behaviour as yet, hence not marking it as closing #5601. However, it should be enough to help us ship a version of #5343

sebgie added a commit that referenced this pull request Aug 29, 2015
@sebgie sebgie merged commit 5ce8ca5 into TryGhost:master Aug 29, 2015
@ErisDS ErisDS deleted the fetch-options branch September 27, 2015 13:31
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

Successfully merging this pull request may close these issues.

2 participants