Youtube · API Governance Rules
Youtube API Rules
Spectral linting rules defining API design standards and conventions for Youtube.
55 Rules
error 22
warn 20
info 13
Rule Categories
deprecated
http
info
list
microcks
no
openapi
operation
parameter
paths
request
response
schema
security
servers
tags
Rules
error
info-title-required
Info title must be present and non-empty
$.info
warn
info-title-prefix
Info title should start with "YouTube"
$.info.title
error
info-description-required
Info description must be present
$.info
warn
info-description-min-length
Info description should be at least 50 characters
$.info.description
error
info-version-required
API version must be specified
$.info
warn
info-contact-required
Contact information should be provided
$.info
info
info-terms-of-service
Terms of service URL should be provided
$.info
error
openapi-version
OpenAPI version should be 3.0.x or 3.1.x
$
error
servers-defined
At least one server must be defined
$
error
servers-https
Server URLs must use HTTPS
$.servers[*].url
warn
servers-description
Each server should have a description
$.servers[*]
info
servers-googleapis-domain
Server URLs should use googleapis.com domain
$.servers[*].url
error
paths-no-trailing-slash
Paths must not have trailing slashes
$.paths
error
paths-no-query-strings
Paths must not include query strings
$.paths
warn
paths-camel-case
YouTube paths use camelCase for resource names
$.paths
info
paths-plural-resources
Resource paths should use plural nouns
$.paths
error
operation-operationid-required
Every operation must have an operationId
$.paths[*][get,post,put,patch,delete]
warn
operation-operationid-format
OperationId should follow youtube.resource.action or youtubeAnalytics.resource.action format
$.paths[*][get,post,put,patch,delete].operationId
error
operation-summary-required
Every operation must have a summary
$.paths[*][get,post,put,patch,delete]
warn
operation-summary-prefix
Operation summaries should start with "Youtube" prefix
$.paths[*][get,post,put,patch,delete].summary
warn
operation-summary-title-case
Operation summaries should use Title Case
$.paths[*][get,post,put,patch,delete].summary
error
operation-description-required
Every operation must have a description
$.paths[*][get,post,put,patch,delete]
error
operation-tags-required
Every operation must have at least one tag
$.paths[*][get,post,put,patch,delete]
info
operation-single-tag
Operations should have exactly one tag
$.paths[*][get,post,put,patch,delete].tags
warn
tags-defined
Global tags array should be defined
$
warn
tags-description
Each tag should have a description
$.tags[*]
warn
tags-pascal-case
Tag names should use PascalCase (YouTube convention)
$.tags[*].name
error
parameter-description-required
Every parameter must have a description
$.paths[*][get,post,put,patch,delete].parameters[*]
error
parameter-schema-required
Every parameter must have a schema
$.paths[*][get,post,put,patch,delete].parameters[*]
warn
parameter-camel-case
Parameter names should use camelCase (YouTube convention)
$.paths[*][get,post,put,patch,delete].parameters[*].name
info
parameter-example
Parameters should have example values
$.paths[*][get,post,put,patch,delete].parameters[*]
info
parameter-pagination-naming
Pagination should use pageToken and maxResults (YouTube convention)
$.paths[*][get,post,put,patch,delete].parameters[?(@.name=='page' || @.name=='offset' || @.name=='cursor')]
warn
request-body-json
Request bodies should use application/json content type
$.paths[*][post,put,patch].requestBody.content
error
response-success-required
Every operation must have a 2xx success response
$.paths[*][get,post,put,patch,delete].responses
error
response-description-required
Every response must have a description
$.paths[*][get,post,put,patch,delete].responses[*]
warn
response-json-content
Success responses should use application/json
$.paths[*][get,post,put,patch].responses[?(@property >= 200 && @property < 300)].content
info
response-examples
Responses should include named examples for Microcks compatibility
$.paths[*][get,post,put,patch,delete].responses[*].content.application/json
warn
schema-description
Top-level schemas should have descriptions
$.components.schemas[*]
error
schema-type-required
Schema properties must define a type
$.components.schemas[*].properties[*]
warn
schema-property-camel-case
Schema property names should use camelCase (YouTube convention)
$.components.schemas[*].properties
info
schema-kind-property
YouTube resource schemas should include a kind property
$.components.schemas[?(@.properties.etag)].properties
info
schema-etag-property
YouTube resource schemas should include an etag property
$.components.schemas[?(@.properties.kind)].properties
info
schema-property-example
Schema properties should have example values
$.components.schemas[*].properties[*]
error
security-global-defined
Global security must be defined
$
error
security-schemes-defined
Security schemes must be defined in components
$.components
warn
security-oauth2-scheme
YouTube APIs should use OAuth 2.0 authentication
$.components.securitySchemes
info
security-api-key-scheme
YouTube APIs should support API key authentication for read operations
$.components.securitySchemes
error
http-get-no-body
GET operations must not have a request body
$.paths[*].get
error
http-delete-no-body
DELETE operations must not have a request body
$.paths[*].delete
warn
http-post-has-body
POST operations should have a request body
$.paths[*].post
warn
http-put-has-body
PUT operations should have a request body
$.paths[*].put
info
microcks-operation-extension
Operations should have x-microcks-operation for mock server compatibility
$.paths[*][get,post,put,patch,delete]
error
no-empty-descriptions
Descriptions must not be empty strings
$..description
warn
deprecated-documented
Deprecated operations should have a description explaining the deprecation
$.paths[*][get,post,put,patch,delete][?(@.deprecated==true)]
info
list-response-items-array
List responses should contain an items array (YouTube convention)
$.components.schemas[?(@.properties.nextPageToken)].properties