Bundle official example documents - #38
Merged
Merged
Conversation
New OAExampleDocuments class bundles the six example documents from OAI/OpenAPI-Specification (_archive_/schemas/v3.0/pass/, Apache-2.0, YAML converted to JSON) - the same fixtures the OAI project itself uses to verify its meta-schema accepts real, non-trivial specs. Complements the hand-written OADocumentValidatorTests branch-coverage cases with realistic documents nobody hand-crafted for this codebase. All six validate successfully against OADocumentValidator. Round- tripping them through OpenAPI's object model (fromString:/specString) surfaced three additional real bugs, fixed in the following commits. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
visitOpenApi: unconditionally sent components/schemas while normalizing schemas before serialization - any real document without a components object at all (both api-with-examples and callback-example, two of the six official OAI examples, have none) crashed specString entirely with 'receiver of "schemas" is nil'. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The example accessor existed but had no setter and its NeoJSON mapping was commented out, so any document using the (spec-legal, and used by the official uspto.gov example) inline example field on a Media Type Object - as opposed to a named entry under examples - failed to read with MessageNotUnderstood on #example:. It's mapped without a valueSchema (not as an OAExample): per spec this field is arbitrary example data, not an Example Object with its own summary/description/value/externalValue wrapper. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
OALink existed as a declared class but had never been implemented - zero instance variables, no neoJsonMapping:, so any document using components.links (a legitimate, spec-standard feature for HATEOAS- style responses - used by the official link-example.json) failed with NeoJSONMappingNotFound: No mapping found for OALink. Added the six Link Object fields (operationId, operationRef, parameters, requestBody, description, server) as plain accessors - parameters/requestBody/server are raw passthrough data per spec (runtime expressions / arbitrary values), matching how OAMediaTypeObject handles its own raw fields. 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.