Skip to content

Conversation

johanbrandhorst
Copy link
Collaborator

References to other Issues or PRs

Have you read the Contributing Guidelines?

Brief description of what is fixed or changed

Other comments

Comment on lines +14 to +19
type generator struct{}

// New returns a new generator which generates OpenAPI v3 files.
func New() *generator {
return &generator{}
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Instead of a meaningless constructor like this, lets just export the generator type.

if len(b.Body.FieldPath) > 0 {
schema = schemaOfField(b.Body.FieldPath[0].Target)
} else {
// TODO(ivucica): This should be a reference to a schema in components/schemas
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Remove this comment

Comment on lines +151 to +153
if strings.HasSuffix(name, ".proto") {
name = name[:len(name)-len(".proto")]
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just use strings.TrimPrefix

package main

import (
"io/ioutil"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just use io instead of ioutil

@johanbrandhorst johanbrandhorst deleted the feat/protoc-gen-openapiv3 branch August 13, 2025 03:01
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.

1 participant