17 nlohmann::ordered_json jsonObject;
19 jsonObject[
"event"] =
"choice";
24 jsonObject[
"choices"] = nlohmann::ordered_json();
26 for (
size_t i = 0; i < extensionElements->choices.size(); i++) {
27 auto attribute = extensionElements->choices[i]->attribute;
28 if ( !
choices[i].has_value() ) {
29 jsonObject[
"choices"][attribute->name] = nullptr ;
31 else if ( attribute->type ==
BOOLEAN) {
32 bool value = (bool)
choices[i].value();
33 jsonObject[
"choices"][attribute->name] = value ;
35 else if ( attribute->type ==
INTEGER) {
36 int value = (int)
choices[i].value();
37 jsonObject[
"choices"][attribute->name] = value ;
39 else if ( attribute->type ==
DECIMAL) {
40 double value = (double)
choices[i].value();
41 jsonObject[
"choices"][attribute->name] = value ;
43 else if ( attribute->type ==
STRING) {
45 jsonObject[
"choices"][attribute->name] = value ;
49 jsonObject[
"choices"][attribute->name] = value ;