Skip to content

Commit 6a472a2

Browse files
committed
fix(jsonapi): swap arguments in DefinitionNameFactory::create() call
| Q | A | ------------- | --- | Branch? | 4.2 | Tickets | ∅ | License | MIT | Doc PR | ∅ The first and third arguments were reversed compared to every other call site, causing schema definitions to be registered under a wrong name and producing unresolved $ref errors in OpenAPI linters.
1 parent f400290 commit 6a472a2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/JsonApi/JsonSchema/SchemaFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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 + ['schema_type' => $type]);
128+
$definitionName = $this->definitionNameFactory->create($className, $format, $inputOrOutputClass, $operation, $jsonApiSerializerContext + ['schema_type' => $type]);
129129
$prefix = $this->getSchemaUriPrefix($schema->getVersion());
130130
$definitions = $schema->getDefinitions();
131131
$collectionKey = $schema->getItemsDefinitionKey();

0 commit comments

Comments
 (0)