From ba2bf09902a4a6475abb27af8f0a90b35600a728 Mon Sep 17 00:00:00 2001 From: SimonCockx <47859223+SimonCockx@users.noreply.github.com> Date: Wed, 31 Jul 2024 16:44:45 +0200 Subject: [PATCH] Fixed metadata on choice options (#801) --- .../src/main/java/com/regnosys/rosetta/Rosetta.xtext | 2 ++ .../generator/java/function/FunctionGeneratorTest.xtend | 9 +++------ .../rosetta/validation/RosettaValidatorTest.xtend | 9 +++------ 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/rosetta-lang/src/main/java/com/regnosys/rosetta/Rosetta.xtext b/rosetta-lang/src/main/java/com/regnosys/rosetta/Rosetta.xtext index da47f984a..65cae4193 100644 --- a/rosetta-lang/src/main/java/com/regnosys/rosetta/Rosetta.xtext +++ b/rosetta-lang/src/main/java/com/regnosys/rosetta/Rosetta.xtext @@ -89,6 +89,8 @@ Choice: ChoiceOption: RosettaTyped RosettaDefinable? + (References|Annotations|Synonyms)* + RuleReference? ; Attribute: diff --git a/rosetta-testing/src/test/java/com/regnosys/rosetta/generator/java/function/FunctionGeneratorTest.xtend b/rosetta-testing/src/test/java/com/regnosys/rosetta/generator/java/function/FunctionGeneratorTest.xtend index 617164dac..7eb321388 100644 --- a/rosetta-testing/src/test/java/com/regnosys/rosetta/generator/java/function/FunctionGeneratorTest.xtend +++ b/rosetta-testing/src/test/java/com/regnosys/rosetta/generator/java/function/FunctionGeneratorTest.xtend @@ -153,14 +153,11 @@ class FunctionGeneratorTest { @Test def void testDeepPathOperatorWithMeta() { val code = ''' - type A: - b B (0..1) + choice A: + B [metadata reference] - c C (0..1) + C [metadata reference] - - condition Choice: - one-of type B: [metadata key] diff --git a/rosetta-testing/src/test/java/com/regnosys/rosetta/validation/RosettaValidatorTest.xtend b/rosetta-testing/src/test/java/com/regnosys/rosetta/validation/RosettaValidatorTest.xtend index ee3912003..72b10ee25 100644 --- a/rosetta-testing/src/test/java/com/regnosys/rosetta/validation/RosettaValidatorTest.xtend +++ b/rosetta-testing/src/test/java/com/regnosys/rosetta/validation/RosettaValidatorTest.xtend @@ -59,14 +59,11 @@ class RosettaValidatorTest implements RosettaIssueCodes { @Test def void testCanAccessMetaFeatureAfterDeepFeatureCall() { val context = ''' - type A: - b B (0..1) + choice A: + B [metadata reference] - c C (0..1) + C [metadata reference] - - condition Choice: - one-of type B: [metadata key]