Overview

@scalar/openapi-upgrader

0.3.1#

Patch Changes#

  • #10306: Preserve Swagger 2.0 x-nullable when upgrading schemas, parameters, and headers.

0.3.0#

Minor Changes#

  • #10211: Preserve literal data and tag groups when upgrading to OpenAPI 3.2, migrate XML metadata only in schemas, and remove incompatible legacy XML flags. Make 3.2 upgrades leave the input unchanged, match the complete source version, prevent previously inactive parameter settings from changing serialization, and report path-specific errors for detected compatibility issues that require an author's decision.

    Expose UpgradeIncompatibilityError so Markdown generation can retain OpenAPI 3.1 for descriptions requiring author decisions instead of failing or silently changing semantics. Clone safety and malformed-version errors still propagate.

    The mock server also retains OpenAPI 3.1 when the strict 3.2 migration reports compatibility diagnostics. Existing inline XML descriptions continue loading without inventing element names.

    Read only own data properties during migration so inherited parameter lists, XML metadata, and reference targets cannot modify prototype-owned objects.

    Add upgrade(input, '3.2', { onIncompatible: 'collect' }) to return a complete document and compatibility diagnostics. Compatible descriptions upgrade to 3.2; incompatible descriptions retain 3.1 without partial transformations. Strict mode remains the default, and malformed-version and clone-safety errors still propagate. The Markdown converter and mock server now use the shared collect mode.

Patch Changes#

  • #10278: Only migrate XML metadata in schemas when upgrading to OpenAPI 3.2. Preserve example payloads and other data containing xml properties instead of changing them or throwing errors.
  • #10276: Migrate x-tagGroups to OpenAPI 3.2 parent tags and remove the extension, preserving group names, member order, and tag metadata. Resolve group/tag name collisions with unique names and preserve group labels with summary. Warn and preserve the original tags and extension for ambiguous or malformed hierarchies so the API description can still render. Avoid mutating a document prototype during tag migration.

0.2.17#

Patch Changes#

  • #10236: Omit exclusive bounds without a minimum or maximum when upgrading OpenAPI 3.0 descriptions.
  • #10236: Avoid undefined or inferred media types for base64-encoded data when upgrading OpenAPI 3.0 descriptions.
  • #10236: Fix format conversion for nullable strings when upgrading OpenAPI 3.0 descriptions.
  • #10236: Omit JSON type constraints for raw binary schemas and preserve media metadata when upgrading OpenAPI 3.0 descriptions.

0.2.16#

Patch Changes#

  • #9666: Only normalize OpenAPI Reference Objects during bundling, never Schema Objects. normalizeRefs used to strip every sibling except $ref on any node outside components/schemas, which also hit inline schemas. In JSON Schema 2020-12 a $ref may legally carry sibling keywords — for example a $defs/$dynamicAnchor binding that specializes a generic template like Paginated<T> — and such schemas appear inline anywhere a schema is allowed (a response's content.<media>.schema, an allOf branch, …). Dropping those siblings discarded the binding, leaving $dynamicRef to resolve to the template's empty fallback and rendering an empty array (for example the data array of GET /planets in the Scalar Galaxy). Reference Objects are still normalized as before. A new @scalar/helpers/openapi/is-schema-path helper detects schema positions.

  • #10140: Replace redundant type assertions with compiler-checked annotations, typed accumulators, and existing guards across helpers, API conversion, request handling, and schema rendering.

    Narrow DOM elements and caught errors before accessing their properties. Correct header lookup to include missing values and handle them during PowerShell snippet generation.

    Validate release-note provider responses, represent unresolved references and absent groups in helper return types, and require narrowing merged object values. Preserve AsyncAPI broker credentials separately from HTTP authentication schemes.

0.2.15#

Patch Changes#

  • #9941: Republish every package through npm trusted publishing. No functional changes.

0.2.14#

Patch Changes#

  • #9910: Keep the full schema of a Swagger 2.0 formData parameter when upgrading to OpenAPI 3.0. The request body property was rebuilt from type, description and format only, so a parameter with type: 'array' lost its items and consumers of the upgraded document saw an array of unknown values. items, enum, default and the other validation keywords now survive, and the array collectionFormat is carried over as an OpenAPI 3.0 encoding entry (style/explode) instead of being dropped.

