Documentation
¶
Overview ¶
Example (BasicSchema) ¶
package main import ( "fmt" "log" "github.com/cloudquery/codegen/jsonschema" ) func main() { type basic struct { A string `json:"a" jsonschema:"minLength=2,required"` } data, err := jsonschema.Generate(new(basic)) if err != nil { log.Fatal(err) } fmt.Println(string(data)) }
Output: { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://github.com/cloudquery/codegen/jsonschema_test/basic", "$ref": "#/$defs/basic", "$defs": { "basic": { "properties": { "a": { "type": "string", "minLength": 2 } }, "additionalProperties": false, "type": "object", "required": [ "a" ] } } }
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.