@@ -57,6 +57,10 @@ public function normalize(mixed $object, ?string $format = null, array $context
57
57
$ entrypointProperties = [];
58
58
59
59
foreach ($ object ->getResourceNameCollection () as $ resourceClass ) {
60
+ if (enum_exists ($ resourceClass )) {
61
+ continue ;
62
+ }
63
+
60
64
$ resourceMetadataCollection = $ this ->resourceMetadataFactory ->create ($ resourceClass );
61
65
62
66
$ resourceMetadata = $ resourceMetadataCollection [0 ];
@@ -505,18 +509,10 @@ private function getProperty(ApiProperty $propertyMetadata, string $propertyName
505
509
'domain ' => $ prefixedShortName ,
506
510
];
507
511
508
- if ($ propertyMetadata ->getDeprecationReason ()) {
509
- $ propertyData ['owl:deprecated ' ] = true ;
510
- }
511
-
512
512
if ($ this ->isSingleRelation ($ propertyMetadata )) {
513
513
$ propertyData ['owl:maxCardinality ' ] = 1 ;
514
514
}
515
515
516
- if (null !== $ range = $ this ->getRange ($ propertyMetadata )) {
517
- $ propertyData ['range ' ] = $ range ;
518
- }
519
-
520
516
$ property = [
521
517
'@type ' => 'hydra:SupportedProperty ' ,
522
518
'hydra:property ' => $ propertyData ,
@@ -526,10 +522,18 @@ private function getProperty(ApiProperty $propertyMetadata, string $propertyName
526
522
'hydra:writeable ' => $ propertyMetadata ->isWritable () || $ propertyMetadata ->isInitializable (),
527
523
];
528
524
525
+ if (null !== $ range = $ this ->getRange ($ propertyMetadata )) {
526
+ $ property ['hydra:property ' ]['range ' ] = $ range ;
527
+ }
528
+
529
529
if (null !== $ description = $ propertyMetadata ->getDescription ()) {
530
530
$ property ['hydra:description ' ] = $ description ;
531
531
}
532
532
533
+ if ($ propertyMetadata ->getDeprecationReason ()) {
534
+ $ property ['owl:deprecated ' ] = true ;
535
+ }
536
+
533
537
return $ property ;
534
538
}
535
539
@@ -602,3 +606,4 @@ public function hasCacheableSupportsMethod(): bool
602
606
return true ;
603
607
}
604
608
}
609
+
0 commit comments