Skip to content

How to represent REQUIRED on oneof fields. #336

@kommendorkapten

Description

@kommendorkapten

The best option for marking a oneof field as required; i.e that exactly one of the fields must be set seems be in flux. Currently we are marking all fields in the oneof as required, which appeared to be the preferred way, link. Marking all fields as required seems to cause problems for Go reflection based field validation: sigstore/sigstore-go#63 (comment)

According to this issue, there is an alternative approach. Let's explore that and see if it solves the issues we are facing, and also the annotations per that issue is more visually appealing. There is also a PR to disallow field_behavior on oneof so updating makes sense.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions