Skip to content

Update spec to include repository endpoint#611

Draft
jcarter3 wants to merge 1 commit into
opencontainers:mainfrom
jcarter3:repository-listing
Draft

Update spec to include repository endpoint#611
jcarter3 wants to merge 1 commit into
opencontainers:mainfrom
jcarter3:repository-listing

Conversation

@jcarter3
Copy link
Copy Markdown
Contributor

@jcarter3 jcarter3 commented May 7, 2026

Throwing out a proposal to replace/enhance _catalog

Signed-off-by: Jeff Carter <jeff.carter@docker.com>
@jcarter3 jcarter3 force-pushed the repository-listing branch from 7be79d4 to 2fec3d1 Compare May 7, 2026 16:08
Copy link
Copy Markdown
Contributor

@sudo-bmitch sudo-bmitch left a comment

Choose a reason for hiding this comment

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

Just a first pass. As with the tag listing, I'm going to want to spend some time implementing it and see a conformance test before approving.

Comment thread extensions/_oci.md
Repository listing MAY be retrieved with a standard `GET` as follows.

```HTTP
GET /v2/<name>/_oci/repositories
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

To follow the _extension/module/component syntax, perhaps:

Suggested change
GET /v2/<name>/_oci/repositories
GET /v2/<name>/_oci/repository/list

Comment thread extensions/_oci.md
When `<name>` is empty, the path is:

```HTTP
GET /v2/_oci/repositories
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
GET /v2/_oci/repositories
GET /v2/_oci/repository/list

Comment thread extensions/_oci.md
GET /v2/_oci/repositories
```

A registry that does not support listing repositories with an empty `<name>` MUST return a `405 Method Not Allowed` response code for this request.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn't it be 404, same as a registry that doesn't implement the extension? I'd also consider "SHOULD" since implementations are really good at throwing other 4xx codes, along with the occasional 5xx. We'd like registries to be consistent, but clients should be prepared for a wild west.

Comment thread extensions/_oci.md

A registry that does not support listing repositories with an empty `<name>` MUST return a `405 Method Not Allowed` response code for this request.

When non-empty, `<name>` is a `/` delimited repository namespace path.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Perhaps we should say <prefix> or some other term since <name> is used throughout the spec to refer to the full namespace path.

Comment thread extensions/_oci.md
For this endpoint, a non-empty `<name>` is used as a namespace segment prefix and MUST include one or more complete namespace segments.
For requests with a non-empty `<name>`, returned repositories MUST have names that are equal to `<name>` or that begin with `<name>/`.
Registries MUST NOT treat a non-empty `<name>` as a partial namespace segment prefix.
For example, given repositories `foo/bar`, `foo/baz`, and `bar/baz`, a request to `/v2/foo/_oci/repositories` returns `foo/bar` and `foo/baz`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

To make it clear the segments must be complete, I'd include a matching partial segment:

Suggested change
For example, given repositories `foo/bar`, `foo/baz`, and `bar/baz`, a request to `/v2/foo/_oci/repositories` returns `foo/bar` and `foo/baz`.
For example, given repositories `foo/bar`, `foo/baz`, and `foobar/baz`, a request to `/v2/foo/_oci/repositories` returns `foo/bar` and `foo/baz`.

Comment thread extensions/_oci.md
For example, given repositories `foo/bar`, `foo/baz`, and `bar/baz`, a request to `/v2/foo/_oci/repositories` returns `foo/bar` and `foo/baz`.

A successful request MUST return a `200 OK` response code.
If the namespace path is invalid or the registry cannot list repositories under it, the registry MUST return an appropriate error response.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should list the expected error response codes. I'm expecting 400, 401, 403, and 404 to all be expected errors to cover invalid prefix, not found prefix, unauthorized, and extension not implemented.

Comment thread extensions/_oci.md
The value MUST match the repository name syntax defined for `<name>` in this specification.
The value MUST be equal to the requested namespace path or have the requested namespace path as a complete namespace segment prefix.

Repository objects MAY include additional properties.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
Repository objects MAY include additional properties.
Repository objects MAY include additional properties.
Field order and whitespace may vary by implementation.

Comment thread extensions/_oci.md
Comment on lines +134 to +150
- **`n`** *integer*, OPTIONAL

Specifies the maximum number of results to return.
The registry MAY return fewer results than requested if fewer matching repositories exist or a `Link` header is provided.
Otherwise, the response MUST include `n` results.
When `n` is zero, this endpoint MUST return an empty array and MUST NOT include a `Link` header.
When `n` is not specified, the registry MAY apply a default limit.

- **`last`** *string*, OPTIONAL

Specifies the `name` value of the last repository object received by the client.
When provided, the response MUST begin non-inclusively after `last` in the ordered repository list.
The `last` value MUST NOT be a numerical index.
When using the `last` query parameter, the `n` parameter is OPTIONAL.

A `Link` header MAY be included in the response when additional repositories are available.
If included, the `Link` header MUST be set according to [RFC5988](https://www.rfc-editor.org/rfc/rfc5988.html) with the Relation Type `rel="next"`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm sure the pagination was pulled from the tag listing. I think there's debate on whether the Link header or the last parameter should be used, and for historical reasons we ended up needing to document/support both. For a green field API, we have an opportunity to pick a single pagination option, and I'd probably lean towards the Link header for that. Then we could remove the n and last 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.

2 participants