PHPackages                             php-kafka/php-avro-schema-generator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. php-kafka/php-avro-schema-generator

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

php-kafka/php-avro-schema-generator
===================================

PHP avro schema generator for subschema

v3.0.0(1y ago)621.0k↓35.9%5[8 issues](https://github.com/php-kafka/php-avro-schema-generator/issues)[3 PRs](https://github.com/php-kafka/php-avro-schema-generator/pulls)MITPHPCI passing

Since Sep 26Pushed 1y ago2 watchersCompare

[ Source](https://github.com/php-kafka/php-avro-schema-generator)[ Packagist](https://packagist.org/packages/php-kafka/php-avro-schema-generator)[ RSS](/packages/php-kafka-php-avro-schema-generator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (11)Versions (29)Used By (0)

Avro schema generator for PHP
=============================

[](#avro-schema-generator-for-php)

[![Actions Status](https://github.com/php-kafka/php-avro-schema-generator/workflows/CI/badge.svg)](https://github.com/php-kafka/php-avro-schema-generator/workflows/CI/badge.svg)[![Maintainability](https://camo.githubusercontent.com/db5908e988ceece0652c4aaeb198a541d3dd76a73f7c5ee703a6bbe4eba57194/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f34316165636632313536366437653962666236392f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/php-kafka/php-avro-schema-generator/maintainability)[![Test Coverage](https://camo.githubusercontent.com/5758b7f1eaefb8a7d6ffb73397635c7efc847c49f1887b74cfbfebfb0fe8faef/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f34316165636632313536366437653962666236392f746573745f636f766572616765)](https://codeclimate.com/github/php-kafka/php-avro-schema-generator/test_coverage)[![Supported PHP versions: ^8.2](https://camo.githubusercontent.com/962aced9b09d89716dbebf186ff899754a096ff1068b6b7988675c2d9fab9331/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e322d626c75652e737667)](https://camo.githubusercontent.com/962aced9b09d89716dbebf186ff899754a096ff1068b6b7988675c2d9fab9331/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e322d626c75652e737667)[![Latest Stable Version](https://camo.githubusercontent.com/80d5e4cb7b97494e4d5f64e6e9cca39e6ef0d8792454780893bb5b27791f178c/68747470733a2f2f706f7365722e707567782e6f72672f7068702d6b61666b612f7068702d6176726f2d736368656d612d67656e657261746f722f762f737461626c65)](https://packagist.org/packages/php-kafka/php-avro-schema-generator)

Installation
------------

[](#installation)

```
composer require php-kafka/php-avro-schema-generator "^3.0"

```

Note: For PHP7.x please use the 2.x version.

Description
-----------

[](#description)

This library enables you to:

- Manage your embedded schema as separate files
- The library is able to merge those files
- The library is able to generate avsc schema templates from PHP classes

### Merging subschemas / schemas

[](#merging-subschemas--schemas)

Schema template directories: directories containing avsc template files (with subschema)
Output directory: output directory for the merged schema files

**Console example**

```
./vendor/bin/avro-cli avro:subschema:merge ./example/schemaTemplates ./example/schema
```

**PHP example**

```
