Skip to content

Fix singleton routes and add missing query parameters#43

Open
gaetansenn wants to merge 4 commits intomainfrom
features/move-singleton-items-route
Open

Fix singleton routes and add missing query parameters#43
gaetansenn wants to merge 4 commits intomainfrom
features/move-singleton-items-route

Conversation

@gaetansenn
Copy link
Contributor

@gaetansenn gaetansenn commented Nov 7, 2025

@gaetansenn gaetansenn changed the title Move singleton item route to items collection route Fix singleton routes and add missing query parameters Nov 7, 2025
@AlexGaillard AlexGaillard self-requested a review November 7, 2025 18:57
schema:
type: boolean
default: true
Aggregate:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While supported I wonder if we should document aggregate querying? In a singleton context it does not make much sense

example:
display_name: full_name
creation_date: date_created
Group:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as https://github.com/directus/openapi/pull/43/files#r2586004571, in a singleton context group does not make much sense

@kheiner
Copy link

kheiner commented Feb 16, 2026

Just a random person here - but the current documentation separates the singleton object as having a rest endpoint that doesn't exist /items/{collection}/singleton. I'm not familiar enough with swagger/openapi to know if it's possible to both have the correct endpoint represented and avoid the confusion of having aggregate/count for a singleton object because the singleton endpoint is the same as the endpoint for non-singleton items.

If the choices are:

  1. Correct the rest endpoint but have the documentation explain that you can count/aggregate/group a singleton, despite it having no value.
  2. Retain the documentation with a failing rest endpoint to maintain separation of parameters for count/aggregate/group is kept

I think 2 makes the most sense for most cases. Of course, the best case scenario is that it is possible to have option 3 where the endpoint is correct and only relevant parameters.

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.

Invalid update singleton endpoint

3 participants