{"modulePath":"github.com/plheide/aapi-codegen","version":"v0.13.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package schema\n\nPackage schema models the slice of JSON Schema 2020-12 that the compat-shim emitter cares about. Most of JSON Schema is irrelevant for shim emission — we only need the type, properties, required list, and $defs of every object. Anything else (numeric ranges, format, patternProperties, …) is left to go-jsonschema.\n\n## Types\n\n```go\ntype Schema struct {\n\t// ID corresponds to the JSON Schema `$id` keyword. Used as the match\n\t// key for cross-tree package mappings (plan §6 schema-packages): when\n\t// a schema's $id matches an entry in Configuration.SchemaPackages,\n\t// its types live in another Go package and the compat-shim emitter\n\t// must skip them (Go forbids methods on imported types).\n\tID         string             `json:\"$id\"`\n\tTitle      string             `json:\"title\"`\n\tType       string             `json:\"type\"`\n\tRequired   []string           `json:\"required\"`\n\tProperties map[string]any     `json:\"properties\"`\n\tDefs       map[string]*Schema `json:\"$defs\"`\n\t// Ref is the schema's own `$ref`. go-jsonschema generates the type of\n\t// the schema it points at, not one named after Title.\n\tRef string `json:\"$ref\"`\n\t// SourcePath is the absolute path the schema was loaded from. Used\n\t// only for error messages.\n\tSourcePath string `json:\"-\"`\n}\n```\nSchema is the typed representation of a JSON Schema file. Fields not needed for shim emission are intentionally omitted; unknown properties in the input are dropped during decoding.\n\n```go\nfunc Load(path string) (*Schema, error)\n```\nLoad parses a JSON Schema file from disk.\n\n```go\nfunc (s *Schema) IsObject() bool\n```\nIsObject reports whether the schema describes a JSON object with named properties.\n\n","path":"github.com/plheide/aapi-codegen/pkg/codegen/schema","name":"schema","synopsis":"Package schema models the slice of JSON Schema 2020-12 that the compat-shim emitter cares about.","isRedistributable":true}
