From 7d9977c32c2d5df39333ea50f301cb46b285250d Mon Sep 17 00:00:00 2001 From: provokateurin Date: Tue, 4 Jun 2024 07:08:39 +0200 Subject: [PATCH] fix: Add final newlines to generated specs Signed-off-by: provokateurin --- generate-spec | 2 +- merge-specs | 2 +- tests/openapi-administration.json | 2 +- tests/openapi-federation.json | 2 +- tests/openapi-full.json | 2 +- tests/openapi.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/generate-spec b/generate-spec index 2ff8367..2236916 100755 --- a/generate-spec +++ b/generate-spec @@ -983,7 +983,7 @@ foreach ($scopePaths as $scope => $paths) { $scopeOut = $out . $scopeSuffix; } - file_put_contents($scopeOut, json_encode($openapiScope, Helpers::jsonFlags())); + file_put_contents($scopeOut, json_encode($openapiScope, Helpers::jsonFlags()) . "\n"); Logger::info('app', 'Generated scope ' . $scope . ' with ' . $pathsCount . ' routes!'); } diff --git a/merge-specs b/merge-specs index 7851b7b..1326da2 100755 --- a/merge-specs +++ b/merge-specs @@ -170,4 +170,4 @@ function rewriteOperations(array $spec): array { return $spec["paths"]; } -file_put_contents($mergedSpecPath, json_encode($data, Helpers::jsonFlags())); +file_put_contents($mergedSpecPath, json_encode($data, Helpers::jsonFlags()) . "\n"); diff --git a/tests/openapi-administration.json b/tests/openapi-administration.json index c483091..b057230 100644 --- a/tests/openapi-administration.json +++ b/tests/openapi-administration.json @@ -3322,4 +3322,4 @@ } }, "tags": [] -} \ No newline at end of file +} diff --git a/tests/openapi-federation.json b/tests/openapi-federation.json index 1df8ce0..cbb6dfc 100644 --- a/tests/openapi-federation.json +++ b/tests/openapi-federation.json @@ -120,4 +120,4 @@ } }, "tags": [] -} \ No newline at end of file +} diff --git a/tests/openapi-full.json b/tests/openapi-full.json index ab89a28..b2367ca 100644 --- a/tests/openapi-full.json +++ b/tests/openapi-full.json @@ -3992,4 +3992,4 @@ } }, "tags": [] -} \ No newline at end of file +} diff --git a/tests/openapi.json b/tests/openapi.json index 0394418..b9cab64 100644 --- a/tests/openapi.json +++ b/tests/openapi.json @@ -719,4 +719,4 @@ } }, "tags": [] -} \ No newline at end of file +}