There are special use-cases that each language supports; this document pertains to PHP models.
By default, descriptions are not rendered for the model; you can change that by applying PHP_DESCRIPTION_PRESET
.
Check out this example for a live demonstration.
The most widely used usecase for Modelina is to generate models that include serialization and deserialization functionality to convert the models into payload data. This payload data can, of course, be many different kinds, JSON, XML, raw binary, you name it.
As you normally only need one library to do this, we developers can never get enough of creating new stuff, therefore, there might be one specific library you need or want to integrate with. Therefore, there is not one specific preset that offers everything. Below is a list of all the supported serialization presets.
Here are all the supported presets and the libraries they use for converting to and from JSON:
Objects in PHP can generally be serialized to JSON using the json_encode()
function.
To ensure that the data is serialized correctly, the JsonSerializable
interface needs to be implemented.
This will ensure that, for example, enum values and property names are serialized correctly.
To add support of serialization to JSON, apply the PHP_JSON_SERIALIZABLE_PRESET
preset.
Check out this example for a live demonstration.
Currently not supported, let everyone know you need it!
Currently not supported, let everyone know you need it!