Skip to main content
Version: 0.13.0 (Previous)

📐 Address schemas

Address schemas provide strict reusable address fragments and the query contract for the address lookup endpoint.

Inventory

ExportRequest locationContract
addressN/AOptional array of string address lines.
postalCodeN/AOptional string postal code.
prefectureN/AOptional string or null prefecture.
cityN/AOptional string city.
countryN/AOptional string country.
addressJPSchemaN/AOptional Japanese address components.
partialPostalCodeQueryParameterQueryRequired partial or full Japanese postal code.
findAddressSchemaQueryLookup request schema.

Details

address

Definition

address is a strict object with no required fields.

LocationFieldTypeRequiredConstraints
N/Aaddressstring[]NoEvery array item is a string.

additionalProperties is false.

Used by route: None directly. Used by feature: None directly.

View complete source
export const address: SchemaDefinition = {
$schema: 'http://json-schema.org/draft-07/schema#',
additionalProperties: false,
properties: {address: {items: {type: 'string'}, type: 'array'}},
type: 'object',
};

postalCode

Definition
LocationFieldTypeRequiredConstraints
N/ApostalCodestringNoNo pattern is imposed.

additionalProperties is false.

Used by route: None directly. Used by feature: None directly.

View complete source
export const postalCode: SchemaDefinition = {
$schema: 'http://json-schema.org/draft-07/schema#',
additionalProperties: false,
properties: {postalCode: {type: 'string'}},
type: 'object',
};

prefecture

Definition
LocationFieldTypeRequiredConstraints
prefectureN/Astring | nullNoNull is accepted.

additionalProperties is false.

Used by route: None directly. Used by feature: None directly.

View complete source
export const prefecture: SchemaDefinition = {
$schema: 'http://json-schema.org/draft-07/schema#',
additionalProperties: false,
properties: {prefecture: {type: ['string', 'null']}},
type: 'object',
};

city

Definition
LocationFieldTypeRequiredConstraints
N/AcitystringNoCity name.

additionalProperties is false.

Used by route: None directly. Used by feature: None directly.

View complete source
export const city: SchemaDefinition = {
$schema: 'http://json-schema.org/draft-07/schema#',
additionalProperties: false,
properties: {city: {type: 'string'}},
type: 'object',
};

country

Definition
LocationFieldTypeRequiredConstraints
N/AcountrystringNoCountry name.

additionalProperties is false.

Used by route: None directly. Used by feature: None directly.

View complete source
export const country: SchemaDefinition = {
$schema: 'http://json-schema.org/draft-07/schema#',
additionalProperties: false,
properties: {country: {type: 'string'}},
type: 'object',
};

addressJPSchema

Definition
LocationFieldTypeRequiredConstraints
N/AcitystringNoCity name.
N/AcountrystringNoCountry name.
N/ApostalCodestringNoPostal code.
N/AprefecturestringNoPrefecture name.
N/AstreetstringNoStreet address.

additionalProperties is false; the schema has no required fields.

Used by route: None directly. Used by feature: None directly.

View complete source
export const addressJPSchema: SchemaDefinition = {
$schema: 'http://json-schema.org/draft-07/schema#',
additionalProperties: false,
properties: {
city: {type: 'string'},
country: {type: 'string'},
postalCode: {type: 'string'},
prefecture: {type: 'string'},
street: {type: 'string'},
},
type: 'object',
};

partialPostalCodeQueryParameter

Definition
LocationFieldTypeRequiredConstraints
QuerypostalCodestringYesMatches ^\d{3}-?\d{0,4}$.

Spread by findAddressSchema. Used by route: findAddressRoute. Used by feature: findAddressFeature.

View complete source
export const partialPostalCodeQueryParameter: OpenAPIParameter = {
in: 'query',
name: 'postalCode',
required: true,
schema: {pattern: '^\\d{3}-?\\d{0,4}$', type: 'string'},
};

findAddressSchema

Definition

Uses the required postalCode query parameter.

LocationFieldTypeRequiredConstraints
QuerypostalCodestringYesMatches ^\d{3}-?\d{0,4}$; accepts three digits, an optional hyphen, and zero to four additional digits.

Used by route: findAddressRoute. Used by feature: findAddressFeature.

View complete source
export const findAddressSchema = withSchema({
parameters: [partialPostalCodeQueryParameter],
});