You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The project i am working is a multi module one, there are fields in a proto for which i am trying to validations that has fields imported from the common module.
The project structure is as given below
└── common
└── src
└── main
└── java
└── com
└── iambharaths
└── common
└── pax.proto
└── offer
└── src
└── main
└── java
└── com
└── iambharaths
└── offer
└── shopping_rq.proto
The structure of the shopping_rq.proto file is as given below for which the above error is being thrown.
When trying to validate the ShoppingRQ message using the validator.validate() method i keep getting this error
build.buf.protovalidate.exceptions.CompilationException: Failed to compile expression at_least_one_adt_pax:
ERROR: :1:53: [internal] unexpected failed resolution of 'iambharaths.common.Pax'
Expected Behavior
The validation should be successful without any CompilationException being thrown.
Actual Behavior
The message validation fails with build.buf.protovalidate.exceptions.CompilationException being thrown.
Screenshots/Logs
build.buf.protovalidate.exceptions.CompilationException: Failed to compile expression at_least_one_adt_pax:
ERROR: <input>:1:53: [internal] unexpected failed resolution of 'iambharaths.common.Pax'
| this.passengers.exists(paxId, this.passengers[paxId].ptc == 1)
| ....................................................^
at build.buf.protovalidate.internal.expression.AstExpression.newAstExpression(AstExpression.java:49)
at build.buf.protovalidate.internal.evaluator.EvaluatorBuilder$DescriptorCacheBuilder.compileConstraints(EvaluatorBuilder.java:525)
at build.buf.protovalidate.internal.evaluator.EvaluatorBuilder$DescriptorCacheBuilder.processMessageExpressions(EvaluatorBuilder.java:200)
at build.buf.protovalidate.internal.evaluator.EvaluatorBuilder$DescriptorCacheBuilder.buildMessage(EvaluatorBuilder.java:176)
at build.buf.protovalidate.internal.evaluator.EvaluatorBuilder$DescriptorCacheBuilder.createMessageEvaluator(EvaluatorBuilder.java:159)
at build.buf.protovalidate.internal.evaluator.EvaluatorBuilder$DescriptorCacheBuilder.build(EvaluatorBuilder.java:148)
at build.buf.protovalidate.internal.evaluator.EvaluatorBuilder.build(EvaluatorBuilder.java:112)
at build.buf.protovalidate.internal.evaluator.EvaluatorBuilder.load(EvaluatorBuilder.java:91)
at build.buf.protovalidate.Validator.validate(Validator.java:76)
at com.github.iambharaths.offermanagement.validation.RequestValidator.validateRequest(RequestValidator.java:21)
at com.github.iambharaths.offermanagement.api.OfferManagementV4Api.shop(OfferManagementV4Api.java:55)
at com.github.iambharaths.offermanagement.api.OfferManagementV4Api$$FastClassBySpringCGLIB$$3a57c4dd.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:783)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
at org.springframework.aop.aspectj.AspectJAfterAdvice.invoke(AspectJAfterAdvice.java:49)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:58)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:698)
at com.github.iambharaths.offermanagement.api.OfferManagementV4Api$$EnhancerBySpringCGLIB$$58b63b3a.shop(<generated>)
at com.github.iambharaths.offer.OfferManagementServiceGrpc$MethodHandlers.invoke(OfferManagementServiceGrpc.java:1044)
at io.grpc.stub.ServerCalls$UnaryServerCallHandler$UnaryServerCallListener.onHalfClose(ServerCalls.java:182)
at io.grpc.PartialForwardingServerCallListener.onHalfClose(PartialForwardingServerCallListener.java:35)
at io.grpc.ForwardingServerCallListener.onHalfClose(ForwardingServerCallListener.java:23)
at io.grpc.ForwardingServerCallListener$SimpleForwardingServerCallListener.onHalfClose(ForwardingServerCallListener.java:40)
at io.grpc.Contexts$ContextualizedServerCallListener.onHalfClose(Contexts.java:86)
at io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.halfClosed(ServerCallImpl.java:351)
at io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed.runInContext(ServerImpl.java:861)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
Environment
Operating System: macOS
Version: macOS 14.4
Protobuf Compiler & Version: protoc 3.24.4
Protovalidate Version: v0.2.0
The text was updated successfully, but these errors were encountered:
iambharaths
changed the title
[BUG] Expression compilation failure when for expressions involving fields which are imported from proto files in different module
[BUG] Expression compilation failure for expressions involving fields which are imported from proto files in different module
Mar 26, 2024
Description
The project i am working is a multi module one, there are fields in a proto for which i am trying to validations that has fields imported from the common module.
The project structure is as given below
The structure of the shopping_rq.proto file is as given below for which the above error is being thrown.
When trying to validate the ShoppingRQ message using the validator.validate() method i keep getting this error
Expected Behavior
The validation should be successful without any CompilationException being thrown.
Actual Behavior
The message validation fails with build.buf.protovalidate.exceptions.CompilationException being thrown.
Screenshots/Logs
Environment
The text was updated successfully, but these errors were encountered: