-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
Hi again!
One more unexpected behavior. Can you help, пожалуйста?)
allOf.json
{
"$id": "allOf.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "All of data",
"allOf": [
{
"$ref": "ref.json"
},
{
"required": ["field1"]
}
]
}
ref.json
{
"$id": "ref.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "Ref data",
"properties": {
"field1": {
"type": "object",
"properties": {
"field1_sub": {
"type": "string"
}
},
"required": ["field1_sub"]
}
}
}
public function testGenerateAllOf()
{
$appPath = realpath(__DIR__ . '/../../Tmp') . '/Issue8';
$appNs = 'Swaggest\PhpCodeBuilder\Tests\Tmp\\Issue8';
$app = new PhpApp();
$app->setNamespaceRoot($appNs, '.');
$schema = Schema::import(__DIR__ . '/../../../resources/allOf.json');
$builder = new PhpBuilder();
$builder->buildSetters = false;
$builder->makeEnumConstants = true;
$builder->classCreatedHook = new ClassHookCallback(
function (PhpClass $class, $path, $schema) use ($app, $appNs) {
$class->setNamespace($appNs);
if ('#' === $path) {
$class->setName('Sample'); // Class name for root schema
}
$app->addClass($class);
}
);
$builder->getType($schema);
$app->clearOldFiles($appPath);
$app->store($appPath);
}I expect 3 generated classes: RefJson.php, RefJsonField1.php and AllOf.php. But there is only two: RefJson.php and RefJsonField1.php
Maybe something missed in the schemas?
Metadata
Metadata
Assignees
Labels
No labels