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

inconsistent response when no data is available #40

Open
pdmytrewycz opened this issue Dec 22, 2020 · 1 comment
Open

inconsistent response when no data is available #40

pdmytrewycz opened this issue Dec 22, 2020 · 1 comment

Comments

@pdmytrewycz
Copy link

pdmytrewycz commented Dec 22, 2020

I didn't really know how else to title this issue, but here are the details:

Currently when asking the client for all Xs under Y (assets under franchise for example), if there are Xs it returns data as an array of objects. One for each X. Great!

...if there are no Xs, it returns Y's top level properties of meta, data, jsonapi, etc.

Perhaps this is expected behavior as written, but I feel it would be more intuitive to simply return an empty array if there are no Xs under Y. It's not an earth-shattering issue. Just something odd I noticed that might merit reexamination. This is otherwise a great client that has saved us a lot of time and headache!

Thanks, Paul Dmytrewycz (KET)

@tamw-wnet
Copy link
Owner

Hi Paul -- sorry for the delay, I've been away for the holidays.

This is somewhat expected behavior, I think, since the main thing this client does is just format the request to the API and pass back the raw results (unless there's an error). Can you confirm a specific call this does this for? it may make sense for us to add a flag to just return that empty array.

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

No branches or pull requests

2 participants