[#BloombergLP-baljsn-Formatter-openArray]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/baljsn.adoc[baljsn]::xref:BloombergLP/baljsn/Formatter.adoc[Formatter]::openArray
:relfileprefix: ../../../
:mrdocs:

Print the characters that start a JSON array onto the output stream&period;

== Synopsis

Declared in `&lt;baljsn&lowbar;formatter&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
openArray(bool formatAsEmptyArray = false);
----

== Description

Print onto the stream supplied at construction the sequence of characters designating the start of an array (referred to as an &quot;array&quot; in JSON)&period; Optionally specify `formatAsEmptyArray` denoting if the array being opened should be formatted as an empty array&period; If `formatAsEmptyArray` is not specified then the array being opened is formatted as an array having elements&period; Note that the formatting (and as a consequence the `formatAsEmptyArray`) is relevant only if this formatter encodes in the pretty style and is ignored otherwise&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *formatAsEmptyArray*
| whether to format the array as empty
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
