Skip to content

Fix custom download URL filenames#2801

Open
cyphercodes wants to merge 1 commit into
Redocly:mainfrom
cyphercodes:fix-download-urls-filename-2787
Open

Fix custom download URL filenames#2801
cyphercodes wants to merge 1 commit into
Redocly:mainfrom
cyphercodes:fix-download-urls-filename-2787

Conversation

@cyphercodes

Copy link
Copy Markdown

What/Why/How?

Custom downloadUrls without an explicit downloadFileName currently inherit the generated-spec fallback filename (openapi.json). This forces YAML or other custom download URLs to save as openapi.json.

This change only applies the openapi.json fallback when Redoc generates the downloadable spec itself. Custom downloadUrls now leave the filename unset unless downloadFileName is explicitly configured, so the browser can use the URL/content-disposition filename.

Reference

Fixes #2787

Tests

  • npx jest src/services/__tests__/models/ApiInfo.test.ts --runInBand --coverage=false
  • npm run ts-check
  • npx eslint src/services/models/ApiInfo.ts src/services/__tests__/models/ApiInfo.test.ts --no-cache
  • npx prettier --check src/services/models/ApiInfo.ts src/services/__tests__/models/ApiInfo.test.ts
  • git diff --check

Screenshots (optional)

N/A

Check yourself

  • Code is linted
  • Tested
  • All new/updated code is covered with tests

@cyphercodes cyphercodes requested a review from a team as a code owner June 7, 2026 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Download URLs always save file as openapi.json

1 participant