Skip to content

Document validator cache and diagnostics - #36

Merged
noha merged 3 commits into
masterfrom
document-validator-cache-and-diagnostics
Aug 1, 2026
Merged

Document validator cache and diagnostics#36
noha merged 3 commits into
masterfrom
document-validator-cache-and-diagnostics

Conversation

@noha

@noha noha commented Aug 1, 2026

Copy link
Copy Markdown
Member

No description provided.

noha and others added 3 commits August 1, 2026 12:08
schemaForVersion: previously rebuilt the JSONSchema from the bundled
OAI meta-schema JSON on every call; it now caches per major.minor
version bucket. isValidDocument: only ever returned a boolean,
swallowing the actual JSONSchemaError - validationErrorFor:,
validationErrorFor:version: and validationErrorMessageFor: now expose
which rule was violated (error class + messageText) without raising.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
extractParameter: already handles required-vs-optional correctly: it
signals OAMissingRequiredParameter when required and absent, and only
returns nil when optional and absent - which is exactly the case
writeParameterValueOn:request: skips writing for. No behavior change.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…schema branches

The prior 12 tests only exercised whole-document shape (missing
info/paths, wrong paths type). The OAI 3.0 meta-schema's more
interesting validation branches - Parameter's oneOf over path/query/
header/cookie locations (incl. PathParameter's forced required:true),
ExampleXORExamples, SchemaXORContent, additionalProperties as schema/
boolean/invalid, the four SecurityScheme variants, Responses'
minProperties, and the Paths object's ^/ pattern - had zero coverage.

Note: these all include a real operation+response, which surfaces
zweidenker/JSONSchema#support-non-capturing-regex-groups (the OAI
Responses/component-name patterns use regex syntax Pharo's engine
didn't accept) - these tests only pass once that lands.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@noha
noha merged commit c69cc96 into master Aug 1, 2026
3 of 8 checks passed
@noha
noha deleted the document-validator-cache-and-diagnostics branch August 1, 2026 15:29
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