Socket · API Governance Rules
Socket API Rules
Spectral linting rules defining API design standards and conventions for Socket.
12 Rules
error 2
warn 7
Rule Categories
socket
Rules
warn
socket-info-contact
Socket OpenAPI documents should declare an info.contact block.
$.info
warn
socket-info-license
Socket OpenAPI documents should declare an info.license block.
$.info
error
socket-server-https-only
Socket servers must use HTTPS.
$.servers[*].url
warn
socket-server-base-path
Socket servers should be rooted at api.socket.dev/v0.
$.servers[*].url
error
socket-operation-id-required
Every operation must declare an operationId.
$.paths[*][get,post,put,patch,delete]
warn
socket-operation-summary-required
Every operation must declare a human-readable summary.
$.paths[*][get,post,put,patch,delete]
hint
socket-operation-summary-title-case
Socket operation summaries should use Title Case.
$.paths[*][get,post,put,patch,delete].summary
warn
socket-operation-tags-required
Every operation must declare at least one tag (Socket groups its API by resource tag).
$.paths[*][get,post,put,patch,delete]
warn
socket-deprecated-flag
Operations tagged as deprecated must set the deprecated flag.
$.paths[*][get,post,put,patch,delete][?(@.tags && @.tags.indexOf('deprecated') !== -1)]
hint
socket-org-slug-path-parameter
Organization-scoped paths use the path parameter name `org_slug`.
$.paths[?(@property.match(/{org_slug}/))]
hint
socket-purl-vocabulary
Endpoints handling packages should reference Package URL (purl) in their description.
$.paths[/purl,/orgs/{org_slug}/purl][post].description
warn
socket-response-success-required
Every operation must declare at least one 2xx response.
$.paths[*][get,post,put,patch,delete].responses