github unkn0wn-root/resterm v0.23.4

latest releases: v0.26.2, v0.26.1, v0.25.2...
one month ago

What's Fixed

OpenAPI import now handles parameter references in header positions

Previously, if your OpenAPI spec used a $ref pointing to #/components/parameters/... inside a response's headers section, resterm would reject the file with an error like:

openapi import error: load OpenAPI spec: bad data in "#/components/parameters/credential" (expecting ref to header object)

Starting with this release, resterm will automatically convert the parameter reference into an inline header object before loading the spec. The import succeeds, and you'll see a warning in the generated .http file:

# Warning: OpenAPI compatibility rewrite: converted 1 header $ref occurrence(s)
# from "#/components/parameters/credential" to inline Header Objects

Example: If your spec looks like this:

paths:
  /demo:
    get:
      responses:
        '200':
          description: ok
          headers:
            credential:
              $ref: '#/components/parameters/credential'
components:
  parameters:
    credential:
      name: credential
      in: header
      required: true
      schema:
        type: string

Before this fix, resterm --from-openapi spec.yaml would fail. Now it imports successfully, and the credential header is resolved correctly in the generated request file. This works with both YAML and JSON specs, follows $ref chains (parameter referencing another parameter) and preserves any x- vendor extensions on the original reference.

Don't miss a new resterm release

NewReleases is sending notifications on new releases.