Skip to content

Commit

Permalink
Return enabled:false in oas document, don't omit
Browse files Browse the repository at this point in the history
  • Loading branch information
titpetric committed Jun 15, 2022
1 parent 5503b32 commit 92ac66f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apidef/oas/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (s *Server) Fill(api apidef.APIDefinition) {
s.GatewayTags = &GatewayTags{}
}
s.GatewayTags.Fill(api)
if !s.GatewayTags.Enabled || len(s.GatewayTags.Tags) == 0 {
if len(s.GatewayTags.Tags) == 0 {
s.GatewayTags = nil
}

Expand Down
3 changes: 1 addition & 2 deletions apidef/oas/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ func TestGatewayTags(t *testing.T) {
},
{
input: GatewayTags{Enabled: false, Tags: []string{"t1", "t2"}},
want: GatewayTags{},
omit: true,
want: GatewayTags{Enabled: false, Tags: []string{"t1", "t2"}},
},
}

Expand Down

0 comments on commit 92ac66f

Please sign in to comment.