@Override
    public Void objectNode(ObjectNode node) {
        try {
            // Simple optimization for empty objects.
            if (node.isEmpty()) {
                writer.writeLiteral("{}");
                return null;
            }

            writer.writeObjectOpen();
            Iterator<Map.Entry<StringNode, Node>> iterator = node.getMembers().entrySet().iterator();
            while (iterator.hasNext()) {
                Map.Entry<StringNode, Node> entry = iterator.next();
                writer.writeMemberName(entry.getKey().getValue());
                writer.writeMemberSeparator();
                entry.getValue().accept(this);
                if (iterator.hasNext()) {
                    writer.writeObjectSeparator();
                }
            }
            writer.writeObjectClose();
            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