Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Writer.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ class Writer
/**
* Convert OpenAPI spec object to JSON data.
* @param SpecObjectInterface|OpenApi $object the OpenApi object instance.
* @param int $flags json_encode() flags
* @return string JSON string.
*/
public static function writeToJson(SpecObjectInterface $object): string
public static function writeToJson(SpecObjectInterface $object, int $flags = JSON_PRETTY_PRINT): string
{
return json_encode($object->getSerializableData(), JSON_PRETTY_PRINT);
return json_encode($object->getSerializableData(), $flags);
}

/**
Expand Down