Skip to content
API Now! is currently in closed beta. We are constantly updating these guides as we release updates!

StreetAddress (Semantic Module)

← Back to Modules Reference

The StreetAddress semantic module validates, sanitizes, and standardizes primary street address lines (such as "123 Main Street" or "450 7th Ave").

It ensures that street lines consist of clean plaintext, automatically prevents malicious HTML or script tags from entering your database, converts whitespace-only inputs into clean null values, and normalizes extra padding.


AttributeSpecification
ScopeProperty (Applied to a text property)
Data TypeString
Default Max Length255 characters
HTML SanitizationDisallowed (Rejects HTML, script, or markup tags)
Whitespace HandlingAutomatically trimmed; whitespace-only strings become null

1. Plaintext Security (HTML & Script Blocking)

Section titled “1. Plaintext Security (HTML & Script Blocking)”

Physical street addresses should never contain HTML tags or embedded scripts. If a user or malicious payload attempts to inject markup (e.g., <script> or <b>123 Main</b>), the Serverless Engine immediately rejects the request with a validation error (400 Bad Request).

2. Automatic Trimming & Empty Value Normalization

Section titled “2. Automatic Trimming & Empty Value Normalization”
  • Trimming: Strips accidental leading and trailing whitespace introduced by copy-pasting address fields.
  • Nullification: Submitting an empty string or spaces-only (" ") automatically stores as null rather than preserving blank ghost strings in your database.

3. Complementary Supplemental Lines (StreetAddressSupplemental)

Section titled “3. Complementary Supplemental Lines (StreetAddressSupplemental)”

For address models that separate primary street lines from secondary units, the platform also provides StreetAddressSupplemental. This handles apartment, suite, floor, and unit numbers with the same sanitization and trimming standards.


A client submits a street line with surrounding whitespace:

POST /addresses
Content-Type: application/json
{
"street": " 742 Evergreen Terrace "
}

Server Response (201 Created): The engine normalizes the address cleanly:

{
"data": {
"id": "addr_102",
"street": "742 Evergreen Terrace"
}
}

2. Validation Failure (HTML Tags Detected)

Section titled “2. Validation Failure (HTML Tags Detected)”

A client submits address text containing HTML markup:

{
"street": "123 Main St <script>alert(1)</script>"
}

Server Response (400 Bad Request):

{
"type": "https://docs.apinow.app/errors/validation",
"title": "Validation Error",
"status": 400,
"code": "E_VALIDATION_ERROR",
"detail": "Property 'street' cannot contain HTML tags or markup."
}

  • String Properties Only: Apply StreetAddress to a String property in the Domain Modeler.
  • Property Length Constraints: String properties default to a Maximum Length of 255 characters, which is more than sufficient for international street names.