Skip to content

Add message and enum type information to package definition output. #703

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

Merged
merged 2 commits into from
Jan 17, 2019

Conversation

murgatroid99
Copy link
Member

This is an implementation of gRFC proposal L43, adding message and enum type information to the output of the load and loadSync functions. When loaded into a gRPC implementation using loadPackageDefinition those objects will appear in the expected place in the object tree. They will also be included in the requestType and responseType message properties.

This supersedes PRs #408 and #448, and fixes #407.

assert(isTypeObject(packageDefinition.SequenceValues));
if(isTypeObject(packageDefinition.SequenceValues)) {
const sequenceValuesDef: TypeDefinition = packageDefinition.SequenceValues;
assert.strictEqual(sequenceValuesDef.format, 'Protocol Buffer 3 DescriptorProto');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am kind of wondering if we don't want a bit deeper comparisons here to validate the contents of what is returned? At least maybe not just .format, but .type as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a good idea, but it's a significant amount of work so we should do it at a later date. The type fields are just defined as object in TypeScript, so it does not like me looking at specific fields of those objects. The best solution for that is to probably write up full TypeScript definitions for those objects, but that is a lot of work and I would like to get this change usable first.

@nicolasnoble
Copy link
Member

LGTM otherwise, after we can see tests are green thanks to #705.

@murgatroid99
Copy link
Member Author

The Windows build timed out as usual, and the Linux Build failed with what looks like a CI flake. Rerunning the tests to be sure.

@murgatroid99 murgatroid99 merged commit eb932db into grpc:master Jan 17, 2019
This was referenced Jan 17, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Apr 17, 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.

Add RequestType and ResponseType Metadata
3 participants