[PR #4762] [MERGED] Fix openapi file schema #10270

Closed
opened 2026-02-07 06:17:08 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/4762
Author: @crobibero
Created: 12/11/2020
Status: Merged
Merged: 12/11/2020
Merged by: @cvium

Base: masterHead: api-file-return


📝 Commits (1)

📊 Changes

1 file changed (+2 additions, -1 deletions)

View changed files

📝 Jellyfin.Server/Filters/FileResponseFilter.cs (+2 -1)

📄 Description

I must have looked at swagger2 docs when making this filter.

Taken from https://swagger.io/docs/specification/describing-responses/

Response That Returns a File
An API operation can return a file, such as an image or PDF. OpenAPI 3.0 defines file input/output content as type: string with format: binary or format: base64. This is in contrast with OpenAPI 2.0, which uses type: file to describe file input/output content. If the response returns the file alone, you would typically use a binary string schema and specify the appropriate media type for the response content:

    paths:
      /report:
        get:
          summary: Returns the report in the PDF format
          responses:
            '200':
              description: A PDF file
              content:
                application/pdf:
                  schema:
                    type: string
                    format: binary

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jellyfin/jellyfin/pull/4762 **Author:** [@crobibero](https://github.com/crobibero) **Created:** 12/11/2020 **Status:** ✅ Merged **Merged:** 12/11/2020 **Merged by:** [@cvium](https://github.com/cvium) **Base:** `master` ← **Head:** `api-file-return` --- ### 📝 Commits (1) - [`34029f8`](https://github.com/jellyfin/jellyfin/commit/34029f860c1c870e7c50aaa4aaf1188e7e8c72b4) Fix openapi file schema ### 📊 Changes **1 file changed** (+2 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `Jellyfin.Server/Filters/FileResponseFilter.cs` (+2 -1) </details> ### 📄 Description I must have looked at swagger2 docs when making this filter. Taken from https://swagger.io/docs/specification/describing-responses/ > Response That Returns a File > An API operation can return a file, such as an image or PDF. OpenAPI 3.0 defines file input/output content as type: string with format: binary or format: base64. This is in contrast with OpenAPI 2.0, which uses type: file to describe file input/output content. If the response returns the file alone, you would typically use a binary string schema and specify the appropriate media type for the response content: ```yaml paths: /report: get: summary: Returns the report in the PDF format responses: '200': description: A PDF file content: application/pdf: schema: type: string format: binary ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-07 06:17:08 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#10270