Sign in Join
FPDoc Onlineexperiment

TJSONObject.UnquotedMemberNames property

Member of TJSONObjectpublicIn unit fpJson

Should member names be written unquoted or quoted in JSON.

Declaration

pascal
property UnquotedMemberNames: Boolean read GetUnquotedMemberNames write SetUnquotedMemberNames;

Description

UnquotedMemberNames can be set to let AsJSON write the member names of a JSON object without quotes ( True) or with quotes ( False) around the member names.

When the value is False, JSON is written as:

{
  "name" : "Free Pascal",
  "type" : "Compiler"
}

When the value is True, JSON is written as:

{
  name : "Free Pascal",
  type : "Compiler"
}

Care must be taken when setting this property: The JSON standard requires the quotes to be written, but since JSON is mostly consumed in a Javascipt engine, the unquoted values are usually also accepted.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.