newType generates a new type only if it was not generated yet. returns nil, false if type already exists
(name string)
| 418 | // newType generates a new type only if it was not generated yet. |
| 419 | // returns nil, false if type already exists |
| 420 | func (g *Generator) newType(name string) (*jen.Statement, bool) { |
| 421 | if g.generatedTypes[name] { |
| 422 | return nil, false |
| 423 | } |
| 424 | g.generatedTypes[name] = true |
| 425 | return jen.Type().Id(name), true |
| 426 | } |
| 427 | |
| 428 | func addRequiredOptionalTag(tags map[string]string, name string, schema *openapi3.Schema) { |
| 429 | // check if field is required |
no test coverage detected