Gitea · API Governance Rules
Gitea API Rules
Spectral linting rules defining API design standards and conventions for Gitea.
16 Rules
error 4
warn 9
Rule Categories
gitea
Rules
error
gitea-info-contact
API contact information must be present.
$.info
warn
gitea-info-license
API license must be declared (Gitea is MIT).
$.info
error
gitea-server-https
Production servers must use HTTPS.
$.servers[*].url
warn
gitea-base-path-versioned
Base path must include /api/v1 to match Gitea's documented API surface.
$.servers[*].url
error
gitea-auth-required
Security schemes must be declared (Gitea supports BasicAuth, Token, AccessToken, AuthorizationHeaderToken, TOTPHeader, SudoHeader, SudoParam).
$.components.securitySchemes
error
gitea-operation-id
Every operation must declare a unique operationId (camelCase).
$.paths[*][get,post,put,patch,delete]
warn
gitea-operation-id-camelcase
operationId must be camelCase.
$.paths[*][get,post,put,patch,delete].operationId
warn
gitea-operation-tags
Every operation must declare at least one tag (admin, repository, issue, organization, user, package, notification, miscellaneous, settings).
$.paths[*][get,post,put,patch,delete]
warn
gitea-operation-summary
Every operation must include a Title Case summary.
$.paths[*][get,post,put,patch,delete]
hint
gitea-summary-title-case
Operation summaries should be Title Case.
$.paths[*][get,post,put,patch,delete].summary
warn
gitea-error-responses
Mutating operations should declare 4xx error responses.
$.paths[*][post,put,patch,delete].responses
hint
gitea-list-pagination
List operations should support page and limit query parameters (Gitea pagination convention).
$.paths[*].get.parameters[?(@.in == 'query')].name
warn
gitea-path-naming
Path segments must be lowercase and use snake_case for static segments and {camelCase} for parameters; Gitea uses lowercase REST resources (e.g. /repos, /orgs, /users).
$.paths
warn
gitea-no-trailing-slash
Paths must not end with a trailing slash.
$.paths
warn
gitea-schema-required
Definition / schema fields with required arrays should reference real properties only.
$.components.schemas[*]
hint
gitea-deprecated-marked
Deprecated operations should be flagged with x-deprecated or deprecated:true and have a replacement note in description.
$.paths[*][get,post,put,patch,delete][?(@.deprecated == true)]