Skip to content

Commit 0f5c795

Browse files
authored
Fix issue #24406: correct Docker Hub API documentation (#24443)
Fixes discrepancies in the Docker Hub organization access token API documentation to match actual API behavior. Changes: - Removed `created_by` field from create endpoint response (API only returns `created_at`) - Updated scope examples from `repo-pull` to `scope-image-pull` (correct format with `scope-` prefix) - Enhanced repository path documentation with validation requirements for TYPE_REPO resources These changes align the OpenAPI specification with the actual API implementation as discovered during Terraform provider development. Fixes #24406 --------- Co-authored-by: David Karlsson <dvdksn@users.noreply.github.com>
1 parent 369f69b commit 0f5c795

1 file changed

Lines changed: 74 additions & 44 deletions

File tree

content/reference/api/hub/latest.yaml

Lines changed: 74 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,7 @@ paths:
11041104
summary: "Update repository immutable tags"
11051105
description: |
11061106
Updates the immutable tags configuration for this repository.
1107-
1107+
11081108
**Only users with administrative privileges for the repository can modify these settings.**
11091109
tags:
11101110
- repositories
@@ -1132,7 +1132,7 @@ paths:
11321132
summary: "Verify repository immutable tags"
11331133
description: |
11341134
Validates the immutable tags regex pass in parameter and returns a list of tags matching it in this repository.
1135-
1135+
11361136
**Only users with administrative privileges for the repository call this endpoint.**
11371137
tags:
11381138
- repositories
@@ -1167,7 +1167,7 @@ paths:
11671167
content:
11681168
application/json:
11691169
schema:
1170-
$ref: '#/components/schemas/RepositoryGroupCreationRequest'
1170+
$ref: "#/components/schemas/RepositoryGroupCreationRequest"
11711171
example:
11721172
group_id: 12345
11731173
permission: "write"
@@ -1177,7 +1177,7 @@ paths:
11771177
content:
11781178
application/json:
11791179
schema:
1180-
$ref: '#/components/schemas/RepositoryGroup'
1180+
$ref: "#/components/schemas/RepositoryGroup"
11811181
example:
11821182
group_name: "developers"
11831183
permission: "write"
@@ -1202,13 +1202,13 @@ paths:
12021202
summary: List repositories in a namespace
12031203
description: |
12041204
Returns a list of repositories within the specified namespace (organization or user).
1205-
1205+
12061206
Public repositories are accessible to everyone, while private repositories require appropriate authentication and permissions.
12071207
tags:
12081208
- repositories
12091209
security:
1210-
- bearerAuth: [ ]
1211-
- { } # Allow anonymous access for public repositories
1210+
- bearerAuth: []
1211+
- {} # Allow anonymous access for public repositories
12121212
parameters:
12131213
- in: query
12141214
name: page
@@ -1327,7 +1327,10 @@ paths:
13271327
summary: Invalid ordering value
13281328
value:
13291329
fields:
1330-
ordering: [ "Invalid ordering value. Must be one of: name, -name, last_updated, -last_updated, pull_count, -pull_count" ]
1330+
ordering:
1331+
[
1332+
"Invalid ordering value. Must be one of: name, -name, last_updated, -last_updated, pull_count, -pull_count",
1333+
]
13311334
text: "Invalid ordering value"
13321335
"401":
13331336
$ref: "#/components/responses/unauthorized"
@@ -1348,13 +1351,13 @@ paths:
13481351
tags:
13491352
- repositories
13501353
security:
1351-
- BearerAuth: [ ]
1354+
- BearerAuth: []
13521355
requestBody:
13531356
required: true
13541357
content:
13551358
application/json:
13561359
schema:
1357-
$ref: '#/components/schemas/repo_creation_request'
1360+
$ref: "#/components/schemas/repo_creation_request"
13581361
example:
13591362
name: "my-app"
13601363
namespace: "myorganization"
@@ -1368,7 +1371,7 @@ paths:
13681371
content:
13691372
application/json:
13701373
schema:
1371-
$ref: '#/components/schemas/repository_info'
1374+
$ref: "#/components/schemas/repository_info"
13721375
example:
13731376
name: "my-app"
13741377
namespace: "myorganization"
@@ -1386,12 +1389,12 @@ paths:
13861389
hub_user: "myorganization"
13871390
has_starred: false
13881391
full_description: "This is a comprehensive description of my application repository that contains additional details about the project."
1389-
media_types: [ ]
1390-
content_types: [ ]
1391-
categories: [ ]
1392+
media_types: []
1393+
content_types: []
1394+
categories: []
13921395
immutable_tags_settings:
13931396
enabled: false
1394-
rules: [ ]
1397+
rules: []
13951398
storage_size: null
13961399
source: null
13971400
400:
@@ -1413,19 +1416,19 @@ paths:
14131416
summary: Get repository in a namespace
14141417
description: |
14151418
Returns a repository within the specified namespace (organization or user).
1416-
1419+
14171420
Public repositories are accessible to everyone, while private repositories require appropriate authentication and permissions.
14181421
tags:
14191422
- repositories
14201423
security:
1421-
- bearerAuth: [ ]
1422-
- { } # Allow anonymous access for public repositories
1424+
- bearerAuth: []
1425+
- {} # Allow anonymous access for public repositories
14231426
responses:
14241427
200:
14251428
content:
14261429
application/json:
14271430
schema:
1428-
$ref: '#/components/schemas/repository_info'
1431+
$ref: "#/components/schemas/repository_info"
14291432
example:
14301433
name: "my-app"
14311434
namespace: "myorganization"
@@ -1443,12 +1446,12 @@ paths:
14431446
hub_user: "myorganization"
14441447
has_starred: false
14451448
full_description: "This is a comprehensive description of my application repository that contains additional details about the project."
1446-
media_types: [ ]
1447-
content_types: [ ]
1448-
categories: [ ]
1449+
media_types: []
1450+
content_types: []
1451+
categories: []
14491452
immutable_tags_settings:
14501453
enabled: false
1451-
rules: [ ]
1454+
rules: []
14521455
storage_size: null
14531456
source: null
14541457
401:
@@ -1464,19 +1467,19 @@ paths:
14641467
summary: Check repository in a namespace
14651468
description: |
14661469
Check a repository within the specified namespace (organization or user).
1467-
1470+
14681471
Public repositories are accessible to everyone, while private repositories require appropriate authentication and permissions.
14691472
tags:
14701473
- repositories
14711474
security:
1472-
- bearerAuth: [ ]
1473-
- { } # Allow anonymous access for public repositories
1475+
- bearerAuth: []
1476+
- {} # Allow anonymous access for public repositories
14741477
responses:
14751478
200:
14761479
content:
14771480
application/json:
14781481
schema:
1479-
$ref: '#/components/schemas/repository_info'
1482+
$ref: "#/components/schemas/repository_info"
14801483
example:
14811484
name: "my-app"
14821485
namespace: "myorganization"
@@ -1494,12 +1497,12 @@ paths:
14941497
hub_user: "myorganization"
14951498
has_starred: false
14961499
full_description: "This is a comprehensive description of my application repository that contains additional details about the project."
1497-
media_types: [ ]
1498-
content_types: [ ]
1499-
categories: [ ]
1500+
media_types: []
1501+
content_types: []
1502+
categories: []
15001503
immutable_tags_settings:
15011504
enabled: false
1502-
rules: [ ]
1505+
rules: []
15031506
storage_size: null
15041507
source: null
15051508
401:
@@ -2634,7 +2637,7 @@ components:
26342637
Letters must be lowercase.
26352638
minLength: 2
26362639
maxLength: 255
2637-
pattern: '^[a-z0-9]+(?:[._-][a-z0-9]+)*$'
2640+
pattern: "^[a-z0-9]+(?:[._-][a-z0-9]+)*$"
26382641
example: "my-app"
26392642
namespace:
26402643
type: string
@@ -2677,7 +2680,7 @@ components:
26772680
- read: Can view and pull from the repository
26782681
- write: Can view, pull, and push to the repository
26792682
- admin: Can view, pull, push, and manage repository settings
2680-
enum: [ "read", "write", "admin" ]
2683+
enum: ["read", "write", "admin"]
26812684
example: "write"
26822685
RepositoryGroup:
26832686
type: object
@@ -2689,7 +2692,7 @@ components:
26892692
permission:
26902693
type: string
26912694
description: The permission level granted to the group
2692-
enum: [ "read", "write", "admin" ]
2695+
enum: ["read", "write", "admin"]
26932696
example: "write"
26942697
group_id:
26952698
type: integer
@@ -2771,7 +2774,7 @@ components:
27712774
nullable: true
27722775
description: Full description of the repository
27732776
permissions:
2774-
$ref: '#/components/schemas/repo_permissions'
2777+
$ref: "#/components/schemas/repo_permissions"
27752778
media_types:
27762779
type: array
27772780
items:
@@ -2786,10 +2789,10 @@ components:
27862789
categories:
27872790
type: array
27882791
items:
2789-
$ref: '#/components/schemas/category'
2792+
$ref: "#/components/schemas/category"
27902793
description: Repository categories
27912794
immutable_tags_settings:
2792-
$ref: '#/components/schemas/immutable_tags_settings'
2795+
$ref: "#/components/schemas/immutable_tags_settings"
27932796
storage_size:
27942797
type: integer
27952798
format: int64
@@ -2856,7 +2859,7 @@ components:
28562859
type: string
28572860
pattern: '^[a-z0-9]+((\\.|_|__|-+)[a-z0-9]+)*(\\/[a-z0-9]+((\\.|_|__|-+)[a-z0-9]+)*)*$'
28582861
description: 'Immutable tags rule regex pattern. Must match format: [a-z0-9]+((\\.|_|__|-+)[a-z0-9]+)*(\\/[a-z0-9]+((\\.|_|__|-+)[a-z0-9]+)*)*'
2859-
example: 'v.*'
2862+
example: "v.*"
28602863
required:
28612864
- regex
28622865
immutable_tags_verify_response:
@@ -2868,9 +2871,9 @@ components:
28682871
type: string
28692872
description: List of tags that match the provided regex pattern
28702873
example:
2871-
- 'v1.0.0'
2872-
- 'v2.1.3'
2873-
- 'latest'
2874+
- "v1.0.0"
2875+
- "v2.1.3"
2876+
- "latest"
28742877
required:
28752878
- tags
28762879
repository_list_entry:
@@ -4014,14 +4017,17 @@ components:
40144017
description: |
40154018
The path of the resource. The format of this will change depending on the type of resource.
40164019
4017-
To reference public repositories, use `*/*/public` as the path value.
4020+
For TYPE_REPO resources:
4021+
- Must be an existing repository name (e.g., "myorg/myrepo")
4022+
- Can use glob patterns (e.g., "myorg/*" for all repositories in the organization)
4023+
- Use "*/*/public" to reference all public repositories
40184024
required: true
40194025
scopes:
40204026
type: array
40214027
description: The scopes this token has access to
40224028
items:
40234029
type: string
4024-
example: "repo-pull"
4030+
example: "scope-image-pull"
40254031
required: true
40264032
getOrgAccessTokensResponse:
40274033
type: object
@@ -4075,7 +4081,31 @@ components:
40754081
createOrgAccessTokenResponse:
40764082
type: object
40774083
allOf:
4078-
- $ref: "#/components/schemas/orgAccessToken"
4084+
- type: object
4085+
properties:
4086+
id:
4087+
type: string
4088+
example: "a7a5ef25-8889-43a0-8cc7-f2a94268e861"
4089+
label:
4090+
type: string
4091+
example: "My organization token"
4092+
is_active:
4093+
type: boolean
4094+
example: true
4095+
created_at:
4096+
type: string
4097+
format: date-time
4098+
example: "2022-05-20T00:54:18Z"
4099+
expires_at:
4100+
type: string
4101+
format: date-time
4102+
example: "2023-05-20T00:54:18Z"
4103+
nullable: true
4104+
last_used_at:
4105+
type: string
4106+
format: date-time
4107+
example: "2022-06-15T12:30:45Z"
4108+
nullable: true
40794109
- type: object
40804110
properties:
40814111
token:

0 commit comments

Comments
 (0)