PostalCodes.info · API Governance Rules
PostalCodes.info API Rules
Spectral linting rules defining API design standards and conventions for PostalCodes.info.
11 Rules
error 4
warn 6
info 1
Rule Categories
postalcodes
Rules
error
postalcodes-info-contact-required
PostalCodes.info specs must keep contact details for the maintainer.
$.info.contact
warn
postalcodes-info-license-odbl
PostalCodes.info data is published under the Open Database License (ODbL) 1.0.
$.info.license
error
postalcodes-info-server-canonical-host
The canonical server must point at https://postalcodes.info.
$.servers[*]
warn
postalcodes-info-operation-summary-title-case
Operation summaries must use Title Case to match the documentation portal.
$.paths.*.*.summary
warn
postalcodes-info-operation-id-camel
operationId values should be lowerCamelCase verbs.
$.paths.*.*.operationId
warn
postalcodes-info-operation-tags-allowed
Only Search, Downloads and Lookup Pages tags are sanctioned for postalcodes.info paths.
$.paths.*.*.tags[*]
warn
postalcodes-info-country-code-pattern
ISO 3166-1 alpha-2 country code parameters must use a 2-letter pattern.
$.paths.*.*.parameters[?(@.name=="country" && @.in=="query")].schema
error
postalcodes-info-postal-code-is-string
Postal codes must be modeled as strings to preserve leading zeros, spaces and punctuation.
$.components.schemas.PostalRecord.properties.postal_code
warn
postalcodes-info-download-token-headers
The download-token endpoint must require X-Requested-With and Referer headers.
$.paths['/download-token.php'].get.parameters
error
postalcodes-info-download-format-enum
The download endpoint must constrain format to csv, xlsx, json.
$.paths['/download.php'].get.parameters[?(@.name=="format")].schema
info
postalcodes-info-200-has-example
200 responses should include at least one example to document the JSON shape.
$.paths.*.*.responses['200'].content.application/json