Skip to content

openapi: undeclared keys are still dropped at the objects with no Unmodeled carrier #357

Description

@OmarAlJarrah

#297 added a census of the keys the parsed OpenAPI model names no field for, and
wired it to every object that lowers to a node carrying an Unmodeled map: the
document root, info (with contact and license), the root externalDocs, servers and
their variables, tags, operations, parameters, request bodies, media types,
responses (both the success and the error lowering), headers, security schemes and
every schema position.

The rest of the extension-bearing objects are still uncovered, for one of three
reasons.

No carrier today. example, link, encoding, oauthFlows and each flow
inside it, discriminator, xml, and externalDocs below the document root lower
to no node that holds an Unmodeled map, or to one the lowering has no handle on
at that point. #345 is adding exactly those carriers for vendor extensions, keyed
by the same scheme; the census for these objects belongs on top of that rather than
duplicating its scaffolding.

A library gap. A Path Item Object's undeclared key never reaches the census at
all: marshaller folds an unrecognized key into the path item's embedded
operations map and reports a type-mismatch validation finding instead, so
GetUnknownProperties returns nothing for it. Verified at
speakeasy-api/openapi v1.24.0. Preserving one needs the raw node read directly,
the shape dependentRequired already uses.

Not applicable. paths, responses, components and callbacks are sequenced
maps where every key is a valid entry, so an object-level census has nothing to
say about them.

Scope: extend the census to the first group once #345 lands, and decide separately
whether the path-item case is worth a raw-node read.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions