这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@kemingy
Copy link
Member

@kemingy kemingy commented Aug 22, 2025

@kemingy kemingy requested a review from Copilot August 22, 2025 07:20
@kemingy kemingy marked this pull request as ready for review August 22, 2025 07:20

This comment was marked as outdated.

Signed-off-by: Keming <kemingy94@gmail.com>
Signed-off-by: Keming <kemingy94@gmail.com>
Signed-off-by: Keming <kemingy94@gmail.com>
@kemingy kemingy requested a review from Copilot August 22, 2025 07:32
Copy link

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 fixes an issue in the Falcon plugin where file upload detection was based on field annotations rather than the actual presence of a file, causing incorrect handling of multipart form data.

  • Changed file detection logic to check part.filename instead of BaseFile annotation
  • Made the file field optional in the test model to reflect the new behavior
  • Updated test snapshots to reflect the nullable file field in the OpenAPI specification

Reviewed Changes

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

File Description
spectree/plugins/falcon_plugin.py Updated file detection logic to use part.filename check instead of annotation-based detection
tests/common.py Made the file field optional in FormFileUpload test model
tests/snapshots/*.json Updated test snapshots to reflect nullable file field in OpenAPI specs
pyproject.toml Version bump to 1.5.1
Comments suppressed due to low confidence (1)

spectree/plugins/falcon_plugin.py:19

  • The import for BaseFile is removed but this could break other parts of the codebase that might still need this import. Ensure that BaseFile is not used elsewhere in this file or consider keeping the import if it's used by other functionality.
from spectree.plugins.base import BasePlugin, validate_response

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@kemingy kemingy merged commit 5715601 into 0b01001001:main Aug 22, 2025
9 checks passed
@kemingy kemingy deleted the falcon_check_bodypart branch August 22, 2025 08:21
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.

bug: Falcon demo file upload - AttributeError: 'bytes' object has no attribute 'filename'

1 participant