Shorten a json representaion allows the properties that the parser
doesn't knonw to be left unshortened. This is applicable to other
properties that the parser knows *but* don't shorten
intentionally. This is convenient some properties to be handled but
rarely seen.
if (ctx->mode == PGSP_JSON_INFLATE)
appendStringInfoSpaces(ctx->dest, ctx->level * INDENT_STEP);
+ /*
+ * We intentionally let some property names not have a short name. Use long
+ * name for the cases.
+ */
if (!p || !p->longname)
fn = fname;
- else if (ctx->mode == PGSP_JSON_INFLATE)
+ else if (ctx->mode == PGSP_JSON_INFLATE ||
+ !(p->shortname && p->shortname[0]))
fn = p->longname;
else
fn = p->shortname;