Address
An address is a physical location.
Property | Type | Required | Description |
---|---|---|---|
Street 1 | string | Yes | The primary street address line. |
Street 2 | string | No | Additional street address information (e.g., apartment number, suite, etc.). |
City | string | Yes | The city of the location. |
State | string | Yes | The state of the location. |
Zip | string | Yes | The postal code of the location. |
Latitude | number | Yes | The latitude coordinate of the address location. |
Longitude | number | Yes | The longitude coordinate of the address location. |
Geography | Record | No | Additional geospatial data in GeoJSON format. |
Formats
Section titled “Formats”A JSON example of this model.
{ "street1": "123 Main St", "street2": "Apt 1", "city": "Anytown", "stateOrProvince": "CA", "country": "US", "postalCode": "12345", "latitude": 37.7749, "longitude": -122.4194, "geography": { "type": "Point", "coordinates": [37.7749, -122.4194] }}
The JSON Schema for this model.
$schema: https://json-schema.org/draft/2020-12/schema$id: Address.yamltype: objectproperties: street1: type: string description: The primary street address line. street2: type: string description: Additional street address information (e.g., apartment number, suite, etc.). city: type: string description: The city or municipality name. stateOrProvince: type: string description: The state, province, or region name. country: type: string description: The country name or ISO country code. postalCode: type: string description: The postal or ZIP code for the address. latitude: type: number description: The latitude coordinate of the address location. longitude: type: number description: The longitude coordinate of the address location. geography: $ref: "#/$defs/RecordUnknown" description: Additional geospatial data in GeoJSON format.required: - street1 - city - stateOrProvince - country - postalCodeexamples: - street1: 123 Main St city: Anytown stateOrProvince: CA country: US postalCode: "12345"description: A mailing address.$defs: RecordUnknown: type: object properties: {} unevaluatedProperties: {}
The TypeSpec code for this model.
namespace CommonGrants.Fields;
/** A mailing address. */@example(Examples.Address.apartment)model Address { /** The primary street address line. */ street1: string;
/** Additional street address information (e.g., apartment number, suite, etc.). */ street2?: string;
/** The city or municipality name. */ city: string;
/** The state, province, or region name. */ stateOrProvince: string;
/** The country name or ISO country code. */ country: string;
/** The postal or ZIP code for the address. */ postalCode: string;
/** The latitude coordinate of the address location. */ latitude?: numeric;
/** The longitude coordinate of the address location. */ longitude?: numeric;
/** Additional geospatial data in GeoJSON format. */ geography?: Record<unknown>;}
AddressCollection
Section titled “AddressCollection”A collection of addresses for a person or organization.
Property | Type | Required | Description |
---|---|---|---|
primary | Address | Yes | The primary address for a person or organization |
otherAddresses | Record<Address> | No | Additional addresses keyed by a descriptive label. |
Formats
Section titled “Formats”A JSON example of this model.
{ "primary": { "street1": "123 Main St", "city": "Anytown", "stateOrProvince": "CA", "country": "US", "postalCode": "12345" }, "otherAddresses": { "work": { "street1": "456 Main St", "street2": "Suite 100", "city": "Anytown", "stateOrProvince": "CA", "country": "US", "postalCode": "12345" }, "international": { "street1": "123 Rue Principale", "city": "Montreal", "stateOrProvince": "QC", "country": "CA", "postalCode": "H2Y 1C6" } }}
The JSON Schema for this model.
$schema: https://json-schema.org/draft/2020-12/schema$id: AddressCollection.yamltype: objectproperties: primary: $ref: Address.yaml description: The primary address for a person or organization. otherAddresses: $ref: "#/$defs/RecordAddress" description: Additional addresses keyed by a descriptive label (e.g., "work", "home", "international").required: - primaryexamples: - primary: street1: 456 Main St street2: Suite 100 city: Anytown stateOrProvince: CA country: US postalCode: "12345" otherAddresses: satellite: street1: 456 Main St street2: Suite 100 city: Anytown stateOrProvince: CA country: US postalCode: "12345" international: street1: 123 Rue Principale city: Montreal stateOrProvince: QC country: CA postalCode: H2Y 1C6 - primary: street1: 123 Main St city: Anytown stateOrProvince: CA country: US postalCode: "12345" otherAddresses: work: street1: 123 Main St city: Anytown stateOrProvince: CA country: US postalCode: "12345" home: street1: 123 Main St city: Anytown stateOrProvince: CA country: US postalCode: "12345"description: A collection of addresses.$defs: RecordAddress: type: object properties: {} unevaluatedProperties: $ref: Address.yaml
The TypeSpec code for this model.
/** A collection of addresses. */@example(Examples.Address.personalCollection)@example(Examples.Address.orgCollection)model AddressCollection { /** The primary address for a person or organization. */ primary: Address;
/** Additional addresses keyed by a descriptive label (e.g., "work", "home", "international"). */ otherAddresses?: Record<Address>;}