@@ -18,7 +18,7 @@ import (
1818 descriptor "google.golang.org/protobuf/types/descriptorpb"
1919 plugin "google.golang.org/protobuf/types/pluginpb"
2020
21- "github.com/chrusty/protoc-gen-jsonschema/internal/protos "
21+ protoc_gen_jsonschema "github.com/chrusty/protoc-gen-jsonschema"
2222)
2323
2424const (
@@ -146,9 +146,9 @@ func (c *Converter) convertEnumType(enum *descriptor.EnumDescriptorProto, conver
146146 converterFlags .EnumsAsStringsOnly = c .Flags .EnumsAsStringsOnly
147147
148148 // Set some per-enum flags from config and options:
149- if opts := enum .GetOptions (); opts != nil && proto .HasExtension (opts , protos .E_EnumOptions ) {
150- if opt := proto .GetExtension (opts , protos .E_EnumOptions ); opt != nil {
151- if enumOptions , ok := opt .(* protos .EnumOptions ); ok {
149+ if opts := enum .GetOptions (); opts != nil && proto .HasExtension (opts , protoc_gen_jsonschema .E_EnumOptions ) {
150+ if opt := proto .GetExtension (opts , protoc_gen_jsonschema .E_EnumOptions ); opt != nil {
151+ if enumOptions , ok := opt .(* protoc_gen_jsonschema .EnumOptions ); ok {
152152
153153 // ENUMs as constants:
154154 if enumOptions .GetEnumsAsConstants () {
@@ -301,9 +301,9 @@ func (c *Converter) convertFile(file *descriptor.FileDescriptorProto, fileExtens
301301 for _ , msgDesc := range file .GetMessageType () {
302302
303303 // Check for our custom message options:
304- if opts := msgDesc .GetOptions (); opts != nil && proto .HasExtension (opts , protos .E_MessageOptions ) {
305- if opt := proto .GetExtension (opts , protos .E_MessageOptions ); opt != nil {
306- if messageOptions , ok := opt .(* protos .MessageOptions ); ok {
304+ if opts := msgDesc .GetOptions (); opts != nil && proto .HasExtension (opts , protoc_gen_jsonschema .E_MessageOptions ) {
305+ if opt := proto .GetExtension (opts , protoc_gen_jsonschema .E_MessageOptions ); opt != nil {
306+ if messageOptions , ok := opt .(* protoc_gen_jsonschema .MessageOptions ); ok {
307307
308308 // "Ignored" messages are simply skipped:
309309 if messageOptions .GetIgnore () {
@@ -372,9 +372,9 @@ func (c *Converter) convert(request *plugin.CodeGeneratorRequest) (*plugin.CodeG
372372 fileExtension := c .schemaFileExtension
373373
374374 // Check for our custom file options:
375- if opts := fileDesc .GetOptions (); opts != nil && proto .HasExtension (opts , protos .E_FileOptions ) {
376- if opt := proto .GetExtension (opts , protos .E_FileOptions ); opt != nil {
377- if fileOptions , ok := opt .(* protos .FileOptions ); ok {
375+ if opts := fileDesc .GetOptions (); opts != nil && proto .HasExtension (opts , protoc_gen_jsonschema .E_FileOptions ) {
376+ if opt := proto .GetExtension (opts , protoc_gen_jsonschema .E_FileOptions ); opt != nil {
377+ if fileOptions , ok := opt .(* protoc_gen_jsonschema .FileOptions ); ok {
378378
379379 // "Ignored" files are simply skipped:
380380 if fileOptions .GetIgnore () {
0 commit comments