Found by the docs audit of the first-run path (#10563).
What is wrong
Two pages document the stored value of a location field as
{ latitude, longitude, altitude?, accuracy? }:
content/docs/data-modeling/field-types.mdx:533 — "Geographic coordinates.
Stored as { latitude, longitude, altitude?, accuracy? } (latitude −90..90,
longitude −180..180). No per-type config properties."content/docs/data-modeling/validation-rules.mdx:373 — same sentence.
The enforced value contract is { lat, lng, altitude?, accuracy? }.
packages/spec/src/data/field-value.zod.ts:251-256:
exportconstLocationValueSchema=lazySchema(()=>z.object({lat: z.number().min(-90).max(90).describe('Latitude'),lng: z.number().min(-180).max(180).describe('Longitude'),altitude: z.number().optional().describe('Altitude in meters'),accuracy: z.number().optional().describe('Accuracy in meters'),}));and valueSchemaFor routes location to it (same file, line 437:
if (t === 'location') return LocationValueSchema;).
The shape the docs print is the deprecatedLocationCoordinatesSchema, whose
own docblock at packages/spec/src/data/field.zod.ts:222-229 says exactly this:
@deprecated Never consumed by the runtime, and its key names contradict what
the platform actually stores: a location value is {lat, lng} (see the
field-zoo round-trip oracle), not {latitude, longitude}. Use
LocationValueSchema / valueSchemaFor from field-value.zod.ts
(ADR-0104 D1). Removal rides the next spec major.
So an author following either page writes latitude/longitude and the value
fails validation.
Not affected
The address shape on the neighbouring lines (field-types.mdx:540,
validation-rules.mdx:377) is correct — it matches AddressSchema
(field-value.zod.ts:271-278), formatted included.
Back-link: #10563
Found by the docs audit of the first-run path (#10563).
What is wrong
Two pages document the stored value of a
locationfield as{ latitude, longitude, altitude?, accuracy? }:content/docs/data-modeling/field-types.mdx:533— "Geographic coordinates.Stored as
{ latitude, longitude, altitude?, accuracy? }(latitude −90..90,longitude −180..180). No per-type config properties."
content/docs/data-modeling/validation-rules.mdx:373— same sentence.The enforced value contract is
{ lat, lng, altitude?, accuracy? }.packages/spec/src/data/field-value.zod.ts:251-256:and
valueSchemaForrouteslocationto it (same file, line 437:if (t === 'location') return LocationValueSchema;).The shape the docs print is the deprecated
LocationCoordinatesSchema, whoseown docblock at
packages/spec/src/data/field.zod.ts:222-229says exactly this:So an author following either page writes
latitude/longitudeand the valuefails validation.
Not affected
The
addressshape on the neighbouring lines (field-types.mdx:540,validation-rules.mdx:377) is correct — it matchesAddressSchema(
field-value.zod.ts:271-278),formattedincluded.Back-link: #10563