Said run your example of generation we got output schema PhpKafka.PhpAvroSchemaGenerator.Example.SomeTestClass.avsc (part):
{
"name": "someOtherTestClass",
"type": "PhpKafka.PhpAvroSchemaGenerator.Example.SomeOtherTestClass"
},
{
"name": "someOtherTestClasses",
"type": {
"type": "array",
"items": "PhpKafka.PhpAvroSchemaGenerator.Example.SomeOtherTestClass"
}
},
{
"name": "blaaaaaaaa",
"type": [
"int",
"string"
]
},
{
"name": "unicorn",
"type": "PhpKafka.PhpAvroSchemaGenerator.Example.Wonderland"
}
Which is incorrect!
AVRO does not have types like PhpKafka.PhpAvroSchemaGenerator.Example.Wonderland!
In your example it is not very representative, because no any inner classes have fields, but said if Wonderland will have single field like:
**
* Country of miracles
**/
class Wonderland
{
private string $land;
}
That generated part instead of
{
"name": "unicorn",
"type": "PhpKafka.PhpAvroSchemaGenerator.Example.Wonderland"
}
should look like:
{
"name": "unicorn",
"type": "record",
"doc": "Country of miracles",
"fields": [
{
"name": "land",
"type": "string"
}
]
}
Said run your example of generation we got output schema
PhpKafka.PhpAvroSchemaGenerator.Example.SomeTestClass.avsc(part):{ "name": "someOtherTestClass", "type": "PhpKafka.PhpAvroSchemaGenerator.Example.SomeOtherTestClass" }, { "name": "someOtherTestClasses", "type": { "type": "array", "items": "PhpKafka.PhpAvroSchemaGenerator.Example.SomeOtherTestClass" } }, { "name": "blaaaaaaaa", "type": [ "int", "string" ] }, { "name": "unicorn", "type": "PhpKafka.PhpAvroSchemaGenerator.Example.Wonderland" }Which is incorrect!
AVRO does not have types like
PhpKafka.PhpAvroSchemaGenerator.Example.Wonderland!In your example it is not very representative, because no any inner classes have fields, but said if
Wonderlandwill have single field like:That generated part instead of
{ "name": "unicorn", "type": "PhpKafka.PhpAvroSchemaGenerator.Example.Wonderland" }should look like:
{ "name": "unicorn", "type": "record", "doc": "Country of miracles", "fields": [ { "name": "land", "type": "string" } ] }