Skip to content

Commit

Permalink
feat(openapi3gen): Customize json.RawMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
kyleconroy committed Jan 28, 2025
1 parent cea0a13 commit 827114b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions openapi3gen/openapi3gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,11 +290,10 @@ func (g *Generator) generateWithoutSaving(parents []*theTypeInfo, t reflect.Type

case reflect.Slice:
if t.Elem().Kind() == reflect.Uint8 {
if t == rawMessageType {
return &openapi3.SchemaRef{Value: schema}, nil
if t != rawMessageType {
schema.Type = &openapi3.Types{"string"}
schema.Format = "byte"
}
schema.Type = &openapi3.Types{"string"}
schema.Format = "byte"
} else {
schema.Type = &openapi3.Types{"array"}
items, err := g.generateSchemaRefFor(parents, t.Elem(), name, tag)
Expand Down

0 comments on commit 827114b

Please sign in to comment.