3f06ffc10df40e72dfa18a150eeca23fda6b41df angie Thu Feb 8 13:42:04 2018 -0800 annoStreamDbPslPlus internally used a json config to join in CDS and sequence with the underlying PSL -- so annoStreamDbPslPlusNew did not accept an incoming config, so hgVai's RefSeq Status option was ignored. Add jsonObjectMerge so that the config from hgVai can be merged with the internal config, and make sure that the extra columns from the internal annoStreamDb are added to annoStreamDbPslPlusNew's asObj. We can't just use the internal annoStreamDb's asObj because the field names for CDS etc. fields would differ for refSeqAli vs ncbiRefSeq and column-matching to recognize annoStreamDbPslPlus would fail. refs #20948 diff --git src/inc/jsonParse.h src/inc/jsonParse.h index ae6acd9..2af3706 100644 --- src/inc/jsonParse.h +++ src/inc/jsonParse.h @@ -39,30 +39,36 @@ }; // constructors for each jsonElementType struct jsonElement *newJsonString(char *str); struct jsonElement *newJsonBoolean(boolean val); struct jsonElement *newJsonNumber(long val); struct jsonElement *newJsonDouble(double val); struct jsonElement *newJsonObject(struct hash *h); struct jsonElement *newJsonList(struct slRef *list); struct jsonElement *newJsonNull(); void jsonObjectAdd(struct jsonElement *h, char *name, struct jsonElement *ele); // Add a new element to a jsonObject; existing values are replaced. +void jsonObjectMerge(struct jsonElement *objA, struct jsonElement *objB); +/* Recursively merge fields of objB into objA. If objA and objB each have a list child with + * the same key then concatenate the lists. If objA and objB each have an object child with + * the same key then merge the object children. If objA and objB each have a child of some + * other type then objB's child replaces objA's child. */ + void jsonListAdd(struct jsonElement *list, struct jsonElement *ele); // Add a new element to a jsonList struct jsonElement *jsonParse(char *str); // parse string into an in-memory json representation char *jsonStringEscape(char *inString); /* backslash escape a string for use in a double quoted json string. * More conservative than javaScriptLiteralEncode because * some json parsers complain if you escape & or ' */ void jsonFindNameRecurse(struct jsonElement *ele, char *jName, struct slName **pList); // Search the JSON tree recursively to find all the values associated to // the name, and add them to head of the list.