Google Places · API Governance Rules
Google Places API Rules
Spectral linting rules defining API design standards and conventions for Google Places.
39 Rules
error 6
warn 20
info 13
Rule Categories
get
info
no
openapi
operation
parameter
paths
post
request
response
schema
security
servers
tags
Rules
warn
info-title-google-places
The info.title must begin with "Google Places".
$.info.title
warn
info-description-required
A non-trivial info.description is required.
$.info
info
info-contact-required
Provider contact information should be present.
$.info
info
info-license-required
A license (Google APIs Terms of Service) should be declared.
$.info
warn
openapi-version-3-1
Specs must target OpenAPI 3.1.0.
$.openapi
error
servers-defined
At least one server must be defined.
$.servers
error
servers-https-only
Server URLs must use HTTPS.
$.servers[*].url
info
servers-places-host
The production server should be the Places API (New) host.
$.servers[*].url
warn
paths-no-trailing-slash
Paths must not end with a trailing slash.
$.paths[*]~
error
paths-no-query-string
Paths must not contain query strings.
$.paths[*]~
info
paths-places-prefix
All resource paths live under the /places collection.
$.paths[*]~
warn
operation-summary-required
Every operation must have a summary.
$.paths[*][get,post,put,patch,delete]
warn
operation-summary-google-places-prefix
Operation summaries must begin with "Google Places".
$.paths[*][get,post,put,patch,delete].summary
warn
operation-description-required
Every operation must have a description.
$.paths[*][get,post,put,patch,delete]
error
operation-operationId-required
Every operation must declare an operationId.
$.paths[*][get,post,put,patch,delete]
warn
operation-operationId-camelcase
operationId must be camelCase.
$.paths[*][get,post,put,patch,delete].operationId
info
operation-operationId-verb-prefix
operationId should start with a recognized verb (get, list, search, autocomplete, create, update, delete).
$.paths[*][get,post,put,patch,delete].operationId
warn
operation-tags-required
Every operation must have at least one tag.
$.paths[*][get,post,put,patch,delete]
info
operation-microcks-extension
Each operation should carry an x-microcks-operation extension for mock-server compatibility.
$.paths[*][get,post,put,patch,delete]
warn
tags-global-defined
A global tags array must be defined.
$
warn
tags-title-case
Global tag names must use Title Case (e.g. "Places", "Search").
$.tags[*].name
info
tags-have-description
Global tags should include a description.
$.tags[*]
warn
parameter-description-required
Every parameter must have a description.
$.paths[*][get,post,put,patch,delete].parameters[*]
warn
parameter-schema-required
Every parameter must define a schema with a type.
$.paths[*][get,post,put,patch,delete].parameters[?(@.in)]
info
parameter-field-mask-required
Places API (New) requests require the X-Goog-FieldMask header; a reusable FieldMask parameter should be defined.
$.components.parameters
warn
request-body-json
Request bodies must offer an application/json media type.
$.paths[*][post,put,patch].requestBody.content
warn
post-has-request-body
POST operations (search, autocomplete) must declare a request body.
$.paths[*].post
error
response-2xx-required
Every operation must define a 2xx success response.
$.paths[*][get,post,put,patch,delete].responses
info
response-json-content
200 responses should return application/json.
$.paths[*][get,post,put,patch,delete].responses.200.content
info
response-error-schema-message
The Error schema should expose an error object carrying a message.
$.components.schemas.Error.properties.error.properties
warn
schema-property-camelcase
Schema property names must be camelCase, matching the Places API (New) convention.
$.components.schemas[*].properties[*]~
info
schema-top-level-description
Top-level component schemas should have a description.
$.components.schemas[*]
warn
schema-types-defined
Component schemas must declare a type.
$.components.schemas[*]
warn
security-global-defined
A global security requirement must be declared.
$
warn
security-schemes-defined
Security schemes must be defined in components.
$.components
info
security-api-key-header
The primary API key scheme should be the X-Goog-Api-Key header.
$.components.securitySchemes.ApiKeyAuth
error
get-no-request-body
GET operations must not declare a request body.
$.paths[*].get
warn
no-empty-descriptions
Descriptions must not be empty strings.
$..description
info
schema-examples-encouraged
Schema properties are encouraged to provide example values.
$.components.schemas[*].properties[?(@.type && @.type != 'object' && @.type != 'array')]