Converters
Generate Go types from a JSON Schema or from JSON.
Two commands generate Go types for you.
From a JSON Schema
go.convert.jsonSchema runs go-jsonschema on the JSON Schema you have open
and opens the generated Go.
:CocCommand go.convert.jsonSchemaSchemas that use the date or date-time formats make the generated code
import github.com/atombender/go-jsonschema/pkg/types.
This command needs the go-jsonschema tool:
:CocCommand go.tools.install.go-jsonschemaFrom JSON
go.convert.jsonToGo opens a scratch JSON buffer and a scratch Go buffer side
by side, and regenerates the Go types as you type.
:CocCommand go.convert.jsonToGoThe JSON can start from the clipboard, from a file, or from an empty buffer.
The output matches the defaults of
mholt/json-to-go and needs no extra
tool.