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

fix(types): nested object can be a oneof #1812

merged 1 commit into from
Sep 22, 2022


Copy link

@alexander-fenster alexander-fenster commented Sep 22, 2022

Fixing the type declaration to allow one very special case: a field extension that is a proto3 optional field. Internally, proto3 optional fields are represented as a single field oneofs, which makes it the first case ever when a oneof can be a nested object.

Example: bigquery-storage

extend google.protobuf.FieldOptions {
  optional string column_name = 454943157;

Related part of the JSON:

                      "nested": {
                        "_columnName": {
                          "oneof": [       <--- this is not accepted without the fix
                        "columnName": {
                          "type": "string",
                          "id": 454943157,
                          "extend": "google.protobuf.FieldOptions",
                          "options": {
                            "proto3_optional": true

Yeah, also, last but not least, VSCode does not hang anymore, so removing that comment. It was added 6 years ago, not true anymore.

@alexander-fenster alexander-fenster merged commit 119d90a into master Sep 22, 2022
@alexander-fenster alexander-fenster deleted the dts-namespace-oneof branch September 22, 2022 18:28
@github-actions github-actions bot mentioned this pull request Sep 22, 2022
binsee pushed a commit to juzibot/protobuf.js that referenced this pull request Sep 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants