Skip to content

Validate every response against the OGC schemas - #54

Merged
estebanzimanyi merged 1 commit into
masterfrom
ats/schema-validation
Aug 29, 2026
Merged

Validate every response against the OGC schemas#54
estebanzimanyi merged 1 commit into
masterfrom
ats/schema-validation

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

Annex A's prose says what a response must carry; the schemas say it in a form a machine checks. A suite that asserts the fields it thought to name passes a document missing everything it forgot, so the schema is what makes the conformance claim mean something.

openapi/ogcapi-movingfeatures-1.bundled.json is the OpenAPI document OGC publishes for Part 1, vendored byte for byte and never edited. It is the bundled form, so every $ref resolves inside the one file and validation needs no network — it runs in the same job as every other test. A test guarded by MFAPI_SCHEMA_FRESHNESS re-fetches the URL and compares. The landing page, the conformance declaration, a Collections document, a Collection, a TemporalProperties document and a TemporalGeometrySequence are each validated against the schema the standard names for it.

One translation is applied and its count asserted: OpenAPI 3.0 spells nullability as nullable: true beside a type where a JSON Schema draft spells a type union, and a validator that does not know the keyword would quietly ignore it. Asserting the count keeps the rewrite from becoming a no-op, since a translation that stops applying makes the run more permissive without saying so. Nothing else is rewritten — measured on this document, no schema puts a sibling keyword beside a $ref, and neither exclusive bound appears in the boolean form OpenAPI uses.

format is asserted rather than annotated, and TestATSSchemaMotionCurveIsInverted measures why. At JSON Schema's default reading, the standard's own motionCurve rejects all five interpolation values it names and accepts an arbitrary string, because its two oneOf branches both match a plain string:

value published schema, default format format asserted
DiscreteCubic rejected accepted
http://example.org/curve accepted accepted
Bogus accepted rejected

The same test measures the correction proposed for it — an absolute-URI pattern on the URI branch — which answers correctly under both readings, where anyOf continues to accept Bogus.

Two further tests record what the standard says about itself rather than asserting a constant somebody chose: the temporalGeometrySequence enum that settles Annex A's contradiction, and the fact that a temporal geometry's datetimes carry no format where a temporal property's carry date-time. The second is a gap in this validation rather than a finding about the tier, and it is stated so a passing TemporalGeometrySequence is not mistaken for a checked one.

Annex A's prose says what a response must carry; the schemas say it in a
form a machine checks. A suite that asserts the fields it thought to name
passes a document missing everything it forgot, so the schema is what
makes the conformance claim mean something.

openapi/ogcapi-movingfeatures-1.bundled.json is the OpenAPI document OGC
publishes for Part 1, vendored byte for byte and never edited. It is the
bundled form, so every reference resolves inside the one file and the
validation needs no network: it runs in the same job as every other test.
A test guarded by MFAPI_SCHEMA_FRESHNESS re-fetches the URL and compares.

The landing page, the conformance declaration, a Collections document, a
Collection, a TemporalProperties document and a TemporalGeometrySequence
are each validated against the schema the standard names for it.

One translation is applied and its count asserted: OpenAPI 3.0 spells
nullability as `nullable: true` beside a type where a JSON Schema draft
spells a type union, and a validator that does not know the keyword would
silently admit a null the standard admits anyway. The count keeps the
rewrite from becoming a no-op, since a translation that stops applying
makes the run more permissive without saying so. Nothing else is
rewritten: no schema puts a sibling keyword beside a reference, and
neither exclusive bound appears in the boolean form, so the two dialects
agree on every other keyword present.

`format` is asserted rather than annotated, and TestATSSchemaMotionCurve-
IsInverted measures why: at JSON Schema's default the standard's own
motionCurve rejects all five interpolation values it names and accepts an
arbitrary string, because its two oneOf branches both match a plain
string. The test also measures the correction proposed for it, an
absolute-URI pattern on the URI branch, which answers correctly under
both readings where anyOf does not.

Two further tests record what the standard says about itself rather than
asserting a constant somebody chose: the temporalGeometrySequence enum
that settles Annex A's contradiction, and the datetimes of a temporal
geometry carrying no format where those of a temporal property carry
date-time. The second is a gap in this validation, and it is stated so
that a passing TemporalGeometrySequence is not mistaken for a checked
one.
@estebanzimanyi
estebanzimanyi merged commit 735bfdf into master Aug 29, 2026
1 check passed
@estebanzimanyi
estebanzimanyi deleted the ats/schema-validation branch August 29, 2026 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant