Releases: wol-soft/php-json-schema-model-generator
Releases · wol-soft/php-json-schema-model-generator
Filter option validation
Support for numeric properties
Fixes object properties with a numeric name or a name with a leading number:
{
"type": "object",
"properties": {
"1000": {
"type": "integer"
},
"1000string": {
"type": "string"
}
}
}
will result in the following interface (variables are prefixed as PHP doesn't allow variable names with a leading number):
public function get1000(): int;
public function set1000(int $numeric_property_1000): self;
public function get1000string(): string;
public function set1000string(string $numeric_property_1000string): self;
⚠️ BC: rename $modelData constructor parameter to $rawModelDataInput
For compatibility with external serializer/deserializer (eg. symfony serializer, compare #55) the constructor parameter has been renamed.
If you use generated models with named parameters (>= PHP 8.0) you may have to modify your usages.
0.21.8: Merge pull request #53 from wol-soft/useInNestedReferences
Classes from nested references aren't imported
0.21.7
0.21.6
0.21.5: Sort schema files (#45)
* Sort schema files This ensures a consistent model generation order as the RecursiveDirectoryIterator might iterate over files without a specific order: https://www.php.net/manual/de/class.recursivedirectoryiterator.php#120971 * $file is not an array anymore
0.21.4
0.21.3
Fix validation of required properties not defined in the properties section of a schema
Previously to this release a schema like the following won't validate the property bar
:
{
"type": "object",
"properties": {
"foo": {
"type": "string"
},
"required": [
"foo",
"bar"
]
}
Now the property will be validated and added to the interface of the generated class. Generated interface:
getFoo(): string;
setFoo(string $value): self;
getBar(): mixed;
setBar(mixed $value): self;