From a9c8d1741d8c13dcdb33ef5e9bae22fac91b8b8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Fri, 21 Jan 2022 15:38:46 +0100 Subject: [PATCH] Enhancement: Add links to documentation --- src/SchemaNormalizer.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/SchemaNormalizer.php b/src/SchemaNormalizer.php index 53c16285..67745587 100644 --- a/src/SchemaNormalizer.php +++ b/src/SchemaNormalizer.php @@ -131,10 +131,16 @@ private function normalizeArray( $schema, ); + /** + * @see https://json-schema.org/understanding-json-schema/reference/array.html + */ if (!self::describesType('array', $schema)) { return $data; } + /** + * @see https://json-schema.org/understanding-json-schema/reference/array.html#items + */ if (!\property_exists($schema, 'items')) { return $data; } @@ -173,10 +179,16 @@ private function normalizeObject( $schema, ); + /** + * @see https://json-schema.org/understanding-json-schema/reference/object.html + */ if (!self::describesType('object', $schema)) { return $data; } + /** + * @see https://json-schema.org/understanding-json-schema/reference/object.html#properties + */ if (!\property_exists($schema, 'properties')) { return $data; } @@ -287,6 +299,9 @@ private function resolveSchema( return $schema; } + /** + * @see https://json-schema.org/understanding-json-schema/reference/type.html + */ private static function describesType( string $type, \stdClass $schema