Skip to content

Commit 6165f09

Browse files
authored
Merge pull request #41 from php-api-clients/correctly-reference-schema-classes-from-webhook
Correctly reference schema classes from webhook
2 parents 622d1c2 + 25543e5 commit 6165f09

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Generator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ private function all(string $namespace): iterable
130130
$this->basename($namespace . 'WebHook/' . $webHookClassName),
131131
$pathItem,
132132
$schemaClassNameMap,
133-
$namespace . 'WebHook'
133+
$namespace
134134
);
135135
}
136136

src/Generator/WebHook.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public static function generate(string $path, string $namespace, string $baseNam
6262
new Node\Arg(new Node\Expr\StaticCall(new Node\Name('\cebe\openapi\Reader'), new Node\Name('readFromJson'), [new Node\Scalar\String_(json_encode($oneOfSchema->getSerializableData())), new Node\Scalar\String_('\cebe\openapi\spec\Schema')])),
6363
]
6464
)),
65-
new Node\Stmt\Return_(new Node\Scalar\String_($rootNamespace . '\\' . $schemaClassNameMap[spl_object_hash($oneOfSchema)])),
65+
new Node\Stmt\Return_(new Node\Scalar\String_($rootNamespace . 'Schema\\' . $schemaClassNameMap[spl_object_hash($oneOfSchema)])),
6666
], [
6767
new Node\Stmt\Catch_(
6868
[new Node\Name('\\' . \Throwable::class)],

0 commit comments

Comments
 (0)