Skip to content

Enumerate available choices in response to requests with ambiguous prefixes #44685

@corhere

Description

@corhere

Description

Several Engine API endpoints accept truncated IDs (e.g. container ID, image digest) which the engine resolves to the full ID if the prefix is unique, or it responds HTTP 404 Not Found with an "ambiguous prefix" error message in the body. Advanced "user-agent" clients (i.e. with a human in the loop) would be able to ask the user to disambiguate, if only they knew which choices to present to the user. We could help those clients out by enumerating the choices in the response.

There's even an HTTP status code which semantically fits if you squint a bit: 300 Multiple Choices. Switching status codes would have to be API version-gated so as not to break existing clients, and the semantics are a debatable fit, so sticking with 404 and merely augmenting the response body may be the more pragmatic option.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/apiAPIkind/enhancementEnhancements are not bugs or new features but can improve usability or performance.status/0-triage

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions