converter

package
v0.0.99 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Converter

type Converter struct {
	Flags ConverterFlags
	// contains filtered or unexported fields
}

Converter is everything you need to convert protos to JSONSchemas:

func New

func New(logger *logrus.Logger) *Converter

New returns a configured *Converter (defaulting to draft-04 version):

func (*Converter) ConvertFrom

func (c *Converter) ConvertFrom(rd io.Reader) (*plugin.CodeGeneratorResponse, error)

ConvertFrom tells the convert to work on the given input:

type ConverterFlags

type ConverterFlags struct {
	AllFieldsRequired            bool
	AllowNullValues              bool
	DisallowAdditionalProperties bool
	DisallowBigIntsAsStrings     bool
	EnforceOneOf                 bool
	EnforceExclusiveGroups       bool
	EnforceOneofDeclarations     bool
	EnumsAsConstants             bool
	EnumsAsStringsOnly           bool
	EnumsTrimPrefix              bool
	KeepNewLinesInDescription    bool
	PrefixSchemaFilesWithPackage bool
	UseJSONFieldnamesOnly        bool
	UseProtoAndJSONFieldNames    bool
}

ConverterFlags control the behaviour of the converter:

type ProtoPackage

type ProtoPackage struct {
	// contains filtered or unexported fields
}

ProtoPackage describes a package of Protobuf, which is an container of message types.

Directories

Path Synopsis
Package jsonschema uses reflection to generate JSON Schemas from Go types [1].
Package jsonschema uses reflection to generate JSON Schemas from Go types [1].

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL