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

Add options to doc response #2770

Merged
merged 6 commits into from
Feb 16, 2024
Merged

Conversation

gilwong00
Copy link
Contributor

Part 2 of #2752.

Adding FieldLiteral to Message, Enum, Service, Method and EnumValue responses

// All options that are present on the message. This is a super-set of
// message_options and uses a dynamic representation so it can also
// accommodate custom options with arbitrary types.
repeated FieldLiteral options = 12;
Copy link
Member

Choose a reason for hiding this comment

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

It's weird that we have message_options and then options where options is defined as "all options on the message". Do you instead want to deprecate message_options and say that this supersedes it:?

Copy link
Contributor Author

@gilwong00 gilwong00 Feb 15, 2024

Choose a reason for hiding this comment

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

Yea we can do that. Should we also do the same with enum_options , method_options and service_options as well?

Copy link
Member

Choose a reason for hiding this comment

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

Yes. In all cases, the new repeated FieldLiteral options field deprecates the old *_options field.

Copy link
Member

Choose a reason for hiding this comment

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

Perfect

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added [deprecated = true] to all *_options fields

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can completely remove *_options fields from the messages in a follow up PR after the changes in core ships.

@@ -198,9 +198,14 @@ message Service {
string file_path = 5;
Location location = 6;
repeated Method methods = 7;
ServiceOptions service_options = 8;
ServiceOptions service_options = 8 [deprecated = true];
Copy link
Member

Choose a reason for hiding this comment

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

Can you move this to the bottom of the message definition, and add a comment "Use options instead."

  ...
  repeated FieldLiteral options = 10;
  // Use options instead.
  ServiceOptions service_options = 8;
}

Also, is ServiceOptions used elsewhere, or is this the only use? If not used elsewhere, also deprecate it:

message ServiceOptions {
  option deprecated = true;
  ...
}

Apply this across all of the below. Sorry for the back and forth.

@gilwong00 gilwong00 merged commit 21acb56 into main Feb 16, 2024
11 checks passed
@gilwong00 gilwong00 deleted the gwong/add-options-to-doc-response branch February 16, 2024 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants