From 31ce885bd8a16bdc4b5795a29d0219d329fdbd38 Mon Sep 17 00:00:00 2001 From: Andrey Subbota Date: Thu, 4 Jul 2024 16:10:21 +0200 Subject: [PATCH] Fix the full_path for the lateral scope --- lib/grape/validations/params_scope.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/grape/validations/params_scope.rb b/lib/grape/validations/params_scope.rb index ef8d3ec1b7..2f5a2b85b8 100644 --- a/lib/grape/validations/params_scope.rb +++ b/lib/grape/validations/params_scope.rb @@ -190,7 +190,10 @@ def push_declared_params(attrs, **opts) # # @return [Array] the nesting/path of the current parameter scope def full_path - nested? ? @parent.full_path + [@element] : [] + return (@parent.full_path + [@element]) if nested? + return @parent.full_path if lateral? + + [] end private