Fix remote_fields Definition in Pydantic Models to Make Field Optional and Nullable #101
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.
This PR corrects the field definition of "remote_fields" in the Pydantic models, which was causing validation errors. Previously, the omission of = None at the end of the field definition inadvertently made the field required, despite it being nullable. Since the remote_fields field is not present in every API response and should be both optional and nullable, this update properly adjusts its definition.
Changes:
Context:
This change resolves validation errors encountered during the parsing of API responses where remote_fields was missing, and the Pydantic models incorrectly treated it as a required field.
Testing:
Reference:
https://docs.pydantic.dev/latest/migration/#required-optional-and-nullable-fields
Field definition F4 (required, nullable) is correct here.
See also:
#98