Skip to content

Commit 05035db

Browse files
authored
Do not escape forward slashes in Printer::printDescription
1 parent bf4e935 commit 05035db

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ You can find and compare releases at the [GitHub release page](https://github.co
99

1010
## Unreleased
1111

12+
## v15.29.2
13+
14+
### Fixed
15+
16+
- Do not escape forward slashes in `Printer::printDescription` https://github.com/webonyx/graphql-php/pull/1824
17+
1218
## v15.29.1
1319

1420
### Fixed

src/Utils/SchemaPrinter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ protected static function printDescription(array $options, $def, string $indenta
254254
: $indentation;
255255

256256
if (count(Utils::splitLines($description)) === 1) {
257-
$description = json_encode($description, JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE);
257+
$description = json_encode($description, JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
258258
} else {
259259
$description = BlockString::print($description);
260260
$description = $indentation !== ''

tests/Utils/SchemaPrinterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1049,7 +1049,7 @@ public function testPrintIntrospectionSchema(): void
10491049
10501050
"Marks an element of a GraphQL schema as no longer supported."
10511051
directive @deprecated(
1052-
"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https:\/\/commonmark.org\/)."
1052+
"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/)."
10531053
reason: String = "No longer supported"
10541054
) on FIELD_DEFINITION | ENUM_VALUE | ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
10551055

0 commit comments

Comments
 (0)