Skip to content

Download URLs always save file as openapi.json #2787

@laurence-myers

Description

@laurence-myers

Describe the bug
A custom download URL will always attempt to save the file as openapi.json. This is problematic if the download URL is e.g. a YAML file.

Expected behavior
A custom download URL does not force the file to be downloaded with the name openapi.json.

Minimal reproducible OpenAPI snippet(if possible)

Use any OpenAPI YAML.

redocly.yaml:

apis:
  example:
    root: ./example-original.yaml
    openapi:
      downloadUrls:
        - title: Download OpenAPI spec YAML
          url: './example-original.yaml'

Generate the HTML. The download button will save a file called openapi.json, where I would expect example-original.yaml

Screenshots

Image

Additional context

Version: 8.0.4033.34 (Official Build) (arm64)
Chromium Version: 148.0.7778.183
Channel: Official Build
Platform / OS: macOS Version 26.4 (Build 25E246)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions