@@ -1416,6 +1416,19 @@ LuaLDContextPrivateAttributes(lua_State *const l)
14161416 return 1 ;
14171417}
14181418
1419+ /**
1420+ EvaluationDetail contains extra information related to evaluation of a flag.
1421+
1422+ @field kind string, one of: "OFF","FALLTHROUGH", "TARGET_MATCH", "RULE_MATCH",
1423+ "PREREQUISITE_FAILED", "ERROR", "UNKNOWN".
1424+ @field errorKind string, only present if 'kind' is "ERROR"; one of: "CLIENT_NOT_READY",
1425+ "FLAG_NOT_FOUND", "USER_NOT_SPECIFIED", "MALFORMED_FLAG", "WRONG_TYPE",
1426+ "MALFORMED_FLAG", "EXCEPTION", "UNKNOWN".
1427+ @field inExperiment bool, whether the flag was part of an experiment.
1428+ @field variationIndex int, only present if the evaluation was successful. The zero-based index of the variation.
1429+ @field value LDJSON, the value of the flag.
1430+ @table EvaluationDetail
1431+ */
14191432
14201433/**
14211434Evaluate a boolean flag
@@ -1459,7 +1472,7 @@ Evaluate a boolean flag and return an explanation
14591472@tparam context context An opaque context object from @{makeUser} or @{makeContext}
14601473@tparam string key The key of the flag to evaluate.
14611474@tparam boolean fallback The value to return on error
1462- @treturn table The evaluation explanation
1475+ @return @{EvaluationDetail}
14631476*/
14641477static int
14651478LuaLDClientBoolVariationDetail (lua_State * const l )
@@ -1523,7 +1536,7 @@ Evaluate an integer flag and return an explanation
15231536@tparam context context An opaque context object from @{makeUser} or @{makeContext}
15241537@tparam string key The key of the flag to evaluate.
15251538@tparam int fallback The value to return on error
1526- @treturn table The evaluation explanation
1539+ @return @{EvaluationDetail}
15271540*/
15281541static int
15291542LuaLDClientIntVariationDetail (lua_State * const l )
@@ -1587,7 +1600,7 @@ Evaluate a double flag and return an explanation
15871600@tparam context context An opaque context object from @{makeUser} or @{makeContext}
15881601@tparam string key The key of the flag to evaluate.
15891602@tparam number fallback The value to return on error
1590- @treturn table The evaluation explanation
1603+ @return @{EvaluationDetail}
15911604*/
15921605static int
15931606LuaLDClientDoubleVariationDetail (lua_State * const l )
@@ -1654,7 +1667,7 @@ Evaluate a string flag and return an explanation
16541667@tparam context context An opaque context object from @{makeUser} or @{makeContext}
16551668@tparam string key The key of the flag to evaluate.
16561669@tparam string fallback The value to return on error
1657- @treturn table The evaluation explanation
1670+ @return @{EvaluationDetail}
16581671*/
16591672static int
16601673LuaLDClientStringVariationDetail (lua_State * const l )
@@ -1724,7 +1737,7 @@ Evaluate a json flag and return an explanation
17241737@tparam context context An opaque context object from @{makeUser} or @{makeContext}
17251738@tparam string key The key of the flag to evaluate.
17261739@tparam table fallback The value to return on error
1727- @treturn table The evaluation explanation
1740+ @return @{EvaluationDetail}
17281741*/
17291742static int
17301743LuaLDClientJSONVariationDetail (lua_State * const l )
0 commit comments