protoc_gen_jsonschema

package module
v0.0.0-...-f95d431 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

README

protoc-gen-jsonschema

A protoc plugin to generate JSON schema files from protobuf definitions.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// optional protoc.gen.jsonschema.FieldOptions field_options = 1125;
	E_FieldOptions = &file_options_proto_extTypes[0]
)

Extension fields to descriptorpb.FieldOptions.

View Source
var (
	// optional protoc.gen.jsonschema.MessageOptions message_options = 1127;
	E_MessageOptions = &file_options_proto_extTypes[1]
)

Extension fields to descriptorpb.MessageOptions.

View Source
var File_options_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type FieldOptions

type FieldOptions struct {

	// Fields tagged with this will be omitted from generated schemas
	Ignore bool `protobuf:"varint,1,opt,name=ignore,proto3" json:"ignore,omitempty"`
	// Fields tagged with this will be marked as "required" in generated schemas
	Required bool `protobuf:"varint,2,opt,name=required,proto3" json:"required,omitempty"`
	// Fields tagged with this will constrain strings using the "minLength" keyword in generated schemas
	MinLength int32 `protobuf:"varint,3,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"`
	// Fields tagged with this will constrain strings using the "maxLength" keyword in generated schemas
	MaxLength int32 `protobuf:"varint,4,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"`
	// Fields tagged with this will constrain strings using the "pattern" keyword in generated schemas
	Pattern string `protobuf:"bytes,5,opt,name=pattern,proto3" json:"pattern,omitempty"`
	// Fields tagged with this will set the ref field to the given value
	Ref string `protobuf:"bytes,6,opt,name=ref,proto3" json:"ref,omitempty"`
	// Fields tagged with this will constrain arrays using the "minItems" keyword in generated schemas
	MinItems int32 `protobuf:"varint,7,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"`
	// Fields tagged with this will constrain strings using the "format" keyword in generated schemas
	Format string `protobuf:"bytes,8,opt,name=format,proto3" json:"format,omitempty"`
	// contains filtered or unexported fields
}

Custom FieldOptions

func (*FieldOptions) Descriptor deprecated

func (*FieldOptions) Descriptor() ([]byte, []int)

Deprecated: Use FieldOptions.ProtoReflect.Descriptor instead.

func (*FieldOptions) GetFormat

func (x *FieldOptions) GetFormat() string

func (*FieldOptions) GetIgnore

func (x *FieldOptions) GetIgnore() bool

func (*FieldOptions) GetMaxLength

func (x *FieldOptions) GetMaxLength() int32

func (*FieldOptions) GetMinItems

func (x *FieldOptions) GetMinItems() int32

func (*FieldOptions) GetMinLength

func (x *FieldOptions) GetMinLength() int32

func (*FieldOptions) GetPattern

func (x *FieldOptions) GetPattern() string

func (*FieldOptions) GetRef

func (x *FieldOptions) GetRef() string

func (*FieldOptions) GetRequired

func (x *FieldOptions) GetRequired() bool

func (*FieldOptions) ProtoMessage

func (*FieldOptions) ProtoMessage()

func (*FieldOptions) ProtoReflect

func (x *FieldOptions) ProtoReflect() protoreflect.Message

func (*FieldOptions) Reset

func (x *FieldOptions) Reset()

func (*FieldOptions) String

func (x *FieldOptions) String() string

type MessageOptions

type MessageOptions struct {

	// Messages tagged with this will not be processed
	Ignore bool `protobuf:"varint,1,opt,name=ignore,proto3" json:"ignore,omitempty"`
	// Messages tagged with this will have all fields marked as "required":
	AllFieldsRequired bool `protobuf:"varint,2,opt,name=all_fields_required,json=allFieldsRequired,proto3" json:"all_fields_required,omitempty"`
	// Messages tagged with this will populate the id field with provided value. Default value is filename with json extension
	Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

Custom MessageOptions

func (*MessageOptions) Descriptor deprecated

func (*MessageOptions) Descriptor() ([]byte, []int)

Deprecated: Use MessageOptions.ProtoReflect.Descriptor instead.

func (*MessageOptions) GetAllFieldsRequired

func (x *MessageOptions) GetAllFieldsRequired() bool

func (*MessageOptions) GetId

func (x *MessageOptions) GetId() string

func (*MessageOptions) GetIgnore

func (x *MessageOptions) GetIgnore() bool

func (*MessageOptions) ProtoMessage

func (*MessageOptions) ProtoMessage()

func (*MessageOptions) ProtoReflect

func (x *MessageOptions) ProtoReflect() protoreflect.Message

func (*MessageOptions) Reset

func (x *MessageOptions) Reset()

func (*MessageOptions) String

func (x *MessageOptions) String() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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