Skip to content

feat: add internal message #196

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
May 26, 2025
Merged

feat: add internal message #196

merged 2 commits into from
May 26, 2025

Conversation

sashamelentyev
Copy link
Collaborator

No description provided.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for marking Protobuf messages as internal and filtering them (and their fields) out during schema and operation generation.

  • Introduces generic visibility helpers (isVisibilityIndicator) and specific checks (isInternalMessage)
  • Skips internal messages in mkSchema and filters internal fields/messages in JSON and input generators
  • Adds an example InteralMessage in message.proto

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
internal/gen/visibility.go Added isInternalMessage, isMessageVisibilityIndicator, and generic isVisibilityIndicator.
internal/gen/schema.go Updated mkSchema and mkJSONFields to skip internal messages/fields.
internal/gen/generator.go Filters out internal message fields when building inputs.
example/message.proto Added an internal message example (typo in name).
Comments suppressed due to low confidence (4)

internal/gen/schema.go:101

  • [nitpick] The local variable name isInternalField shadows the function isInternalField. Rename the variable (e.g., internalFieldFlag) to avoid confusion.
isInternalField := isInternalField(f.Desc.Options()) && !isPreviewField(f.Desc.Options())

internal/gen/schema.go:102

  • [nitpick] The local variable isInternalMessage shadows the function isInternalMessage. Consider renaming it (e.g., internalMsgFlag).
isInternalMessage := f.Message != nil && isInternalMessage(f.Message.Desc.Options())

internal/gen/generator.go:252

  • [nitpick] Local variable isInternalMessage shadows the function of the same name. Rename the variable (e.g., skipInternalMsg) to clarify intent.
isInternalMessage := field.Message != nil && isInternalMessage(field.Message.Desc.Options())

internal/gen/schema.go:50

  • There are no tests covering the behavior of skipping internal messages in mkSchema. Consider adding unit tests to verify this logic.
if isInternalMessage(msg.Desc.Options()) {

Signed-off-by: Sasha Melentyev <[email protected]>
@ernado ernado merged commit e502054 into main May 26, 2025
22 of 28 checks passed
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