MCPcopy Create free account
hub / github.com/pace/bricks / newType

Method newType

http/jsonapi/generator/generate_types.go:420–426  ·  view source on GitHub ↗

newType generates a new type only if it was not generated yet. returns nil, false if type already exists

(name string)

Source from the content-addressed store, hash-verified

418// newType generates a new type only if it was not generated yet.
419// returns nil, false if type already exists
420func (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
428func addRequiredOptionalTag(tags map[string]string, name string, schema *openapi3.Schema) {
429 // check if field is required

Callers 3

BuildTypesMethod · 0.95
buildTypeStructMethod · 0.95
generateTypeReferenceMethod · 0.95

Calls 1

TypeMethod · 0.80

Tested by

no test coverage detected