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

Contradictory documentation regarding fetch {require: true} #2055

Open
mkastner opened this issue Feb 7, 2020 · 3 comments
Open

Contradictory documentation regarding fetch {require: true} #2055

mkastner opened this issue Feb 7, 2020 · 3 comments
Labels

Comments

@mkastner
Copy link

@mkastner mkastner commented Feb 7, 2020

Introduction

It seems the API-description for "fetch" does not match the actual behaviour and the changelog information.

Issue Description

In the API description for "fetch"

https://bookshelfjs.org/api.html#Collection-instance-fetch

it reads

If you wish to trigger an error if the fetched collection is empty, pass {require: true} as one of the options to the fetch call.

To me, this means, that that {require: true} would be explicitly needed to be set in order to trigger the empty collection error which in return would mean that {require: false} would be the default.

However the current behaviour as described in

https://github.com/bookshelf/bookshelf/blob/master/CHANGELOG.md for version 1.0.0
#2006

says that default would be (and actually is) {require: false}

Therefore I think the API documentation should reflect that by saying:

"If you do not wish to trigger an error if the fetched collection is empty, pass {require: false} as one of the options to the fetch call."

@ricardograca
Copy link
Member

@ricardograca ricardograca commented Feb 7, 2020

You are correct. There is a small inconsistency, but notice that in the parameters list at least it mentions
require=false as the default value.

@ricardograca ricardograca added the docs label Feb 7, 2020
@ricardograca ricardograca added this to To do in Version 1.x.x via automation Feb 7, 2020
@mkastner
Copy link
Author

@mkastner mkastner commented Feb 7, 2020

Oooops, you are right, I missed that one, sorry.

@mkastner mkastner closed this Feb 14, 2020
Version 1.x.x automation moved this from To do to Done Feb 14, 2020
@ricardograca
Copy link
Member

@ricardograca ricardograca commented Feb 14, 2020

Reopening since I agree that the description text could be updated to remove any ambiguity.

@ricardograca ricardograca reopened this Feb 14, 2020
Version 1.x.x automation moved this from Done to In progress Feb 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Version 1.x.x
  
In progress
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.