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

Messages: mandatory empty string values should still return length #49

Open
JurgenR opened this issue Jul 23, 2023 · 2 comments
Open

Messages: mandatory empty string values should still return length #49

JurgenR opened this issue Jul 23, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@JurgenR
Copy link
Owner

JurgenR commented Jul 23, 2023

The length should still be serialized if a string is mandatory but None is passed

@JurgenR JurgenR added the bug Something isn't working label Jul 23, 2023
@JurgenR JurgenR self-assigned this Jul 23, 2023
@JurgenR
Copy link
Owner Author

JurgenR commented Sep 23, 2023

I do not remember in which message I encountered this but looking at the default values it's confusing as to what happens to the value. This should be clarified

@JurgenR JurgenR modified the milestone: v1.4 Nov 5, 2024
@JurgenR
Copy link
Owner Author

JurgenR commented Nov 6, 2024

For serialization there is nothing preventing from passing None to a mandatory field. There's a couple of possible solutions:

  • Adapt all string fields with a default empty string. However doing that will cause them to be longer mandatory and causes other fields to have to have defaults as well
  • Assign a default to each type and have it returned instead of None
  • Make an exception case for string type

The last 2 options could possibly have a performance impact

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant