Document validator cache and diagnostics - #36
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.