-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Add support for FileContentResult in OpenAPI schemas #63504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
There was a problem hiding this 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! 👍
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
Updated
OpenApiSchemaService
to handleFileContentResult
, ensuring schemas are generated asstring
withbinary
format.Introduced a new test in
OpenApiSchemaServiceTests
to validate OpenAPI response handling forFileContentResult
, ensuring correct schema and content type representation.Fixes #63172