Skip to content

Commit

Permalink
Fixing bug in schema generation code
Browse files Browse the repository at this point in the history
Fixing a bug in schema generation code which gets exposed if a tag is
specified after __value.
Also, cli_name should not have any newline character in it. If it does, we
pick first line only

Change-Id: I577f767a0a2941bb993cbae1e84a6ff58d3ff93f
Closes-Bug: #1638469
(cherry picked from commit a276fd4)
  • Loading branch information
bansalnikhil committed Nov 2, 2016
1 parent b55b1a2 commit 0be0086
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compiler/generate/t_doc_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1213,6 +1213,7 @@ void t_doc_generator::generate_stat_schema_map(string prefix, t_type* keytype, t
}
}
f_stats_tables_ << "\t{\"name\":\"" << name << "\",\"datatype\":\"" << datatype << "\",\"index\":" << index << "}";
first_member_ = false;
}

string empty_prefix;
Expand Down Expand Up @@ -1446,7 +1447,8 @@ string t_doc_generator::get_display_name_from_comments(t_field* tfield){
string attr_name = f.substr(0, lindex);
boost::trim(attr_name);
if(attr_name == "display_name") {
display_name = f.substr(lindex+1);
string dn = f.substr(lindex+1);
display_name = dn.substr(0, dn.find_first_of('\n'));
boost::trim(display_name);
return display_name;
}
Expand Down

0 comments on commit 0be0086

Please sign in to comment.