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

bugfix(grpc) Handle null value in proto definition #1458

Merged
merged 1 commit into from Feb 5, 2019
Merged

bugfix(grpc) Handle null value in proto definition #1458

merged 1 commit into from Feb 5, 2019

Conversation

ghost
Copy link

@ghost ghost commented Jan 18, 2019

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

What is the current behavior?

The proto definition produced by @grpc/proto-loader may have null value field, which will cause error.

syntax = "proto3";

message ProtoMessage {
    string param = 0x1;
}

The above message will generate following proto definition, which has null value field options.

{
  ProtoMessage: {
    format: 'Protocol Buffer 3 DescriptorProto',
    type: {
      field: [{
        name: 'param',
        extendee: '',
        number: 1,
        label: 'LABEL_OPTIONAL',
        type: 'TYPE_STRING',
        typeName: '',
        defaultValue: '',
        options: null, // <-- null value here
        oneofIndex: 0,
        jsonName: ''
      }],
      nestedType: [],
      enumType: [],
      extensionRange: [],
      extension: [],
      oneofDecl: [],
      reservedRange: [],
      reservedName: [],
      name: 'ProtoMessage',
      options: null
    }
  }
}

What is the new behavior?

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

@coveralls
Copy link

coveralls commented Jan 18, 2019

Pull Request Test Coverage Report for Build 1407

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.003%) to 93.826%

Totals Coverage Status
Change from base Build 1406: 0.003%
Covered Lines: 2872
Relevant Lines: 2995

💛 - Coveralls

1 similar comment
@coveralls
Copy link

Pull Request Test Coverage Report for Build 1407

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.003%) to 93.826%

Totals Coverage Status
Change from base Build 1406: 0.003%
Covered Lines: 2872
Relevant Lines: 2995

💛 - Coveralls

@kamilmysliwiec
Copy link
Member

LGTM. Thanks!

@kamilmysliwiec kamilmysliwiec merged commit bf04704 into nestjs:master Feb 5, 2019
@lock
Copy link

lock bot commented Sep 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants