Skip to content

dredd-transactions: OpenAPI 3.1 schema edge cases #7

Description

@dalberola

OpenAPI-3.1-specific gaps in sample generation / parsing (agent-reported; [needs repro]). Relevant to this fork's OpenAPI-3 focus.

  • Multi-type schemas sample only the first non-null type. packages/dredd-transactions/compile/openapi31.js: schemaTypes(resolvedSchema).filter((t) => t !== 'null')[0]. For type: ["object","string"] only object is ever exercised.
  • Dead param.type switch. packages/dredd-transactions/compile/compileURI/validateParams.js switches on param.type, but compileParams.js never populates a type field — the type-validation branch is unreachable.
  • allOf of non-objects yields undefined instead of a sensible sample (openapi31.js allOf handler).
  • YAML parse errors swallowed. packages/dredd-transactions/parse/index.js: yaml.load failure is caught and discarded, so users get a generic "unrecognized format" instead of the YAML error.

Tasks

  • Decide sampling behavior for multi-type schemas (and document it).
  • Remove the dead param.type switch, or populate type upstream so validation runs.
  • Handle allOf with primitive subschemas.
  • Surface YAML parse errors as annotations when the doc is neither valid 3.0 nor 3.1.
  • Fixtures for each 3.1 construct above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions