We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c448862 + e4e00c1 commit 020d72bCopy full SHA for 020d72b
src/Writer.php
@@ -20,11 +20,12 @@ class Writer
20
/**
21
* Convert OpenAPI spec object to JSON data.
22
* @param SpecObjectInterface|OpenApi $object the OpenApi object instance.
23
+ * @param int $flags json_encode() flags. Parameter available since version 1.7.0.
24
* @return string JSON string.
25
*/
- public static function writeToJson(SpecObjectInterface $object): string
26
+ public static function writeToJson(SpecObjectInterface $object, int $flags = JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE): string
27
{
- return json_encode($object->getSerializableData(), JSON_PRETTY_PRINT);
28
+ return json_encode($object->getSerializableData(), $flags);
29
}
30
31
0 commit comments