Skip to content

Commit c1a42f7

Browse files
authored
Handle empty application/json request bodies (#1043)
1 parent 7ffda6d commit c1a42f7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/codegen/operations.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ func GenerateBodyDefinitions(operationID string, bodyOrRef *openapi3.RequestBody
661661
}
662662

663663
// If the body is a pre-defined type
664-
if IsGoTypeReference(content.Schema.Ref) {
664+
if content.Schema != nil && IsGoTypeReference(content.Schema.Ref) {
665665
// Convert the reference path to Go type
666666
refType, err := RefPathToGoType(content.Schema.Ref)
667667
if err != nil {

0 commit comments

Comments
 (0)