Commit 4ec1b9e5 authored by Botond Baranyi's avatar Botond Baranyi

Minor changes to the JSON default upgrade (issue #547)

Signed-off-by: Botond Baranyi's avatarBotond Baranyi <botond.baranyi@ericsson.com>
parent 7c187762
......@@ -3833,6 +3833,8 @@ void Type::generate_json_schema(JSON_Tokenizer& json, bool embedded, bool as_val
}
// insert default value (if any)
// todo: this prints a TTCN-3 value's string representation in case it's a standard-compliant
// default attribute, and not a legacy one...
if (jsonattrib != NULL && jsonattrib->default_value.str != NULL) {
json.put_next_token(JSON_TOKEN_NAME, "default");
switch (last->typetype) {
......
......@@ -86,7 +86,7 @@ typedef struct {
boolean jsonOmitAsNull;
boolean jsonMetainfoUnbound;
const char* jsonAlias;
const char* jsonDefaultValue;
const char* jsonDefaultValue; // legacy default value
rawAST_coding_taglist_list* jsonChosen;
/** true if the field is a record-of or set-of with optimized memory allocation */
boolean optimizedMemAlloc;
......
......@@ -62,6 +62,7 @@ JsonAST::JsonAST(const JsonAST *other_val)
default_value.type = other_val->default_value.type;
default_value.str = (NULL != other_val->default_value.str) ? mcopystr(other_val->default_value.str) : NULL;
default_value.val = (NULL != other_val->default_value.val) ? other_val->default_value.val->clone() : NULL;
default_value.loc = (NULL != other_val->default_value.loc) ? new Common::Location(*other_val->default_value.loc) : NULL;
as_number = other_val->as_number;
for (size_t i = 0; i < other_val->schema_extensions.size(); ++i) {
schema_extensions.add(new JsonSchemaExtension(*other_val->schema_extensions[i]));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment