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

Handle optional attributes as non-optional if they have default values #21

Merged
merged 4 commits into from
Jul 24, 2024

Conversation

rlenglet
Copy link
Collaborator

@rlenglet rlenglet commented Jul 24, 2024

Fix how attributes are determined to be optional.
Implement the AttributeIsOptional function to decide whether an attribute is optional: an attribute is now considered optional only if it has Optional set to true and it has no Default value.

Call AttributeIsOptional instead of directly IsOptional in all code generators.

Rename AttributeMode types to clarify that they specify to resource attributes, and not datasource attributes.
Define missing types for attributes with mode: Float32ResourceAttributeWithMode, Int32ResourceAttributeWithMode.

Regenerate the code.

Verified that optional fields with defaults are never set to Null.

rlenglet added 4 commits July 24, 2024 19:06
Call schema.AttributeIsOptional instead of directly IsOptional.
Rename AttributeMode types to clarify that they are specific to
resource attributes, and not datasource attributes.
Float32ResourceAttributeWithMode
Int32ResourceAttributeWithMode
@rlenglet rlenglet merged commit 93ec2b2 into main Jul 24, 2024
3 checks passed
@rlenglet rlenglet deleted the fix-optional-attrs-with-default branch July 24, 2024 19:41
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.

1 participant