MCPcopy Create free account

hub / github.com/a-h/generate / functions

Functions87 in github.com/a-h/generate

↓ 17 callersFunctiontestField
(actual Field, expectedJSONName string, expectedName string, expectedType string, expectedToBeRequired bool, t
generator_test.go:172
↓ 14 callersMethodInit
Init schema.
jsonschema.go:218
↓ 12 callersMethodCreateTypes
CreateTypes creates types from the JSON schemas, keyed by the golang name.
generator.go:34
↓ 11 callersFunctionNew
New creates an instance of a generator which will produce structs.
generator.go:23
↓ 9 callersMethodID
ID returns the schema URI id.
jsonschema.go:115
↓ 8 callersFunctiongetStructNamesFromMap
(m map[string]Struct)
generator_test.go:288
↓ 7 callersMethodInsertURI
InsertURI to the references.
refresolver.go:158
↓ 7 callersFunctionParse
Parse parses a JSON schema from a string.
jsonschema.go:182
↓ 7 callersFunctiongetGolangName
getGolangName strips invalid characters out of golang struct or field names.
generator.go:328
↓ 7 callersFunctiongetOrderedFieldNames
(m map[string]Field)
output.go:11
↓ 6 callersMethodprocessSchema
returns the type refered to by schema after resolving all dependencies
generator.go:94
↓ 5 callersMethodgetSchemaName
return a name for this (sub-)schema.
generator.go:307
↓ 4 callersFunctioncontains
(s []string, e string)
generator.go:266
↓ 3 callersMethodGetRoot
GetRoot returns the root schema.
jsonschema.go:174
↓ 3 callersMethodIsRoot
IsRoot returns true when the schema is the root.
jsonschema.go:318
↓ 3 callersMethodType
Type returns the type which is permitted or an empty string if the type field is missing. The 'type' field in JSON schema also allows for a single str
jsonschema.go:130
↓ 3 callersFunctiongetOrderedStructNames
(m map[string]Struct)
output.go:22
↓ 3 callersFunctiongetPrimitiveTypeName
(schemaType string, subType string, pointer bool)
generator.go:275
↓ 3 callersFunctionlineAndCharacter
(bytes []byte, offset int)
input.go:57
↓ 2 callersFunctionParseWithSchemaKeyRequired
ParseWithSchemaKeyRequired parses a JSON schema from a string with a flag to set whether the schema key is required.
jsonschema.go:187
↓ 2 callersFunctioncapitaliseFirstLetter
(s string)
generator.go:364
↓ 1 callersMethodFixMissingTypeValue
FixMissingTypeValue is backwards compatible, guessing the users intention when they didn't specify a type.
jsonschema.go:304
↓ 1 callersMethodGetPath
GetPath generates a path to given schema.
refresolver.go:45
↓ 1 callersMethodGetSchemaByReference
GetSchemaByReference returns the schema.
refresolver.go:53
↓ 1 callersMethodMultiType
MultiType returns "type" as an array
jsonschema.go:153
↓ 1 callersFunctionNewRefResolver
NewRefResolver creates a reference resolver.
refresolver.go:18
↓ 1 callersFunctionabs
(name string)
input.go:81
↓ 1 callersFunctioncleanPackageName
(pkg string)
output.go:289
↓ 1 callersFunctionemitMarshalCode
(w io.Writer, s Struct, imports map[string]bool)
output.go:101
↓ 1 callersFunctionemitUnmarshalCode
(w io.Writer, s Struct, imports map[string]bool)
output.go:181
↓ 1 callersMethodensureSchemaKeyword
()
jsonschema.go:273
↓ 1 callersFunctiongetPath
recusively generate path to schema
refresolver.go:36
↓ 1 callersMethodmapPaths
(schema *Schema)
refresolver.go:70
↓ 1 callersFunctionoutputFieldDescriptionComment
(description string, w io.Writer)
output.go:279
↓ 1 callersFunctionoutputNameAndDescriptionComment
(name, description string, w io.Writer)
output.go:269
↓ 1 callersMethodprocessArray
name: name of this array, usually the js key schema: items element
generator.go:145
↓ 1 callersMethodprocessDefinitions
process a block of definitions
generator.go:62
↓ 1 callersMethodprocessObject
name: name of the struct (calculated by caller) schema: detail incl properties & child objects returns: generated type
generator.go:176
↓ 1 callersMethodprocessReference
process a reference string
generator.go:72
↓ 1 callersFunctionsplitOnAll
(s string, shouldSplit func(r rune) bool)
generator.go:340
↓ 1 callersMethodupdateParentLinks
()
jsonschema.go:251
↓ 1 callersMethodupdatePathElements
()
jsonschema.go:225
↓ 1 callersMethodupdateURIs
create a map of base URIs
refresolver.go:98
MethodInit
Init the resolver.
refresolver.go:25
FunctionOutput
Output generates code and writes to w.
output.go:34
FunctionReadInputFiles
ReadInputFiles from disk and convert to JSON schema.
input.go:14
FunctionTestAbandoned
(t *testing.T)
test/abandoned_test.go:8
FunctionTestApFalseNoProp
(t *testing.T)
test/additionalPropertiesMarshal_test.go:138
FunctionTestApFalseProp
(t *testing.T)
test/additionalPropertiesMarshal_test.go:179
FunctionTestApFalseReqProp
(t *testing.T)
test/additionalPropertiesMarshal_test.go:229
FunctionTestApRefNoProp
(t *testing.T)
test/additionalPropertiesMarshal_test.go:10
FunctionTestApRefProp
(t *testing.T)
test/additionalPropertiesMarshal_test.go:13
FunctionTestApRefReqProp
(t *testing.T)
test/additionalPropertiesMarshal_test.go:16
FunctionTestApTrueNoProp
(t *testing.T)
test/additionalPropertiesMarshal_test.go:21
FunctionTestApTrueProp
(t *testing.T)
test/additionalPropertiesMarshal_test.go:55
FunctionTestApTrueReqProp
(t *testing.T)
test/additionalPropertiesMarshal_test.go:91
FunctionTestArrayGeneration
(t *testing.T)
generator_test.go:330
FunctionTestEmptyNestedStructGeneration
(t *testing.T)
generator_test.go:228
FunctionTestExample1
(t *testing.T)
test/example1_test.go:9
FunctionTestFieldGeneration
(t *testing.T)
generator_test.go:45
FunctionTestFieldGenerationWithArrayReferences
(t *testing.T)
generator_test.go:113
FunctionTestLineAndCharacterFromOffset
(t *testing.T)
output_test.go:38
FunctionTestMarshalUnmarshal
(t *testing.T)
test/additionalProperties2_test.go:12
FunctionTestMultipleSchemaStructGeneration
(t *testing.T)
generator_test.go:458
FunctionTestNestedArrayGeneration
(t *testing.T)
generator_test.go:378
FunctionTestNestedStructGeneration
(t *testing.T)
generator_test.go:187
FunctionTestReturnedSchemaId
(t *testing.T)
jsonschemaparse_test.go:142
FunctionTestStructGeneration
(t *testing.T)
generator_test.go:298
FunctionTestStructNameExtractor
(t *testing.T)
generator_test.go:269
FunctionTestThatAMissingSchemaKeyResultsInAnError
(t *testing.T)
jsonschemaparse_test.go:8
FunctionTestThatArraysWithoutDefinedItemTypesAreGeneratedAsEmptyInterfaces
(t *testing.T)
generator_test.go:558
FunctionTestThatCapitalisationOccursCorrectly
(t *testing.T)
generator_test.go:10
FunctionTestThatDefaultsCanBeParsed
(t *testing.T)
jsonschemaparse_test.go:119
FunctionTestThatFieldNamesAreOrdered
(t *testing.T)
output_test.go:9
FunctionTestThatJSONCanBeRoundtrippedUsingGeneratedStructs
(t *testing.T)
cmd/schema-generate/marshal_test.go:8
FunctionTestThatJavascriptKeyNamesCanBeConvertedToValidGoNames
(t *testing.T)
generator_test.go:501
FunctionTestThatParsingInvalidValuesReturnsAnError
(t *testing.T)
jsonschemaparse_test.go:110
FunctionTestThatPropertiesCanBeParsed
(t *testing.T)
jsonschemaparse_test.go:43
FunctionTestThatPropertiesCanHaveMultipleTypes
(t *testing.T)
jsonschemaparse_test.go:84
FunctionTestThatStructNamesAreOrdered
(t *testing.T)
output_test.go:23
FunctionTestThatTheRootSchemaCanBeParsed
(t *testing.T)
jsonschemaparse_test.go:27
FunctionTestThatTypesWithMultipleDefinitionsAreGeneratedAsEmptyInterfaces
(t *testing.T)
generator_test.go:595
FunctionTestThatUnmarshallingIsPossible
(t *testing.T)
generator_test.go:629
FunctionTestTypeAliases
(t *testing.T)
generator_test.go:687
MethodUnmarshalJSON
UnmarshalJSON handles unmarshalling AdditionalProperties from JSON.
jsonschema.go:83
FunctionisNotAGoNameCharacter
(r rune)
generator.go:357
Functionmain
()
cmd/schema-generate/main.go:21