Skip to content

fix: default to None for optional fields#694

Merged
zjx20 merged 1 commit intomainfrom
bugfix/optional-desc-field
Apr 10, 2025
Merged

fix: default to None for optional fields#694
zjx20 merged 1 commit intomainfrom
bugfix/optional-desc-field

Conversation

@zjx20
Copy link
Copy Markdown
Contributor

@zjx20 zjx20 commented Apr 10, 2025

As shown below, the description field should be optional, but the backend validation failed. This problem was introduced when upgrading pydantic to version 2.x (https://docs.pydantic.dev/latest/migration/#required-optional-and-nullable-fields). Adding a default value of None to all Optional fields solves the problem.

image

@zjx20 zjx20 requested a review from nayutah April 10, 2025 08:04
@zjx20 zjx20 requested a review from iziang as a code owner April 10, 2025 08:04
@apecloud-bot apecloud-bot added the size/M Denotes a PR that changes 30-99 lines. label Apr 10, 2025
@zjx20 zjx20 merged commit 9c1fba8 into main Apr 10, 2025
9 of 13 checks passed
@zjx20 zjx20 deleted the bugfix/optional-desc-field branch April 10, 2025 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Denotes a PR that changes 30-99 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants