Skip to content
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

Added FastAPI Body to handle request body, causing an error. #127

Merged
merged 1 commit into from
Jun 19, 2024

Conversation

yjinjo
Copy link
Contributor

@yjinjo yjinjo commented Jun 19, 2024

Category

  • New feature
  • Bug fix
  • Improvement
  • Refactor
  • etc

Description

Added data: dict = Body() to the create_event method to explicitly handle the request body as a dictionary. This change was intended to ensure that the incoming JSON payload is correctly parsed and accessible within the method. However, this modification caused an error, likely due to a conflict with the existing request parsing logic or parameter handling within the method.

To avoid this issue, use Body(default={}) without the request parameter. If you want to use request, remove Body(default={}).

Known issue

Using request and FastAPI's Body() together in the create_event method causes an error when the POST request has no body.

Signed-off-by: Youngjin Jo <youngjinjo@megazone.com>
@yjinjo yjinjo added the bug Something isn't working label Jun 19, 2024
@yjinjo yjinjo self-assigned this Jun 19, 2024
@yjinjo yjinjo merged commit 459d7e2 into cloudforet-io:master Jun 19, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pass/signedoff
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant