@Override
    public Void arrayNode(ArrayNode node) {
        try {
            // Simple optimization for empty arrays.
            if (node.isEmpty()) {
                writer.writeLiteral("[]");
                return null;
            }

            writer.writeArrayOpen();
            Iterator<Node> iterator = node.getElements().iterator();
            while (iterator.hasNext()) {
                iterator.next().accept(this);
                if (iterator.hasNext()) {
                    writer.writeArraySeparator();
                }
            }
            writer.writeArrayClose();
            return null;
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
Serializes {@link Node} objects to JSON.
smithy-model/src/main/java/software/amazon/smithy/model/node/internal/NodeWriter.java