diff --git a/models.gen.go b/models.gen.go index 207acb7..06ed97b 100644 --- a/models.gen.go +++ b/models.gen.go @@ -852,8 +852,8 @@ type VersionName = string // AddonSortBy defines model for addon_sort_by. type AddonSortBy string -// APIKeyPathName defines model for apikey_name. -type APIKeyPathName = string +// APIKeyPathName Name of the API key +type APIKeyPathName = APIKeyName // IncludeDrafts defines model for include_drafts. type IncludeDrafts = bool @@ -1098,7 +1098,9 @@ type ListTeamAPIKeysParams struct { // CreateTeamAPIKeyJSONBody defines parameters for CreateTeamAPIKey. type CreateTeamAPIKeyJSONBody struct { ExpiresAt time.Time `json:"expires_at"` - Name string `json:"name"` + + // Name Name of the API key + Name APIKeyName `json:"name"` } // ListTeamInvitationsParams defines parameters for ListTeamInvitations. diff --git a/spec.json b/spec.json index 5e5a01a..990d71f 100644 --- a/spec.json +++ b/spec.json @@ -3253,9 +3253,7 @@ ], "properties": { "name": { - "type": "string", - "minLength": 1, - "maxLength": 255 + "$ref": "#/components/schemas/APIKeyName" }, "expires_at": { "type": "string", @@ -4771,7 +4769,7 @@ "example": "cli-api-key", "maxLength": 255, "minLength": 1, - "pattern": "^[a-zA-Z0-9-]+$" + "pattern": "^(?:[a-zA-Z0-9][a-zA-Z0-9- ]*)?[a-zA-Z0-9]$" }, "APIKeyScope": { "description": "Scope of permissions for the API key. API keys are used for creating new plugin versions and downloading existing plugins", @@ -5061,11 +5059,7 @@ "in": "path", "required": true, "schema": { - "type": "string", - "example": "cli-api-key", - "maxLength": 255, - "minLength": 1, - "pattern": "^[a-zA-Z0-9-]+$" + "$ref": "#/components/schemas/APIKeyName" }, "x-go-name": "APIKeyPathName" }