Skip to content

Bundle official example documents - #38

Merged
noha merged 4 commits into
masterfrom
bundle-official-example-documents
Aug 1, 2026
Merged

Bundle official example documents#38
noha merged 4 commits into
masterfrom
bundle-official-example-documents

Conversation

@noha

@noha noha commented Aug 1, 2026

Copy link
Copy Markdown
Member

No description provided.

noha and others added 4 commits August 1, 2026 14:59
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>
@noha
noha merged commit c92795c into master Aug 1, 2026
3 of 4 checks passed
@noha
noha deleted the bundle-official-example-documents 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