Skip to content

Commit 61e5f59

Browse files
committed
Update protovalidate-go API usage
1 parent e650d84 commit 61e5f59

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

internal/protoschema/jsonschema/jsonschema.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"unicode"
2222

2323
"buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate"
24-
"github.com/bufbuild/protovalidate-go/resolver"
24+
"github.com/bufbuild/protovalidate-go/resolve"
2525
"google.golang.org/protobuf/reflect/protoreflect"
2626
)
2727

@@ -70,7 +70,6 @@ type jsonSchemaGenerator struct {
7070
schema map[protoreflect.FullName]map[string]interface{}
7171
custom map[protoreflect.FullName]func(protoreflect.MessageDescriptor, *validate.FieldConstraints, map[string]interface{})
7272
useJSONNames bool
73-
resolver resolver.DefaultResolver
7473
}
7574

7675
func (p *jsonSchemaGenerator) getID(desc protoreflect.Descriptor) string {
@@ -214,7 +213,7 @@ func (p *jsonSchemaGenerator) generateValidation(field protoreflect.FieldDescrip
214213
}
215214

216215
func (p *jsonSchemaGenerator) getFieldConstraints(field protoreflect.FieldDescriptor) *validate.FieldConstraints {
217-
constraints := p.resolver.ResolveFieldConstraints(field)
216+
constraints := resolve.FieldConstraints(field)
218217
if constraints == nil || constraints.GetIgnore() == validate.Ignore_IGNORE_ALWAYS {
219218
return nil
220219
}

0 commit comments

Comments
 (0)