Skip to content

v1.71.0

Latest

Choose a tag to compare

@erraggy erraggy released this 05 Dec 19:43
Immutable release. Only release title and notes can be modified.
d70505f

🔁 Conversion That Keeps What You Wrote

v1.71.0 is a converter release. Local $refs now arrive naming the same thing, request bodies and path items stop disappearing, array serialization carries across versions, and what the target cannot express is reported instead of dropped.

⚠️ Read before upgrading: converted documents change, some for most inputs, and some conversions that reported success now report critical issues. See Behavior Changes.

🧵 Array Serialization (#701)

  • collectionFormat and style/explode map both ways, on parameters, response headers and form fields. A default 2.0 csv query array used to become one value per element; it now converts to style: form, explode: false.
  • Going down, a default 3.x query array is written as collectionFormat: multi.
  • What the target cannot express is reported: tsv, delimiters on paths and headers, nested arrays, and joined form arrays that the target version cannot join.

🧩 Parameter and Header Types, 3.x to 2.0 (#701)

OAS 2.0 declares these values inline. A $ref, allOf, anyOf or oneOf there used to become type: string.

  • References to component schemas are followed and allOf members merged, keeping items, enum and constraints.
  • Where alternatives differ, only a type is kept, and that is reported.
  • const becomes a one value enum, and a schema naming only values takes their type.
  • not, several types, false schemas and other constraints with no inline spelling are reported.

🔗 References (#690, #691, #692)

  • Deep local $refs such as #/definitions/Pair/items/0 are rewritten to their target's new position.
  • Request bodies: $refs to request bodies and to body or formData parameters are followed and converted as what they name. components.requestBodies and 2.0 parameter definitions map to each other.
  • Path item $refs are no longer written as {}, which lost every operation behind them.

🕳️ Nullable, 3.0 to 3.1 and Later (#696)

nullable: true is now rewritten as a "null" entry in type, so the converted schema still accepts null.

📚 Diff Documentation (#674)

The diff help, package docs, guides and skill now match what the code does: severities, exit status, samples and what is compared. No detection or severity changed.

Behavior Changes

Output

  • Most documents with array query parameters change in both directions.
  • 3.x to 2.0 output keeps types that used to be string, and allowEmptyValue on query parameters.
  • 3.x to 2.0 output no longer carries path item summary or description (reported as info).
  • Operations that lost a request body now have one.
  • Deep $refs are rewritten, and may be percent-encoded ({id} as %7Bid%7D).

New failures

  • A $ref whose target is not in the output, a request body $ref that names nothing, and a path item $ref that reaches nothing are critical issues, so those conversions are no longer successful.
  • Converting a Go-built document that holds a cycle returns an error. Parsed YAML or JSON never holds one.

Reports

  • New warnings for dropped request body encoding, dropped path item servers, dropped allowReserved and parameter deprecated, dropped alternatives and unsayable constraints. Strict mode can fail where it passed.
  • New info notes for dropped request body examples.
  • The 3.0 nullable reports are now info, not warnings.
  • An explicit style that OAS 2.0 already does is no longer reported.
  • diff between a 3.0 source and its 3.1 output reports the nullable and type changes.

httpvalidator

  • uniqueItems on Go values that JSON cannot spell, such as structs and pointers, now compares the values rather than their printed form.

🔒 User Impact

  • No exported API changes and no dependency changes

⚡ Performance

For ordinary documents, oastools convert takes about the same time as v1.70.2 (within 1% on the Stripe and GitHub corpus specs). A document with a $ref that points past a component takes longer: about 40% on the Stripe spec with one such reference added.

Converter allocations are close to v1.70.2: on the benchmark fixtures, converting an already parsed small document went from 121 to 128 (2.0 to 3.x) and 272 to 283 (3.x to 2.0).

🧪 CI (#685, #686)

The integration scenarios now run on every pull request, and the harness fails a scenario that does not check what it says.

Known Limits

  • 3.x to 2.0 still misstates server variables, bearer and OAuth2 flows, and sends multipart bodies as body (#577); operation servers are dropped silently (#694)
  • 3.1 to 3.0 keeps fields 3.0 does not define (#565), and 2.0 output can keep schema keywords 2.0 does not define (#693)
  • Examples are dropped in places (#578)
  • Converting 3.1 down, a constraint written beside a $ref stays beside it, where 2.0 and 3.0 ignore it, and a 3.1 nullable, which had no effect, takes effect in 3.0

📊 Quality Metrics

  • ✅ make check passing (13,321 tests)
  • ✅ Corpus and integration suites passing
  • ✅ Zero vulnerabilities (govulncheck clean)
  • ✅ Benchmarks recorded: of 304, only two parsed-document conversion benchmarks moved by more than 5% in allocations (121 to 128, 123 to 130)

What's Changed

  • docs: correct what the diff documentation claims by @erraggy in #674
  • test(integration): re-baseline the corpus fixer tests by @erraggy in #685
  • ci: run the integration scenarios and make the harness check what it says by @erraggy in #686
  • fix(converter): keep deep local refs naming their target by @erraggy in #690
  • fix(converter): follow parameter and request body refs by @erraggy in #691
  • fix(converter): carry a path item $ref across versions by @erraggy in #692
  • fix(converter): rewrite nullable as a null type when upgrading 3.0 by @erraggy in #696
  • fix(converter): keep array serialization and inline parameter types across versions by @erraggy in #701
  • chore: prepare v1.71.0 release by @erraggy in #702 (includes converter documentation corrections, runnable examples for the new behavior and two example README fixes)

Issues Fixed

Full Changelog: v1.70.2...v1.71.0