Google Fit REST · API Governance Rules

Google Fit REST API Rules

Spectral linting rules defining API design standards and conventions for Google Fit REST.

13 Rules error 11 warn 1 info 1
View Rules File View on GitHub

Rule Categories

deprecated info no operation paths response servers tags

Rules

error
info-title-required
$.info
error
info-description-required
$.info
error
info-version-required
$.info
error
servers-defined
$
error
servers-https-only
$.servers[*].url
error
paths-no-trailing-slash
$.paths
error
operation-description-required
$.paths[*][get,post,put,patch,delete]
error
operation-operationid-required
$.paths[*][get,post,put,patch,delete]
error
operation-operationid-unique
$
info
tags-title-case
$.tags[*].name
error
response-success-required
$.paths[*][get,post,put,patch,delete].responses
warn
deprecated-description
Deprecated operations should explain the deprecation.
$.paths[*][get,post,put,patch,delete][?(@.deprecated==true)]
error
no-empty-descriptions
$..description

Spectral Ruleset

Raw ↑
rules:
  info-title-required:
    severity: error
    given: $.info
    then: {field: title, function: truthy}
  info-description-required:
    severity: error
    given: $.info
    then: {field: description, function: truthy}
  info-version-required:
    severity: error
    given: $.info
    then: {field: version, function: truthy}
  servers-defined:
    severity: error
    given: $
    then: {field: servers, function: truthy}
  servers-https-only:
    severity: error
    given: $.servers[*].url
    then: {function: pattern, functionOptions: {match: "^https://"}}
  paths-no-trailing-slash:
    severity: error
    given: $.paths
    then: {field: "@key", function: pattern, functionOptions: {notMatch: "\\/$"}}
  operation-description-required:
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then: {field: description, function: truthy}
  operation-operationid-required:
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then: {field: operationId, function: truthy}
  operation-operationid-unique:
    severity: error
    given: $
    then: {function: oasOpId}
  tags-title-case:
    severity: info
    given: $.tags[*].name
    then: {function: pattern, functionOptions: {match: "^[A-Z][a-zA-Z0-9]*(\\s[A-Za-z0-9]+)*$"}}
  response-success-required:
    severity: error
    given: $.paths[*][get,post,put,patch,delete].responses
    then: {function: schema, functionOptions: {schema: {anyOf: [{required: ["200"]}, {required: ["201"]}, {required: ["204"]}]}}}
  deprecated-description:
    severity: warn
    description: Deprecated operations should explain the deprecation.
    given: $.paths[*][get,post,put,patch,delete][?(@.deprecated==true)]
    then: {field: description, function: pattern, functionOptions: {match: "[Dd]eprecated|[Ss]unset"}}
  no-empty-descriptions:
    severity: error
    given: "$..description"
    then: {function: truthy}