V8-archive: Items endpoint not respecting status as documented/expected

Created on 18 Apr 2019  路  7Comments  路  Source: directus/v8-archive

Bug Report

Fetching and item from the api endpoint the status parameter is ignored.

Bildschirmfoto 2019-04-18 um 09 00 30

But the documentations clearly specifies status as valid parameter.

Bildschirmfoto 2019-04-18 um 09 09 30

Steps to Reproduce

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '...'
  4. See error

Expected Behavior

Either the docs should be updated, or the api should use the parameter and return the data accordingly instead of ignoring the parameter.

If you clarify which (docs or api) should be fixed i will try to provide a PR.

Most helpful comment

Thx @shealavington for the clarification.
And sorry for the bad/unclear/unspecific description.

/items works as expected and as documented, but /items/[pk] does not.
As shown in the screen shots, the docs list status as valid parameter for /items/[pk] but it is ignored in this case.

All 7 comments

It's worth mentioning:

The status filter does work fine for the /items endpoint, however, it's only when specifying a primary-key, and trying to fetch a single item /items/[pk] that the item doesn't filter.

As noted, it's probably just a Documentation update that a single item can't be filtered.

Thx @shealavington for the clarification.
And sorry for the bad/unclear/unspecific description.

/items works as expected and as documented, but /items/[pk] does not.
As shown in the screen shots, the docs list status as valid parameter for /items/[pk] but it is ignored in this case.

Thanks @Lapsus! So the bigger question here: How _should_ it work? Does it make sense to have the status parameter on the /items endpoint?

ping @rijkvanzanten

I think, it makes sense for the status parameter to only work on the /items endpoint (at root level). When requesting a single item using a primary key, status shouldn't work (as filters don't) /items[/[primary-key].

Perhaps this could be a future enhancement to allow filtering of single items based on criteria, but I don't think it's important. For now I think we just need to remove status as a valid parameter in the docs for the /items[/pk] endpoint.

Otherwise there would need to be a discussion about allowing filters on each item, and potentially returning item not found when actually, the primary could be found, but the filters, filtered it out.

Ok, i basically agree.
If filter and status dont work when /items/[pk] is used, then i suggest that i update the docs.
Which is fine for me.

Agree! I do want to make clear that the /item endpoint should still _honor_ the status.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gitlabisbetterthangithub picture gitlabisbetterthangithub  路  3Comments

jwkellyiii picture jwkellyiii  路  3Comments

cdwmhcc picture cdwmhcc  路  3Comments

metalmarco picture metalmarco  路  3Comments

ondronix picture ondronix  路  3Comments