hyperweb-io / hyperweb-io/telescope

fields nullability

Open
#365 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
154
Forks
53
PR merge metrics
No merged PRs in 30d

Description

Pagination type informs that all properties are required:

image

I found this on fields nullability of go protobuff:

"Warning about nullable: According to the Protocol Buffer specification, you should be able to tell whether a field is set or unset. With the option nullable=false this feature is lost, since your non-nullable fields will always be set. It can be seen as a layer on top of Protocol Buffers, where before and after marshalling all non-nullable fields are set and they cannot be unset."

https://pkg.go.dev/github.com/gogo/protobuf/gogoproto

So I guess based on this, we can tell fields should be nullable by default, aka nullable=true. But our default value of fieldDefaultIsOptional is false. So my suggestion is that we should change the default value into true.

I also tried to change fieldDefaultIsOptional into true and regenerated the code. But I found those fields in pagination were still not optional.

This issue needs to be discussed in this thread.

This is split from [this](https://github.com/osmosis-labs/telescope/issues/321#issue-1597664891)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.