Skip to content

Conversation

marcominerva
Copy link
Contributor

Updated OpenApiSchemaService to handle FileContentResult, ensuring schemas are generated as string with binary format.

Introduced a new test in OpenApiSchemaServiceTests to validate OpenAPI response handling for FileContentResult, ensuring correct schema and content type representation.

Fixes #63172

Updated OpenApiSchemaService to handle FileContentResult, ensuring schemas are generated as `string` with `binary` format.

Introduced a new test in OpenApiSchemaServiceTests to validate OpenAPI response handling for FileContentResult, ensuring correct schema and content type representation.
@Copilot Copilot AI review requested due to automatic review settings September 2, 2025 10:39
@marcominerva marcominerva requested review from captainsafia and a team as code owners September 2, 2025 10:39
@github-actions github-actions bot added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Sep 2, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for FileContentResult in OpenAPI schema generation, ensuring that FileContentResult responses are properly represented as binary strings in the generated OpenAPI documentation.

  • Added schema handling for FileContentResult to generate correct OpenAPI format (string with binary format)
  • Introduced comprehensive test coverage for FileContentResult response handling
  • Updated type mapping to include FileContentResult in schema name generation

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
OpenApiSchemaService.cs Added FileContentResult to the list of types that generate binary string schemas
OpenApiSchemaService.ResponseSchemas.cs Added test to verify FileContentResult generates correct OpenAPI schema with binary format
JsonTypeInfoExtensionsTests.cs Added FileContentResult to type name mapping tests for schema generation

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Sep 2, 2025
Copy link
Contributor

@mikekistler mikekistler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! 👍

@dotnet-policy-service dotnet-policy-service bot added the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Sep 12, 2025
@captainsafia
Copy link
Member

/azp run

@dotnet-policy-service dotnet-policy-service bot removed the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Sep 15, 2025
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@captainsafia captainsafia enabled auto-merge (squash) September 15, 2025 16:39
@captainsafia captainsafia merged commit 7dbebe9 into dotnet:main Sep 15, 2025
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates community-contribution Indicates that the PR has been added by a community member feature-openapi
Projects
None yet
Development

Successfully merging this pull request may close these issues.

File download endpoints incorrectly mapped as objects by built-in OpenAPI generator
5 participants