Add support for FileContentResult in OpenAPI schemas#63504
Merged
captainsafia merged 2 commits intodotnet:mainfrom Sep 15, 2025
Merged
Add support for FileContentResult in OpenAPI schemas#63504captainsafia merged 2 commits intodotnet:mainfrom
captainsafia merged 2 commits intodotnet:mainfrom
Conversation
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.
Contributor
There was a problem hiding this comment.
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
FileContentResultto generate correct OpenAPI format (string with binary format) - Introduced comprehensive test coverage for
FileContentResultresponse handling - Updated type mapping to include
FileContentResultin 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 |
Open
3 tasks
shethaadit
approved these changes
Sep 4, 2025
This was referenced Sep 12, 2025
Contributor
|
/azp run |
captainsafia
approved these changes
Sep 15, 2025
|
Azure Pipelines successfully started running 2 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updated
OpenApiSchemaServiceto handleFileContentResult, ensuring schemas are generated asstringwithbinaryformat.Introduced a new test in
OpenApiSchemaServiceTeststo validate OpenAPI response handling forFileContentResult, ensuring correct schema and content type representation.Fixes #63172