fix: emit correct enum value format for XPath vs expression contexts#167
fix: emit correct enum value format for XPath vs expression contexts#167engalar wants to merge 1 commit intomendixlabs:mainfrom
Conversation
AI Code ReviewWhat Looks Good
RecommendationThe PR is ready to approve. It correctly resolves the enum value formatting issue in both XPath and expression contexts with appropriate test coverage and minimal, focused changes that maintain backward compatibility. No issues were found against the review checklist. Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
Enum values require different serialization depending on context: - XPath (RETRIEVE WHERE): 'Value' (quoted value name only) - Expression (CHANGE/CREATE): Module.EnumName.Value (qualified) Fixes mendixlabs#125
5617638 to
9a450c2
Compare
AI Code ReviewWhat Looks GoodThe PR successfully addresses the issue described in #125 by implementing context-aware handling of enumeration references:
RecommendationApprove - The PR correctly fixes the enum value formatting issue with minimal, well-tested changes that maintain full-stack consistency. The implementation properly handles the context-dependent requirements for XPath vs expression contexts as specified in the Mendix MDL semantics. No changes are needed. Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
Summary
Module.EnumName.Valuenow emit'Value'(quoted value only) instead of the full qualified name'Processing'are resolved toModule.EnumName.Processingwhen the attribute type is an enumeration (requires MPR context)xpathExprToString)Test plan
TestQualifiedNameToXPath_EnumValue— 3-part name →'Value'TestQualifiedNameToXPath_NonEnum— 2-part name passes throughTestExpressionToXPath_EnumInComparison— full WHERE clause roundtripTestExpressionToXPath_StringLiteralPreserved— string literals unchangedTestExpressionToString_QualifiedNameUnchanged— expression context keeps qualified nameTestXPath_EnumValueReference— visitor XPath roundtrip (3 sub-tests)go test ./mdl/...passes with 0 failuresFixes #125