Skip to content

Post Processors

Compare
Choose a tag to compare
@wol-soft wol-soft released this 16 Jul 11:30
· 205 commits to master since this release

Backward incompatible changes

The interfaces for filters have been moved to the production repository to implement a custom filter in a single class. The namespaces have been changed:

  • FilterInterface is now located at PHPModelGenerator\Filter\FilterInterface
  • TransformingFilterInterface is now located at PHPModelGenerator\Filter\TransformingFilterInterface

The output format of schema providers has been changed. Instead of a tuple for each schema a JsonSchema object must be returned. If you have implemented a custom schema provider have a look at the SchemaProviderInterface for more details and change your implementation to match the new interface. Basically instead of a tuple [$fileName, $jsonSchemaStructure] you must now return a JsonSchema object:

new JsonSchema($fileName, $jsonSchemaStructure);

Features

  • Implemented post processors (#16) which can be used to change the generated model (eg. add additional functions to the model) (docs)
    • Builtin post processor: PopulatePostProcessor, adds a populate method to the model which allows updating any subset of the model's properties with validation (docs)
    • Provides an interface to implement custom post processors (docs)
  • Extended the output of a SchemaException to contain the file which caused the exception

Internal

  • Instead of arrays the schemas are passed through the library via JsonSchema objects.
  • Adding serialization methods is now handled via a post processor