protovalidate-java icon indicating copy to clipboard operation
protovalidate-java copied to clipboard

[BUG] Config.disableLazy isn't functional as written

Open pkwarren opened this issue 9 months ago • 1 comments

Description

The current implementation of Config.disableLazy isn't functional. In addition to specifying disableLazy = true, a user also needs to provide the initial set of messages/descriptors to use to initialize the cache.

Steps to Reproduce

Pass a Config to Validator with disableLazy = true. Attempt to validate a message - nothing will work because it assumes the supported messages are already cached.

Expected Behavior

The Config object should support passing the initial set of messages or descriptors to use to seed the cache with disableLazy = true.

Actual Behavior

The disableLazy = true config option isn't usable.

Screenshots/Logs

n/a

Environment

  • Operating System: macOS
  • Version: 14.0
  • Compiler/Toolchain: Java 17
  • Protobuf Compiler & Version: protoc 24.4
  • Protoc-gen-validate Version: n/a
  • Protovalidate Version: 0.1.6

Possible Solution

Pass a list of messages/descriptors in the Config object to allow initializing the cache prior to use with disableLazy = true.

Additional Context

n/a

pkwarren avatar Oct 16 '23 23:10 pkwarren