@@ -57,6 +57,10 @@ public function normalize(mixed $object, ?string $format = null, array $context
5757 $ entrypointProperties = [];
5858
5959 foreach ($ object ->getResourceNameCollection () as $ resourceClass ) {
60+ if (enum_exists ($ resourceClass )) {
61+ continue ;
62+ }
63+
6064 $ resourceMetadataCollection = $ this ->resourceMetadataFactory ->create ($ resourceClass );
6165
6266 $ resourceMetadata = $ resourceMetadataCollection [0 ];
@@ -505,18 +509,10 @@ private function getProperty(ApiProperty $propertyMetadata, string $propertyName
505509 'domain ' => $ prefixedShortName ,
506510 ];
507511
508- if ($ propertyMetadata ->getDeprecationReason ()) {
509- $ propertyData ['owl:deprecated ' ] = true ;
510- }
511-
512512 if ($ this ->isSingleRelation ($ propertyMetadata )) {
513513 $ propertyData ['owl:maxCardinality ' ] = 1 ;
514514 }
515515
516- if (null !== $ range = $ this ->getRange ($ propertyMetadata )) {
517- $ propertyData ['range ' ] = $ range ;
518- }
519-
520516 $ property = [
521517 '@type ' => 'hydra:SupportedProperty ' ,
522518 'hydra:property ' => $ propertyData ,
@@ -526,10 +522,18 @@ private function getProperty(ApiProperty $propertyMetadata, string $propertyName
526522 'hydra:writeable ' => $ propertyMetadata ->isWritable () || $ propertyMetadata ->isInitializable (),
527523 ];
528524
525+ if (null !== $ range = $ this ->getRange ($ propertyMetadata )) {
526+ $ property ['hydra:property ' ]['range ' ] = $ range ;
527+ }
528+
529529 if (null !== $ description = $ propertyMetadata ->getDescription ()) {
530530 $ property ['hydra:description ' ] = $ description ;
531531 }
532532
533+ if ($ propertyMetadata ->getDeprecationReason ()) {
534+ $ property ['owl:deprecated ' ] = true ;
535+ }
536+
533537 return $ property ;
534538 }
535539
@@ -602,3 +606,4 @@ public function hasCacheableSupportsMethod(): bool
602606 return true ;
603607 }
604608}
609+
0 commit comments