Skip to content

Commit aacdaf3

Browse files
authored
Merge pull request #71 from slackhq/ih_bugfix_merged_shapes
Bugfix: Alias merged allOf checks to the merged schema type
2 parents a1afe6c + dd36d73 commit aacdaf3

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/Codegen/Constraints/UntypedBuilder.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ public function getMergedAllOfChecks(): ?TSchema {
337337
private function generateMergedAllOfChecks(TSchema $schema, HackBuilder $hb): void {
338338
$schema_builder = new SchemaBuilder($this->ctx, $this->generateClassName($this->suffix, 'allOf'), $schema);
339339
$schema_builder->build();
340+
$this->type_info = $schema_builder->getTypeInfo();
340341
$hb->addReturnf('%s::check($input, $pointer)', $schema_builder->getClassName());
341342
}
342343

tests/examples/codegen/ExamplesAllofSchema1.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* To re-generate this file run `make test`
66
*
77
*
8-
* @generated SignedSource<<d86fe60f9a4b277d13542c3017f28e35>>
8+
* @generated SignedSource<<391cff06fb3f584b3ca4670e891301d7>>
99
*/
1010
namespace Slack\Hack\JsonSchema\Tests\Generated;
1111
use namespace Slack\Hack\JsonSchema;
@@ -16,7 +16,7 @@
1616
'foo' => int,
1717
);
1818

19-
type TExamplesAllofSchema1 = mixed;
19+
type TExamplesAllofSchema1 = TExamplesAllofSchema1AllOf;
2020

2121
final class ExamplesAllofSchema1AllOfPropertiesBar {
2222

tests/examples/codegen/ExamplesAllofSchema2.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* To re-generate this file run `make test`
66
*
77
*
8-
* @generated SignedSource<<337da92c52d98e9210c707a6ff9bd4a9>>
8+
* @generated SignedSource<<aaac02e5d111884d1e116a9c82ca0dad>>
99
*/
1010
namespace Slack\Hack\JsonSchema\Tests\Generated;
1111
use namespace Slack\Hack\JsonSchema;
@@ -17,7 +17,7 @@
1717
'foo' => int,
1818
);
1919

20-
type TExamplesAllofSchema2AllOfPropertiesXsItems = mixed;
20+
type TExamplesAllofSchema2AllOfPropertiesXsItems = TExamplesAllofSchema2AllOfPropertiesXsItemsAllOf;
2121

2222
type TExamplesAllofSchema2AllOfPropertiesSimpleObjectProp2 = shape(
2323
'prop_1' => int,
@@ -33,7 +33,7 @@
3333
'foo' => int,
3434
);
3535

36-
type TExamplesAllofSchema2 = mixed;
36+
type TExamplesAllofSchema2 = TExamplesAllofSchema2AllOf;
3737

3838
final class ExamplesAllofSchema2AllOfPropertiesBaz {
3939

0 commit comments

Comments
 (0)