Skip to content

Releases: wol-soft/php-json-schema-model-generator

Filter option validation

17 Oct 11:05
Compare
Choose a tag to compare

New features

  • Added the possibility to validate additional options provided for filters (docs) by implementing the ValidateOptionsInterface (#62)

Bugfixes

  • Removed unneccessary usage of dynamic properties (#49)

Support for numeric properties

17 Mar 16:23
5ec7390
Compare
Choose a tag to compare

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

23 Feb 09:27
Compare
Choose a tag to compare

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

30 Nov 16:15
913fd3b
Compare
Choose a tag to compare

Classes from nested references aren't imported

0.21.7

26 Oct 14:12
Compare
Choose a tag to compare
optimize detection for incompatible filters

0.21.6

22 Oct 15:27
Compare
Choose a tag to compare

Fixes for #50, #51

0.21.5: Sort schema files (#45)

13 Oct 16:00
5cef589
Compare
Choose a tag to compare
* 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

13 Oct 13:31
Compare
Choose a tag to compare
Fix missing required check for required referenced property inside a …

0.21.3

12 Oct 12:32
Compare
Choose a tag to compare

Fix fatal errors during model generation

Fix validation of required properties not defined in the properties section of a schema

08 Oct 09:55
Compare
Choose a tag to compare

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;