Skip to content

Commit 4d40632

Browse files
Remove errors for anon objects
1 parent 270e3aa commit 4d40632

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

internal/generator/schema.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ package generator
22

33
import (
44
"encoding/json"
5-
"fmt"
65
"path"
76
"strings"
87

98
"github.com/getkin/kin-openapi/openapi3"
10-
oapiv1 "github.com/technicallyjosh/protoc-gen-openapi/internal/gen/v1"
11-
"github.com/technicallyjosh/protoc-gen-openapi/internal/generator/util"
129
"google.golang.org/protobuf/compiler/protogen"
1310
"google.golang.org/protobuf/proto"
1411
"google.golang.org/protobuf/reflect/protoreflect"
1512
"google.golang.org/protobuf/types/descriptorpb"
13+
14+
oapiv1 "github.com/technicallyjosh/protoc-gen-openapi/internal/gen/v1"
15+
"github.com/technicallyjosh/protoc-gen-openapi/internal/generator/util"
1616
)
1717

1818
// addSchemasToDoc adds all non "request" and "response" messages as schemas to the OAPI doc.
@@ -139,8 +139,6 @@ func (g *Generator) buildSchema(doc *openapi3.T, message *protogen.Message, pare
139139
if err != nil {
140140
return err
141141
}
142-
} else {
143-
return fmt.Errorf("'%s' references '%s' but it seems to be missing", field.Desc.FullName(), fieldMessageName)
144142
}
145143
}
146144
}
@@ -176,8 +174,6 @@ func (g *Generator) buildSchema(doc *openapi3.T, message *protogen.Message, pare
176174
if err != nil {
177175
return err
178176
}
179-
} else {
180-
return fmt.Errorf("'%s' references '%s' but it seems to be missing", field.Desc.FullName(), fieldMessageName)
181177
}
182178
}
183179
}

0 commit comments

Comments
 (0)