@@ -125,7 +125,7 @@ public function buildSchema(string $className, string $format = 'jsonapi', strin
125125 }
126126
127127 $ schema = $ this ->schemaFactory ->buildSchema ($ className , 'json ' , $ type , $ operation , $ schema , $ jsonApiSerializerContext , $ forceCollection );
128- $ definitionName = $ this ->definitionNameFactory ->create ($ inputOrOutputClass , $ format , $ className , $ operation , $ jsonApiSerializerContext );
128+ $ definitionName = $ this ->definitionNameFactory ->create ($ inputOrOutputClass , $ format , $ className , $ operation , $ jsonApiSerializerContext + [ ' schema_type ' => $ type ] );
129129 $ prefix = $ this ->getSchemaUriPrefix ($ schema ->getVersion ());
130130 $ definitions = $ schema ->getDefinitions ();
131131 $ collectionKey = $ schema ->getItemsDefinitionKey ();
@@ -300,7 +300,7 @@ private function buildDefinitionPropertiesSchema(string $key, string $className,
300300 $ operation = $ this ->findOperation ($ relatedClassName , $ type , null , $ serializerContext );
301301 $ inputOrOutputClass = $ this ->findOutputClass ($ relatedClassName , $ type , $ operation , $ serializerContext );
302302 $ serializerContext ??= $ this ->getSerializerContext ($ operation , $ type );
303- $ definitionName = $ this ->definitionNameFactory ->create ($ relatedClassName , $ format , $ inputOrOutputClass , $ operation , $ serializerContext );
303+ $ definitionName = $ this ->definitionNameFactory ->create ($ relatedClassName , $ format , $ inputOrOutputClass , $ operation , $ serializerContext + [ ' schema_type ' => $ type ] );
304304
305305 // to avoid recursion
306306 if ($ this ->builtSchema [$ definitionName ] ?? false ) {
0 commit comments