0.2.13#

Patch Changes#

  • #9827: Convert nullable $ref patterns to the 3.1 null-union form when upgrading from OpenAPI 3.0 to 3.1

0.2.12#

Patch Changes#

  • #9758: fix: stop the 3.0 to 3.1 upgrade from mangling non-schema nodes

    The upgrade applied its schema transforms to every object node, regardless of where it sat in the document. Three cases are now handled correctly:

    • Members named example inside a map of named subschemas (properties, patternProperties, $defs, definitions, and components/schemas) are names, not the example keyword, so they are no longer rewritten into an examples array.
    • Data held by the example, default, const, and enum keywords, and by an Example Object's value, is left untouched instead of being walked as if it were a schema (which turned nullable: true into a type array, collapsed exclusiveMinimum, renamed a nested x-webhooks, and so on).
    • x-webhooks is only renamed to webhooks at the document root, not wherever a key happens to share that name.

0.2.11#

Patch Changes#

  • #9719: docs: update the Scalar platform overview block in the README

0.2.10#

Patch Changes#

  • #9710: Republish so the updated README (with the Scalar platform overview) reaches npm. Also renames the README generator metadata in package.json from readme to scalarReadme: npm treats a readme field as the readme text itself, so affected packages were published with a literal [object Object] readme on the registry instead of README.md.

0.2.9#

0.2.8#

0.2.7#

Patch Changes#

  • #9043: chore: move test documents to cdn

0.2.6#

0.2.5#

Patch Changes#

  • #8825: chore: moving files around in preparation for the big deletion of client v1

0.2.4#

0.2.3#

Patch Changes#

  • #8622: fix: swagger 2.0 mixed media types for produces & examples

0.2.2#

Patch Changes#

  • #8502: feat: transforms x-examples keyed by example name

0.2.1#

Patch Changes#

  • #8466: chore: new build pipeline

0.2.0#

Minor Changes#

  • #8322: chore: bump required node version to >=22 (LTS)

Patch Changes#

Updated Dependencies#

  • @scalar/openapi-types@0.6.0
    • #8322: chore: bump required node version to >=22 (LTS)

0.1.11#

Patch Changes#

  • #8326: feat: keep named request examples when upgrading from Swagger 2.0

Updated Dependencies#

  • @scalar/openapi-types@0.5.4
    • #8275: fix(openapi-types): make the $ref property in the ReferenceObject type required

0.1.10#

Patch Changes#

  • #8272: feat: migrate swagger 2.0 response examples

0.1.9#

Patch Changes#

  • #8251: feat: migrate swagger 2.0 defaults for parameter

0.1.8#

Patch Changes#

  • #7842: feat: migrate swagger 2.0 responses

0.1.7#

Patch Changes#

  • #7739: fix: upgrade form to multipart/form
  • #7694: feat: migrate x-example and x-examples

0.1.6#

Patch Changes#

  • Updated dependencies [72cd82f]:
    • @scalar/openapi-types@0.5.3

0.1.5#

Patch Changes#

  • Updated dependencies [a164d76]:
    • @scalar/openapi-types@0.5.2

0.1.4#

Patch Changes#

0.1.3#

Patch Changes#

  • Updated dependencies [f69e7cc]
    • @scalar/openapi-types@0.5.0

0.1.2#

Patch Changes#

  • Updated dependencies [15c4240]
    • @scalar/openapi-types@0.4.1

0.1.1#

Patch Changes#

  • Updated dependencies [008a0f3]
    • @scalar/openapi-types@0.4.0

0.1.0#

Minor Changes#

  • 6221e4a: hello world :)
  • 02085ef: feat: add OpenAPI 3.1 > 3.2 upgrader (not enabled by default)

Patch Changes#

  • 2d612e4: fix: consumed media types are not deleted for non-existing body parameter and referenced parameter is added empty schema object

Updated

Was this page helpful?