Skip to content

Commit

Permalink
Merge pull request #89 from masseelch/fix/numeric-structs
Browse files Browse the repository at this point in the history
fix(gen): prefix numeric response / request structs with "R"
  • Loading branch information
ernado authored Dec 20, 2021
2 parents 7d0e757 + 8b77cce commit 4a229a3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gen/schema_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ func (g *schemaGen) generate(name string, schema *oas.Schema) (*ir.Type, error)

name = pascal(strings.TrimPrefix(ref, "#/components/schemas/"))
}
if name[0] >= '0' && name[0] <= '9' {
name = "R" + name
}

switch {
case len(schema.AnyOf) > 0:
Expand Down

0 comments on commit 4a229a3

Please sign in to comment.