Skip to content

Commit ff81826

Browse files
author
Josh Newman
committed
ref!: rename extensions to prefix X
1 parent d43b467 commit ff81826

File tree

3 files changed

+35
-37
lines changed

3 files changed

+35
-37
lines changed

api/oapi/v1/service.pb.go

Lines changed: 29 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/oapi/v1/service.proto

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,10 @@ message ServiceOptions {
2626
// service. This can be overridden by a method definition.
2727
string default_response = 4;
2828

29-
// Sets the "x-displayName" extension property for the OAPI tag. This is used
30-
// by redocly/redoc for a friendly tag name.
31-
string display_name = 5;
29+
// Sets the "x-displayName" extension property.
30+
string x_display_name = 5;
3231

33-
// Adds the service to the extension x-tagGroups. If the group doesn't exist,
32+
// Adds the service to "x-tagGroups" extension property. If the group doesn't exist,
3433
// it is created and the service tag is added to it.
35-
string tag_group = 6;
34+
string x_tag_group = 6;
3635
}

internal/generator/path.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func (g *Generator) addPathsToDoc(doc *openapi3.T, services []*protogen.Service)
7878

7979
props := openapi3.ExtensionProps{
8080
Extensions: map[string]any{
81-
"x-displayName": serviceOptions.DisplayName,
81+
"x-displayName": serviceOptions.XDisplayName,
8282
},
8383
}
8484

@@ -88,7 +88,7 @@ func (g *Generator) addPathsToDoc(doc *openapi3.T, services []*protogen.Service)
8888
ExtensionProps: props,
8989
})
9090

91-
tagGroup := strings.TrimSpace(serviceOptions.TagGroup)
91+
tagGroup := strings.TrimSpace(serviceOptions.XTagGroup)
9292
if tagGroup != "" {
9393
err := addTagGroup(doc, tagGroup, tagName)
9494
if err != nil {

0 commit comments

Comments
 (0)