diff --git a/migration.md b/migration.md deleted file mode 100644 index 45f8859..0000000 --- a/migration.md +++ /dev/null @@ -1,196 +0,0 @@ - -# Migration - -The following list covers all major restrictions to JSON Schema. This should help -to migrate your JSON Schema to TypeSchema. Also please take a look at our [migration -tool](https://typeschema.org/migration/jsonschema) which allows you to automatically -convert a JSON Schema into a TypeSchema. - -## No-Type - -### Invalid - -```json -{ -} -``` - -In JsonSchema it is possible to define no keyword which means every value is -valid. - -### Reasoning - -In TypeSchema every schema must be assigned to a specific type depending on the -used keywords so that a parser knows at least which type is expected. Depending -on the type there are specific keywords possible. - -## Array-Type - -### Invalid - -```json -{ - "type": ["string", "number"], - "minLength": 12 -} -``` - -In JsonSchema it is possible to allow multiple types at the `type` keyword. - -### Reasoning - -In TypeSchema `type` must be a `string` since based on this schema it is -impossible to generate a strongly typed class. To allow different types you -need to explicit use an union type (`oneOf` keyword) - -## Array-Array-Item - -### Invalid - -```json -{ - "type": "array", - "items": { - "type": "array" - } -} -``` - -In JsonSchema it is possible to use every schema as array item. - -### Reasoning - -In TypeSchema it is not possible to use an array as array value. This is done -because this constructs complicates code generators and it is also bad data -design. - -## Null-Type - -### Invalid - -```json -{ - "type": "null" -} -``` - -In JsonSchema it is possible to define the `null` type. - -### Reasoning - -We think that `null` is not a data type but rather an attribute of a type. -Because of that TypeSchema has the `nullable` keyword which can be `true` or -`false` for every type. - -## Mixed-Assertions - -### Invalid - -```json -{ - "type": "string", - "minLength": 12, - "minimum": 12 -} -``` - -In JsonSchema it is possible to define multiple assertions for different types. - -### Reasoning - -Since in TypeSchema you can define only one type, you can also use only the -assertions which are fitting for the type. I.e. `minimum` for the `number` type -or `minLength` for the `string` type but not both. - -## Pattern-Properties - -### Invalid - -```json -{ - "type": "object", - "patternProperties": { - "^S_": { - "type": "string" - }, - "^I_": { - "type": "integer" - } - } -} -``` - -In JsonSchema it is possible to use pattern properties to apply different -schemas based on the key. - -### Reasoning - -In TypeSchema you need to decide between a struct or map. A struct contains -hardcoded properties through the `properties` keyword and a map makes use of the -`additionalProperties` keyword. For the `additionalProperties` keyword every value -must follow the same schema. Code generators can not usefully understand those -properties and we think also that the `patternProperties` keyword promotes -bad data design. - -## Root-Object - -### Invalid - -```json -{ - "type": "object", - "properties": { - "foo": { - "type": "string" - } - } -} -``` - -### Reasoning - -In JsonSchema you can define a root schema at the top level. In TypeSchema we -can only use a `$ref` at the root level to reference a root schema. This is -because we always need a name for every schema and this is the key at the -`definitions` location. The following example shows a valid version: - -### Valid - -```json -{ - "definitions": { - "MyType": { - "type": "object", - "properties": { - "foo": { - "type": "string" - } - } - } - }, - "$ref": "MyType" -} -``` - -## Anyof-Type - -### Invalid - -```json -{ - "anyOf": [{ - "type": "string" - },{ - "type": "number" - }] -} -``` - -In JsonSchema it is possible to use the `anyOf` keyword. In TypeSchema this -keyword does not exist. You can use either `oneOf` or `allOf`. - -### Reasoning - -The `anyOf` keyword is not practical for code generation. The `oneOf` type can -be mapped to a union type and the `allOf` type can be mapped to an intersection -type. diff --git a/www/composer.lock b/www/composer.lock index 4a479b5..42e2377 100644 --- a/www/composer.lock +++ b/www/composer.lock @@ -101,16 +101,16 @@ }, { "name": "doctrine/dbal", - "version": "3.9.1", + "version": "3.9.3", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "d7dc08f98cba352b2bab5d32c5e58f7e745c11a7" + "reference": "61446f07fcb522414d6cfd8b1c3e5f9e18c579ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/d7dc08f98cba352b2bab5d32c5e58f7e745c11a7", - "reference": "d7dc08f98cba352b2bab5d32c5e58f7e745c11a7", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/61446f07fcb522414d6cfd8b1c3e5f9e18c579ba", + "reference": "61446f07fcb522414d6cfd8b1c3e5f9e18c579ba", "shasum": "" }, "require": { @@ -126,7 +126,7 @@ "doctrine/coding-standard": "12.0.0", "fig/log-test": "^1", "jetbrains/phpstorm-stubs": "2023.1", - "phpstan/phpstan": "1.12.0", + "phpstan/phpstan": "1.12.6", "phpstan/phpstan-strict-rules": "^1.6", "phpunit/phpunit": "9.6.20", "psalm/plugin-phpunit": "0.18.4", @@ -194,7 +194,7 @@ ], "support": { "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/3.9.1" + "source": "https://github.com/doctrine/dbal/tree/3.9.3" }, "funding": [ { @@ -210,7 +210,7 @@ "type": "tidelift" } ], - "time": "2024-09-01T13:49:23+00:00" + "time": "2024-10-10T17:56:43+00:00" }, { "name": "doctrine/deprecations", @@ -429,16 +429,16 @@ }, { "name": "doctrine/migrations", - "version": "3.8.1", + "version": "3.8.2", "source": { "type": "git", "url": "https://github.com/doctrine/migrations.git", - "reference": "7760fbd0b7cb58bfb50415505a7bab821adf0877" + "reference": "5007eb1168691225ac305fe16856755c20860842" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/migrations/zipball/7760fbd0b7cb58bfb50415505a7bab821adf0877", - "reference": "7760fbd0b7cb58bfb50415505a7bab821adf0877", + "url": "https://api.github.com/repos/doctrine/migrations/zipball/5007eb1168691225ac305fe16856755c20860842", + "reference": "5007eb1168691225ac305fe16856755c20860842", "shasum": "" }, "require": { @@ -512,7 +512,7 @@ ], "support": { "issues": "https://github.com/doctrine/migrations/issues", - "source": "https://github.com/doctrine/migrations/tree/3.8.1" + "source": "https://github.com/doctrine/migrations/tree/3.8.2" }, "funding": [ { @@ -528,7 +528,7 @@ "type": "tidelift" } ], - "time": "2024-08-28T13:17:28+00:00" + "time": "2024-10-10T21:35:27+00:00" }, { "name": "egulias/email-validator", @@ -1025,16 +1025,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.19.1", + "version": "v4.19.4", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "4e1b88d21c69391150ace211e9eaf05810858d0b" + "reference": "715f4d25e225bc47b293a8b997fe6ce99bf987d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4e1b88d21c69391150ace211e9eaf05810858d0b", - "reference": "4e1b88d21c69391150ace211e9eaf05810858d0b", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/715f4d25e225bc47b293a8b997fe6ce99bf987d2", + "reference": "715f4d25e225bc47b293a8b997fe6ce99bf987d2", "shasum": "" }, "require": { @@ -1043,7 +1043,7 @@ }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "bin": [ "bin/php-parse" @@ -1075,9 +1075,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.1" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.4" }, - "time": "2024-03-17T08:10:35+00:00" + "time": "2024-09-29T15:01:53+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -1192,16 +1192,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.30.1", + "version": "1.32.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "51b95ec8670af41009e2b2b56873bad96682413e" + "reference": "6ca22b154efdd9e3c68c56f5d94670920a1c19a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/51b95ec8670af41009e2b2b56873bad96682413e", - "reference": "51b95ec8670af41009e2b2b56873bad96682413e", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/6ca22b154efdd9e3c68c56f5d94670920a1c19a4", + "reference": "6ca22b154efdd9e3c68c56f5d94670920a1c19a4", "shasum": "" }, "require": { @@ -1233,9 +1233,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.30.1" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.32.0" }, - "time": "2024-09-07T20:13:05+00:00" + "time": "2024-09-26T07:23:32+00:00" }, { "name": "psr/cache", @@ -1599,16 +1599,16 @@ }, { "name": "psr/log", - "version": "3.0.1", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "79dff0b268932c640297f5208d6298f71855c03e" + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/79dff0b268932c640297f5208d6298f71855c03e", - "reference": "79dff0b268932c640297f5208d6298f71855c03e", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", "shasum": "" }, "require": { @@ -1643,29 +1643,29 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/3.0.1" + "source": "https://github.com/php-fig/log/tree/3.0.2" }, - "time": "2024-08-21T13:31:24+00:00" + "time": "2024-09-11T13:17:53+00:00" }, { "name": "psx/api", - "version": "v7.0.8", + "version": "v7.2.3", "source": { "type": "git", "url": "https://github.com/apioo/psx-api.git", - "reference": "8a514c72c32c3d389e5e655050e4b718af4747c0" + "reference": "cfd6355fa1b41c5a8bd177166a33a11c11182474" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/apioo/psx-api/zipball/8a514c72c32c3d389e5e655050e4b718af4747c0", - "reference": "8a514c72c32c3d389e5e655050e4b718af4747c0", + "url": "https://api.github.com/repos/apioo/psx-api/zipball/cfd6355fa1b41c5a8bd177166a33a11c11182474", + "reference": "cfd6355fa1b41c5a8bd177166a33a11c11182474", "shasum": "" }, "require": { "php": ">=8.1", "psx/json": "^3.0", - "psx/openapi": "^0.1", - "psx/schema": "^6.0", + "psx/openapi": "^1.0", + "psx/schema": "^7.0", "symfony/cache": "^5.0|^6.0|^7.0", "symfony/console": "^5.0|^6.0|^7.0", "symfony/property-access": "^5.0|^6.0|^7.0", @@ -1704,7 +1704,7 @@ ], "support": { "issues": "https://github.com/apioo/psx-api/issues", - "source": "https://github.com/apioo/psx-api/tree/v7.0.8" + "source": "https://github.com/apioo/psx-api/tree/v7.2.3" }, "funding": [ { @@ -1720,20 +1720,20 @@ "type": "patreon" } ], - "time": "2024-09-07T07:25:58+00:00" + "time": "2024-10-11T17:00:15+00:00" }, { "name": "psx/data", - "version": "v6.0.2", + "version": "v7.0.1", "source": { "type": "git", "url": "https://github.com/apioo/psx-data.git", - "reference": "671f84e41ab50deb66b1e818ad001f43f19d4382" + "reference": "15b8e53099187254148ebee4ea41352177076b3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/apioo/psx-data/zipball/671f84e41ab50deb66b1e818ad001f43f19d4382", - "reference": "671f84e41ab50deb66b1e818ad001f43f19d4382", + "url": "https://api.github.com/repos/apioo/psx-data/zipball/15b8e53099187254148ebee4ea41352177076b3c", + "reference": "15b8e53099187254148ebee4ea41352177076b3c", "shasum": "" }, "require": { @@ -1744,7 +1744,7 @@ "psx/json": "^3.0", "psx/model": "^5.0", "psx/record": "^3.0", - "psx/schema": "^6.0", + "psx/schema": "^7.0", "psx/validate": "^2.0" }, "require-dev": { @@ -1779,7 +1779,7 @@ ], "support": { "issues": "https://github.com/apioo/psx-data/issues", - "source": "https://github.com/apioo/psx-data/tree/v6.0.2" + "source": "https://github.com/apioo/psx-data/tree/v7.0.1" }, "funding": [ { @@ -1795,20 +1795,20 @@ "type": "patreon" } ], - "time": "2024-04-06T09:08:36+00:00" + "time": "2024-10-10T11:07:43+00:00" }, { "name": "psx/datetime", - "version": "v3.0.1", + "version": "v3.0.2", "source": { "type": "git", "url": "https://github.com/apioo/psx-datetime.git", - "reference": "5b763bcd09fdfda611a72d1a0dc6f34ec10f7b44" + "reference": "4c930aba1cce89a24de0740b6035d44de33585e6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/apioo/psx-datetime/zipball/5b763bcd09fdfda611a72d1a0dc6f34ec10f7b44", - "reference": "5b763bcd09fdfda611a72d1a0dc6f34ec10f7b44", + "url": "https://api.github.com/repos/apioo/psx-datetime/zipball/4c930aba1cce89a24de0740b6035d44de33585e6", + "reference": "4c930aba1cce89a24de0740b6035d44de33585e6", "shasum": "" }, "require": { @@ -1847,7 +1847,7 @@ ], "support": { "issues": "https://github.com/apioo/psx-datetime/issues", - "source": "https://github.com/apioo/psx-datetime/tree/v3.0.1" + "source": "https://github.com/apioo/psx-datetime/tree/v3.0.2" }, "funding": [ { @@ -1863,7 +1863,7 @@ "type": "patreon" } ], - "time": "2024-05-10T17:04:35+00:00" + "time": "2024-09-22T08:37:24+00:00" }, { "name": "psx/engine", @@ -1932,16 +1932,16 @@ }, { "name": "psx/framework", - "version": "v7.8.5", + "version": "v7.9.1", "source": { "type": "git", "url": "https://github.com/apioo/psx-framework.git", - "reference": "86aeaf2ec7a2c4ceee1bce3abd7c90913b0ad4a9" + "reference": "3c30eef184d5b9531246df5f76dca31ba957799f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/apioo/psx-framework/zipball/86aeaf2ec7a2c4ceee1bce3abd7c90913b0ad4a9", - "reference": "86aeaf2ec7a2c4ceee1bce3abd7c90913b0ad4a9", + "url": "https://api.github.com/repos/apioo/psx-framework/zipball/3c30eef184d5b9531246df5f76dca31ba957799f", + "reference": "3c30eef184d5b9531246df5f76dca31ba957799f", "shasum": "" }, "require": { @@ -1951,13 +1951,13 @@ "psr/cache": "^1.0|^2.0|^3.0", "psr/container": "^1.0|^2.0", "psr/log": "^1.0|^2.0|^3.0", - "psx/api": "^6.0|^7.0", - "psx/data": "^6.0", + "psx/api": "^7.0", + "psx/data": "^7.0", "psx/engine": "^2.0", "psx/http": "^4.0", "psx/json": "^3.0", "psx/oauth2": "^4.0", - "psx/schema": "^6.0", + "psx/schema": "^7.0", "psx/sql": "^4.0", "psx/uri": "^3.0", "psx/validate": "^2.0", @@ -2005,7 +2005,7 @@ ], "support": { "issues": "https://github.com/apioo/psx-framework/issues", - "source": "https://github.com/apioo/psx-framework/tree/v7.8.5" + "source": "https://github.com/apioo/psx-framework/tree/v7.9.1" }, "funding": [ { @@ -2021,20 +2021,20 @@ "type": "patreon" } ], - "time": "2024-09-02T16:22:18+00:00" + "time": "2024-10-10T12:08:31+00:00" }, { "name": "psx/http", - "version": "v4.0.4", + "version": "v4.0.5", "source": { "type": "git", "url": "https://github.com/apioo/psx-http.git", - "reference": "de7fd38e5759697664e5ed3a1705a7cb4d91c99a" + "reference": "23da2fa4df2e09c9251369894fbe9c3cde6c5d92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/apioo/psx-http/zipball/de7fd38e5759697664e5ed3a1705a7cb4d91c99a", - "reference": "de7fd38e5759697664e5ed3a1705a7cb4d91c99a", + "url": "https://api.github.com/repos/apioo/psx-http/zipball/23da2fa4df2e09c9251369894fbe9c3cde6c5d92", + "reference": "23da2fa4df2e09c9251369894fbe9c3cde6c5d92", "shasum": "" }, "require": { @@ -2072,7 +2072,7 @@ ], "support": { "issues": "https://github.com/apioo/psx-http/issues", - "source": "https://github.com/apioo/psx-http/tree/v4.0.4" + "source": "https://github.com/apioo/psx-http/tree/v4.0.5" }, "funding": [ { @@ -2088,7 +2088,7 @@ "type": "patreon" } ], - "time": "2024-05-10T17:22:46+00:00" + "time": "2024-09-15T10:25:21+00:00" }, { "name": "psx/json", @@ -2293,16 +2293,16 @@ }, { "name": "psx/openapi", - "version": "v0.1.2", + "version": "v1.0.0", "source": { "type": "git", "url": "https://github.com/apioo/psx-openapi.git", - "reference": "7f4bffb834b35f41679bb068e3990cd907d8c41e" + "reference": "b20b7fae9b1ae6f3c49bc0675ac2ed1ee9437c5d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/apioo/psx-openapi/zipball/7f4bffb834b35f41679bb068e3990cd907d8c41e", - "reference": "7f4bffb834b35f41679bb068e3990cd907d8c41e", + "url": "https://api.github.com/repos/apioo/psx-openapi/zipball/b20b7fae9b1ae6f3c49bc0675ac2ed1ee9437c5d", + "reference": "b20b7fae9b1ae6f3c49bc0675ac2ed1ee9437c5d", "shasum": "" }, "require": { @@ -2311,7 +2311,7 @@ }, "require-dev": { "phpunit/phpunit": "^9.0", - "psx/schema": "^6.0", + "psx/schema": "^7.0", "symfony/yaml": "^5.0|^6.0|^7.0", "vimeo/psalm": "^5.0" }, @@ -2341,7 +2341,7 @@ ], "support": { "issues": "https://github.com/apioo/psx-openapi/issues", - "source": "https://github.com/apioo/psx-openapi/tree/v0.1.2" + "source": "https://github.com/apioo/psx-openapi/tree/v1.0.0" }, "funding": [ { @@ -2357,7 +2357,7 @@ "type": "patreon" } ], - "time": "2024-05-10T17:34:39+00:00" + "time": "2024-10-09T18:33:41+00:00" }, { "name": "psx/record", @@ -2426,16 +2426,16 @@ }, { "name": "psx/schema", - "version": "v6.2.7", + "version": "v7.1.1", "source": { "type": "git", "url": "https://github.com/apioo/psx-schema.git", - "reference": "d87b25ac2f96cc90167b99a6dd7c0a646c3c80ac" + "reference": "b7f575c2d50c3fdd3c01aa062c32521ab3cd6c66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/apioo/psx-schema/zipball/d87b25ac2f96cc90167b99a6dd7c0a646c3c80ac", - "reference": "d87b25ac2f96cc90167b99a6dd7c0a646c3c80ac", + "url": "https://api.github.com/repos/apioo/psx-schema/zipball/b7f575c2d50c3fdd3c01aa062c32521ab3cd6c66", + "reference": "b7f575c2d50c3fdd3c01aa062c32521ab3cd6c66", "shasum": "" }, "require": { @@ -2455,11 +2455,8 @@ "require-dev": { "phpunit/phpunit": "^9.0", "symfony/yaml": "^5.0|^6.0|^7.0", - "vimeo/psalm": "^4.0" + "vimeo/psalm": "^5.0" }, - "bin": [ - "bin/schema" - ], "type": "library", "autoload": { "psr-4": { @@ -2487,7 +2484,7 @@ ], "support": { "issues": "https://github.com/apioo/psx-schema/issues", - "source": "https://github.com/apioo/psx-schema/tree/v6.2.7" + "source": "https://github.com/apioo/psx-schema/tree/v7.1.1" }, "funding": [ { @@ -2503,7 +2500,7 @@ "type": "patreon" } ], - "time": "2024-08-18T10:20:13+00:00" + "time": "2024-10-12T09:43:10+00:00" }, { "name": "psx/sql", @@ -2750,16 +2747,16 @@ }, { "name": "symfony/cache", - "version": "v7.1.4", + "version": "v7.1.5", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "b61e464d7687bb7e8f677d5031c632bf3820df18" + "reference": "86e5296b10e4dec8c8441056ca606aedb8a3be0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/b61e464d7687bb7e8f677d5031c632bf3820df18", - "reference": "b61e464d7687bb7e8f677d5031c632bf3820df18", + "url": "https://api.github.com/repos/symfony/cache/zipball/86e5296b10e4dec8c8441056ca606aedb8a3be0a", + "reference": "86e5296b10e4dec8c8441056ca606aedb8a3be0a", "shasum": "" }, "require": { @@ -2827,7 +2824,7 @@ "psr6" ], "support": { - "source": "https://github.com/symfony/cache/tree/v7.1.4" + "source": "https://github.com/symfony/cache/tree/v7.1.5" }, "funding": [ { @@ -2843,7 +2840,7 @@ "type": "tidelift" } ], - "time": "2024-08-12T09:59:40+00:00" + "time": "2024-09-17T09:16:35+00:00" }, { "name": "symfony/cache-contracts", @@ -3072,16 +3069,16 @@ }, { "name": "symfony/console", - "version": "v7.1.4", + "version": "v7.1.5", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "1eed7af6961d763e7832e874d7f9b21c3ea9c111" + "reference": "0fa539d12b3ccf068a722bbbffa07ca7079af9ee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/1eed7af6961d763e7832e874d7f9b21c3ea9c111", - "reference": "1eed7af6961d763e7832e874d7f9b21c3ea9c111", + "url": "https://api.github.com/repos/symfony/console/zipball/0fa539d12b3ccf068a722bbbffa07ca7079af9ee", + "reference": "0fa539d12b3ccf068a722bbbffa07ca7079af9ee", "shasum": "" }, "require": { @@ -3145,7 +3142,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.1.4" + "source": "https://github.com/symfony/console/tree/v7.1.5" }, "funding": [ { @@ -3161,20 +3158,20 @@ "type": "tidelift" } ], - "time": "2024-08-15T22:48:53+00:00" + "time": "2024-09-20T08:28:38+00:00" }, { "name": "symfony/dependency-injection", - "version": "v7.1.4", + "version": "v7.1.5", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "5320e0bc2c9e2d7450bb4091e497a305a68b28ed" + "reference": "38465f925ec4e0707b090e9147c65869837d639d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/5320e0bc2c9e2d7450bb4091e497a305a68b28ed", - "reference": "5320e0bc2c9e2d7450bb4091e497a305a68b28ed", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/38465f925ec4e0707b090e9147c65869837d639d", + "reference": "38465f925ec4e0707b090e9147c65869837d639d", "shasum": "" }, "require": { @@ -3225,7 +3222,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v7.1.4" + "source": "https://github.com/symfony/dependency-injection/tree/v7.1.5" }, "funding": [ { @@ -3241,7 +3238,7 @@ "type": "tidelift" } ], - "time": "2024-08-29T08:16:25+00:00" + "time": "2024-09-20T08:28:38+00:00" }, { "name": "symfony/deprecation-contracts", @@ -3312,16 +3309,16 @@ }, { "name": "symfony/doctrine-messenger", - "version": "v7.1.4", + "version": "v7.1.5", "source": { "type": "git", "url": "https://github.com/symfony/doctrine-messenger.git", - "reference": "7f2a9262d7af3f892e49382b918e991af2ae0738" + "reference": "29015027fb63461e035246e07d74eeab9cb03304" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/doctrine-messenger/zipball/7f2a9262d7af3f892e49382b918e991af2ae0738", - "reference": "7f2a9262d7af3f892e49382b918e991af2ae0738", + "url": "https://api.github.com/repos/symfony/doctrine-messenger/zipball/29015027fb63461e035246e07d74eeab9cb03304", + "reference": "29015027fb63461e035246e07d74eeab9cb03304", "shasum": "" }, "require": { @@ -3364,7 +3361,7 @@ "description": "Symfony Doctrine Messenger Bridge", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/doctrine-messenger/tree/v7.1.4" + "source": "https://github.com/symfony/doctrine-messenger/tree/v7.1.5" }, "funding": [ { @@ -3380,20 +3377,20 @@ "type": "tidelift" } ], - "time": "2024-08-30T07:19:54+00:00" + "time": "2024-09-20T08:28:38+00:00" }, { "name": "symfony/dotenv", - "version": "v7.1.3", + "version": "v7.1.5", "source": { "type": "git", "url": "https://github.com/symfony/dotenv.git", - "reference": "a26be30fd61678dab694a18a85084cea7673bbf3" + "reference": "6d966200b399fa59759286f3fc7c919f0677c449" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dotenv/zipball/a26be30fd61678dab694a18a85084cea7673bbf3", - "reference": "a26be30fd61678dab694a18a85084cea7673bbf3", + "url": "https://api.github.com/repos/symfony/dotenv/zipball/6d966200b399fa59759286f3fc7c919f0677c449", + "reference": "6d966200b399fa59759286f3fc7c919f0677c449", "shasum": "" }, "require": { @@ -3438,7 +3435,7 @@ "environment" ], "support": { - "source": "https://github.com/symfony/dotenv/tree/v7.1.3" + "source": "https://github.com/symfony/dotenv/tree/v7.1.5" }, "funding": [ { @@ -3454,7 +3451,7 @@ "type": "tidelift" } ], - "time": "2024-07-09T19:36:07+00:00" + "time": "2024-09-17T09:16:35+00:00" }, { "name": "symfony/event-dispatcher", @@ -3614,16 +3611,16 @@ }, { "name": "symfony/filesystem", - "version": "v7.1.2", + "version": "v7.1.5", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "92a91985250c251de9b947a14bb2c9390b1a562c" + "reference": "61fe0566189bf32e8cfee78335d8776f64a66f5a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/92a91985250c251de9b947a14bb2c9390b1a562c", - "reference": "92a91985250c251de9b947a14bb2c9390b1a562c", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/61fe0566189bf32e8cfee78335d8776f64a66f5a", + "reference": "61fe0566189bf32e8cfee78335d8776f64a66f5a", "shasum": "" }, "require": { @@ -3660,7 +3657,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v7.1.2" + "source": "https://github.com/symfony/filesystem/tree/v7.1.5" }, "funding": [ { @@ -3676,20 +3673,20 @@ "type": "tidelift" } ], - "time": "2024-06-28T10:03:55+00:00" + "time": "2024-09-17T09:16:35+00:00" }, { "name": "symfony/mailer", - "version": "v7.1.2", + "version": "v7.1.5", "source": { "type": "git", "url": "https://github.com/symfony/mailer.git", - "reference": "8fcff0af9043c8f8a8e229437cea363e282f9aee" + "reference": "bbf21460c56f29810da3df3e206e38dfbb01e80b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mailer/zipball/8fcff0af9043c8f8a8e229437cea363e282f9aee", - "reference": "8fcff0af9043c8f8a8e229437cea363e282f9aee", + "url": "https://api.github.com/repos/symfony/mailer/zipball/bbf21460c56f29810da3df3e206e38dfbb01e80b", + "reference": "bbf21460c56f29810da3df3e206e38dfbb01e80b", "shasum": "" }, "require": { @@ -3740,7 +3737,7 @@ "description": "Helps sending emails", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/mailer/tree/v7.1.2" + "source": "https://github.com/symfony/mailer/tree/v7.1.5" }, "funding": [ { @@ -3756,20 +3753,20 @@ "type": "tidelift" } ], - "time": "2024-06-28T08:00:31+00:00" + "time": "2024-09-08T12:32:26+00:00" }, { "name": "symfony/messenger", - "version": "v7.1.4", + "version": "v7.1.5", "source": { "type": "git", "url": "https://github.com/symfony/messenger.git", - "reference": "e1dc743492ff9f1cfb23e6eea3592bf2ec9bd079" + "reference": "e1c0ced845e3dac12ab428c5ed42dbe7a58ca576" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/messenger/zipball/e1dc743492ff9f1cfb23e6eea3592bf2ec9bd079", - "reference": "e1dc743492ff9f1cfb23e6eea3592bf2ec9bd079", + "url": "https://api.github.com/repos/symfony/messenger/zipball/e1c0ced845e3dac12ab428c5ed42dbe7a58ca576", + "reference": "e1c0ced845e3dac12ab428c5ed42dbe7a58ca576", "shasum": "" }, "require": { @@ -3826,7 +3823,7 @@ "description": "Helps applications send and receive messages to/from other applications or via message queues", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/messenger/tree/v7.1.4" + "source": "https://github.com/symfony/messenger/tree/v7.1.5" }, "funding": [ { @@ -3842,20 +3839,20 @@ "type": "tidelift" } ], - "time": "2024-08-06T14:26:51+00:00" + "time": "2024-09-08T12:32:26+00:00" }, { "name": "symfony/mime", - "version": "v7.1.4", + "version": "v7.1.5", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "ccaa6c2503db867f472a587291e764d6a1e58758" + "reference": "711d2e167e8ce65b05aea6b258c449671cdd38ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/ccaa6c2503db867f472a587291e764d6a1e58758", - "reference": "ccaa6c2503db867f472a587291e764d6a1e58758", + "url": "https://api.github.com/repos/symfony/mime/zipball/711d2e167e8ce65b05aea6b258c449671cdd38ff", + "reference": "711d2e167e8ce65b05aea6b258c449671cdd38ff", "shasum": "" }, "require": { @@ -3910,7 +3907,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v7.1.4" + "source": "https://github.com/symfony/mime/tree/v7.1.5" }, "funding": [ { @@ -3926,7 +3923,7 @@ "type": "tidelift" } ], - "time": "2024-08-13T14:28:19+00:00" + "time": "2024-09-20T08:28:38+00:00" }, { "name": "symfony/options-resolver", @@ -4780,16 +4777,16 @@ }, { "name": "symfony/serializer", - "version": "v7.1.4", + "version": "v7.1.5", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", - "reference": "0158b0e91b7cf7e744a6fb9acaeb613d1ca40dbb" + "reference": "71d6e1f70f00752d1469d0f5e83b0a51716f288b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/0158b0e91b7cf7e744a6fb9acaeb613d1ca40dbb", - "reference": "0158b0e91b7cf7e744a6fb9acaeb613d1ca40dbb", + "url": "https://api.github.com/repos/symfony/serializer/zipball/71d6e1f70f00752d1469d0f5e83b0a51716f288b", + "reference": "71d6e1f70f00752d1469d0f5e83b0a51716f288b", "shasum": "" }, "require": { @@ -4803,12 +4800,14 @@ "symfony/dependency-injection": "<6.4", "symfony/property-access": "<6.4", "symfony/property-info": "<6.4", + "symfony/type-info": "<7.1.5", "symfony/uid": "<6.4", "symfony/validator": "<6.4", "symfony/yaml": "<6.4" }, "require-dev": { "phpdocumentor/reflection-docblock": "^3.2|^4.0|^5.0", + "phpstan/phpdoc-parser": "^1.0", "seld/jsonlint": "^1.10", "symfony/cache": "^6.4|^7.0", "symfony/config": "^6.4|^7.0", @@ -4824,7 +4823,7 @@ "symfony/property-access": "^6.4|^7.0", "symfony/property-info": "^6.4|^7.0", "symfony/translation-contracts": "^2.5|^3", - "symfony/type-info": "^7.1", + "symfony/type-info": "^7.1.5", "symfony/uid": "^6.4|^7.0", "symfony/validator": "^6.4|^7.0", "symfony/var-dumper": "^6.4|^7.0", @@ -4857,7 +4856,7 @@ "description": "Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON.", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/serializer/tree/v7.1.4" + "source": "https://github.com/symfony/serializer/tree/v7.1.5" }, "funding": [ { @@ -4873,7 +4872,7 @@ "type": "tidelift" } ], - "time": "2024-08-22T09:39:57+00:00" + "time": "2024-09-20T12:13:15+00:00" }, { "name": "symfony/service-contracts", @@ -5022,16 +5021,16 @@ }, { "name": "symfony/string", - "version": "v7.1.4", + "version": "v7.1.5", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "6cd670a6d968eaeb1c77c2e76091c45c56bc367b" + "reference": "d66f9c343fa894ec2037cc928381df90a7ad4306" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/6cd670a6d968eaeb1c77c2e76091c45c56bc367b", - "reference": "6cd670a6d968eaeb1c77c2e76091c45c56bc367b", + "url": "https://api.github.com/repos/symfony/string/zipball/d66f9c343fa894ec2037cc928381df90a7ad4306", + "reference": "d66f9c343fa894ec2037cc928381df90a7ad4306", "shasum": "" }, "require": { @@ -5089,7 +5088,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.1.4" + "source": "https://github.com/symfony/string/tree/v7.1.5" }, "funding": [ { @@ -5105,20 +5104,20 @@ "type": "tidelift" } ], - "time": "2024-08-12T09:59:40+00:00" + "time": "2024-09-20T08:28:38+00:00" }, { "name": "symfony/type-info", - "version": "v7.1.1", + "version": "v7.1.5", "source": { "type": "git", "url": "https://github.com/symfony/type-info.git", - "reference": "60b28eb733f1453287f1263ed305b96091e0d1dc" + "reference": "9f6094aa900d2c06bd61576a6f279d4ac441515f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/type-info/zipball/60b28eb733f1453287f1263ed305b96091e0d1dc", - "reference": "60b28eb733f1453287f1263ed305b96091e0d1dc", + "url": "https://api.github.com/repos/symfony/type-info/zipball/9f6094aa900d2c06bd61576a6f279d4ac441515f", + "reference": "9f6094aa900d2c06bd61576a6f279d4ac441515f", "shasum": "" }, "require": { @@ -5171,7 +5170,7 @@ "type" ], "support": { - "source": "https://github.com/symfony/type-info/tree/v7.1.1" + "source": "https://github.com/symfony/type-info/tree/v7.1.5" }, "funding": [ { @@ -5187,7 +5186,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:59:31+00:00" + "time": "2024-09-19T21:48:23+00:00" }, { "name": "symfony/var-exporter", @@ -5267,16 +5266,16 @@ }, { "name": "symfony/yaml", - "version": "v7.1.4", + "version": "v7.1.5", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "92e080b851c1c655c786a2da77f188f2dccd0f4b" + "reference": "4e561c316e135e053bd758bf3b3eb291d9919de4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/92e080b851c1c655c786a2da77f188f2dccd0f4b", - "reference": "92e080b851c1c655c786a2da77f188f2dccd0f4b", + "url": "https://api.github.com/repos/symfony/yaml/zipball/4e561c316e135e053bd758bf3b3eb291d9919de4", + "reference": "4e561c316e135e053bd758bf3b3eb291d9919de4", "shasum": "" }, "require": { @@ -5318,7 +5317,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v7.1.4" + "source": "https://github.com/symfony/yaml/tree/v7.1.5" }, "funding": [ { @@ -5334,7 +5333,7 @@ "type": "tidelift" } ], - "time": "2024-08-12T09:59:40+00:00" + "time": "2024-09-17T12:49:58+00:00" }, { "name": "twig/twig", @@ -5658,24 +5657,24 @@ }, { "name": "composer/semver", - "version": "3.4.2", + "version": "3.4.3", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6" + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/c51258e759afdb17f1fd1fe83bc12baaef6309d6", - "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6", + "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^1.4", - "symfony/phpunit-bridge": "^4.2 || ^5" + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^3 || ^7" }, "type": "library", "extra": { @@ -5719,7 +5718,7 @@ "support": { "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.2" + "source": "https://github.com/composer/semver/tree/3.4.3" }, "funding": [ { @@ -5735,7 +5734,7 @@ "type": "tidelift" } ], - "time": "2024-07-12T11:35:52+00:00" + "time": "2024-09-19T14:15:21+00:00" }, { "name": "composer/xdebug-handler", @@ -5887,16 +5886,16 @@ }, { "name": "felixfbecker/language-server-protocol", - "version": "v1.5.2", + "version": "v1.5.3", "source": { "type": "git", "url": "https://github.com/felixfbecker/php-language-server-protocol.git", - "reference": "6e82196ffd7c62f7794d778ca52b69feec9f2842" + "reference": "a9e113dbc7d849e35b8776da39edaf4313b7b6c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/6e82196ffd7c62f7794d778ca52b69feec9f2842", - "reference": "6e82196ffd7c62f7794d778ca52b69feec9f2842", + "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/a9e113dbc7d849e35b8776da39edaf4313b7b6c9", + "reference": "a9e113dbc7d849e35b8776da39edaf4313b7b6c9", "shasum": "" }, "require": { @@ -5937,9 +5936,9 @@ ], "support": { "issues": "https://github.com/felixfbecker/php-language-server-protocol/issues", - "source": "https://github.com/felixfbecker/php-language-server-protocol/tree/v1.5.2" + "source": "https://github.com/felixfbecker/php-language-server-protocol/tree/v1.5.3" }, - "time": "2022-03-02T22:36:06+00:00" + "time": "2024-04-30T00:40:11+00:00" }, { "name": "fidry/cpu-core-counter", diff --git a/www/resources/container.php b/www/resources/container.php index f0f21f2..69ea79e 100644 --- a/www/resources/container.php +++ b/www/resources/container.php @@ -19,4 +19,5 @@ $services->load('App\\Controller\\', __DIR__ . '/../src/Controller') ->public(); + $services->load('App\\Service\\', __DIR__ . '/../src/Service'); }; diff --git a/www/resources/examples/discriminator.json b/www/resources/examples/discriminator.json index d0f2922..9dd9681 100644 --- a/www/resources/examples/discriminator.json +++ b/www/resources/examples/discriminator.json @@ -1,7 +1,7 @@ { "definitions": { "Human": { - "type": "object", + "type": "struct", "properties": { "firstName": { "type": "string" @@ -10,29 +10,31 @@ "type": "string" }, "location": { - "oneOf": [{ - "$ref": "Web" - }, { - "$ref": "World" - }], - "discriminator": { - "propertyName": "type" - } + "type": "reference", + "target": "Location" } } }, "Location": { - "type": "object", + "type": "struct", + "base": true, "properties": { "type": { "type": "string" } }, - "required": ["type"] + "discriminator": "type", + "mapping": { + "Web": "web", + "World": "world" + } }, "Web": { - "$extends": "Location", - "type": "object", + "parent": { + "type": "reference", + "target": "Location" + }, + "type": "struct", "properties": { "url": { "type": "string" @@ -40,8 +42,11 @@ } }, "World": { - "$extends": "Location", - "type": "object", + "parent": { + "type": "reference", + "target": "Location" + }, + "type": "struct", "properties": { "lat": { "type": "string" @@ -52,5 +57,5 @@ } } }, - "$ref": "Human" + "root": "Human" } \ No newline at end of file diff --git a/www/resources/examples/generic.json b/www/resources/examples/generic.json index cdc9344..74f7feb 100644 --- a/www/resources/examples/generic.json +++ b/www/resources/examples/generic.json @@ -9,9 +9,13 @@ } }, "StudentMap": { - "$ref": "Map", - "$template": { - "T": "Student" + "type": "struct", + "parent": { + "type": "reference", + "target": "Map", + "template": { + "T": "Student" + } } }, "Map": { @@ -22,12 +26,13 @@ }, "entries": { "type": "array", - "items": { - "$generic": "T" + "schema": { + "type": "generic", + "name": "T" } } } } }, - "$ref": "StudentMap" + "root": "StudentMap" } \ No newline at end of file diff --git a/www/resources/examples/import.json b/www/resources/examples/import.json index 713020e..a19257e 100644 --- a/www/resources/examples/import.json +++ b/www/resources/examples/import.json @@ -1,5 +1,5 @@ { - "$import": { + "import": { "my_ns": "file:///generic.json" }, "definitions": { @@ -11,12 +11,13 @@ }, "students": { "type": "array", - "items": { - "$ref": "my_ns:StudentMap" + "schema": { + "type": "reference", + "target": "my_ns:StudentMap" } } } } }, - "$ref": "Faculty" + "root": "Faculty" } \ No newline at end of file diff --git a/www/resources/examples/inheritance.json b/www/resources/examples/inheritance.json index e54257d..1cd64cf 100644 --- a/www/resources/examples/inheritance.json +++ b/www/resources/examples/inheritance.json @@ -1,7 +1,7 @@ { "definitions": { "Human": { - "type": "object", + "type": "struct", "properties": { "firstName": { "type": "string" @@ -15,8 +15,11 @@ } }, "Student": { - "$extends": "Human", - "type": "object", + "parent": { + "type": "reference", + "target": "Human" + }, + "type": "struct", "properties": { "studentId": { "type": "string" @@ -24,5 +27,5 @@ } } }, - "$ref": "Student" + "root": "Student" } \ No newline at end of file diff --git a/www/resources/examples/map.json b/www/resources/examples/map.json index 50a45ed..d5b7d64 100644 --- a/www/resources/examples/map.json +++ b/www/resources/examples/map.json @@ -1,7 +1,7 @@ { "definitions": { "Student": { - "type": "object", + "type": "struct", "properties": { "firstName": { "type": "string" @@ -13,16 +13,17 @@ "type": "integer" }, "properties": { - "$ref": "Student_Properties" + "type": "reference", + "target": "Student_Properties" } } }, "Student_Properties": { - "type": "object", - "additionalProperties": { + "type": "struct", + "schema": { "type": "string" } } }, - "$ref": "Student" + "root": "Student" } \ No newline at end of file diff --git a/www/resources/examples/map_inline.json b/www/resources/examples/map_inline.json index 4cbfe8f..12fb674 100644 --- a/www/resources/examples/map_inline.json +++ b/www/resources/examples/map_inline.json @@ -1,7 +1,7 @@ { "definitions": { "Student": { - "type": "object", + "type": "struct", "properties": { "firstName": { "type": "string" @@ -13,13 +13,13 @@ "type": "integer" }, "properties": { - "type": "object", - "additionalProperties": { + "type": "map", + "schema": { "type": "string" } } } } }, - "$ref": "Student" + "root": "Student" } \ No newline at end of file diff --git a/www/resources/examples/reference.json b/www/resources/examples/reference.json index 00ee412..98120d9 100644 --- a/www/resources/examples/reference.json +++ b/www/resources/examples/reference.json @@ -1,7 +1,8 @@ { "definitions": { "Student": { - "type": "object", + "description": "A student struct with an assigned faculty", + "type": "struct", "properties": { "firstName": { "type": "string" @@ -13,12 +14,13 @@ "type": "integer" }, "faculty": { - "$ref": "Faculty" + "type": "reference", + "target": "Faculty" } } }, "Faculty": { - "type": "object", + "type": "struct", "properties": { "name": { "type": "string" @@ -26,5 +28,5 @@ } } }, - "$ref": "Student" + "root": "Student" } \ No newline at end of file diff --git a/www/resources/examples/simple.json b/www/resources/examples/simple.json index a472d85..82d0c69 100644 --- a/www/resources/examples/simple.json +++ b/www/resources/examples/simple.json @@ -1,7 +1,8 @@ { "definitions": { "Student": { - "type": "object", + "description": "A simple student struct", + "type": "struct", "properties": { "firstName": { "type": "string" @@ -15,5 +16,5 @@ } } }, - "$ref": "Student" + "root": "Student" } \ No newline at end of file diff --git a/www/resources/template/ecosystem.php b/www/resources/template/ecosystem.php index 32a6f07..eb0c26c 100644 --- a/www/resources/template/ecosystem.php +++ b/www/resources/template/ecosystem.php @@ -9,25 +9,153 @@

Ecosystem

-

The following page lists integrations, projects and libraries related to TypeSchema.

-

Integration

- -

Project

- -

Library

- +

The following page lists integrations, libraries and other projects related to TypeSchema.

+ + + +

Integration

+

+ + + + + + + + + + + + + + + + + + + + + + + + + +
NameGitHubLink
DockerGitHubDocker
GitHub ActionGitHubMarketplace
+ +

Library

+

+ + + + + + + + + + + + + + + + + +
NameDescription
psx-schemaA PHP library to parse and validate TypeSchema specifications
+ +

Frontend

+

+ + + + + + + + + + + + + + + + + +
NameDescription
ngx-typeschema-editorAn Angular component to visual edit a TypeSchema
+ +

Project

+

+ + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
TypeHubA service to manage and share TypeSchema specifications
TypeAPIAn OpenAPI alternative to describe REST APIs for type-safe code generation
SDKgenA service to generate client SDKs
Edit this page diff --git a/www/resources/template/example.php b/www/resources/template/example.php new file mode 100644 index 0000000..b2618e6 --- /dev/null +++ b/www/resources/template/example.php @@ -0,0 +1,49 @@ + + + + + +
+

examples

+ $example): ?> +
+
+
+

title; ?>

+
description; ?>
+
schema; ?>
+
+
+
+ types as $type => $code): ?> + + $chunk): ?> +
+

+
+
+ + +
+

Output

+
+
+ + +
+
+
+ + + +
+ + + + diff --git a/www/resources/template/faq.php b/www/resources/template/faq.php deleted file mode 100644 index ffdff82..0000000 --- a/www/resources/template/faq.php +++ /dev/null @@ -1,77 +0,0 @@ - - - - - -
-

FAQ

- -
-

What is the history?

-

We are the developers behind Fusio an open source API management - system. We wanted to build an SDK generator for different languages, which builds an SDK based on the - available schema. During this we have experienced the limitations of JSON Schema for code generators. Because of this - we have started to develop TypeSchema. A JSON format which can be easily transformed into code and also other - specification formats.

- -
-

What is your vision?

-

We envision a future where the code generation ecosystem just works. That means a user gets an TypeAPI document and - he is able to use this document to generate high quality code for either client or server implementations.

- -
-

How does the website work?

-

The complete website is also opensource, you can check out our repository - and take a look at the www folder, there is all code related to the website placed. If you want to take a look at the - code generator you can check out the generator repository.

- -
-

I have a question regarding the project?

-

You can contact us directly in case you have a question regarding - the project, or you can also take a look at our repository.

- -
-

Where can I get more information?

-

In our mission to improve code generation we write articles explaining our thoughts and background regarding - TypeSchema and the hole API and code generation ecosystem. If you are interested you can take a look at the following - articles:

- - -
-

What is the difference to JSON Schema?

- -

JSON Schema is a constraint system - which is designed to validate JSON data. Such a constraint system is not great for code generation, with TypeSchema - our focus is to model data to be able to generate high quality code.

- -

For code generators it is difficult to work with JSON Schema since it is designed to validate JSON data. In JSON - Schema you dont need to provide any keywords i.e. {} is a valid JSON Schema which basically allows every - value and the defined keywords are applied based on the actual data. This means you can interpret a schema only if you - have also the actual data. A code generator on the other hand needs to determine a concrete type of a schema without - the actual data.

- -

JSON Schema has many keywords which contain logic like dependencies, not, - if/then/else which are basically not needed for code generators and really complicates building them. We - have also explained some pitfalls in our - migration document.

- -

TypeSchema does not work with JSON pointer. In TypeSchema you reference every type simply by the name i.e. - Student. In JSON Schema you need to provide the path i.e. #/definitions/Student to the - schema. In TypeSchema you can also reference only local types. If you want to import a remote schema you need to - explicit declare it via $import.

- - -
- - diff --git a/www/resources/template/generator.php b/www/resources/template/generator.php new file mode 100644 index 0000000..ba725d1 --- /dev/null +++ b/www/resources/template/generator.php @@ -0,0 +1,30 @@ + + + + + +
+

DTO Generator

+

This list gives you access to the reference code generator implementation. + To prevent misuse the code generator is protected by recaptcha, if you want to invoke the code generator + programmatically please take a look at the SDKgen project + which offers various integration options like an CLI, GitHub action or REST API. +

+
+ +
+
+ $typeTitle): ?> + + +
+
+ +
+
+ + diff --git a/www/resources/template/generator/form.php b/www/resources/template/generator/form.php new file mode 100644 index 0000000..5bb56ac --- /dev/null +++ b/www/resources/template/generator/form.php @@ -0,0 +1,54 @@ + + + + + +
+

DTO Generator

+
+
+
+
+ +
+
+ +
+ +
+
+
+ +
+ + + +
+
+ + $chunk): ?> +
+

+
+
+ + +
+

Output

+
+
+ + +
+
+
+ + + + + + diff --git a/www/resources/template/generator/hash.php b/www/resources/template/generator/hash.php deleted file mode 100644 index 41df02f..0000000 --- a/www/resources/template/generator/hash.php +++ /dev/null @@ -1,34 +0,0 @@ - - - - - -
-

Hash

- -
-
-
-
- - -
- -
-
-
-
-
-
-
- - - - diff --git a/www/resources/template/generator/schema.php b/www/resources/template/generator/schema.php deleted file mode 100644 index 340755a..0000000 --- a/www/resources/template/generator/schema.php +++ /dev/null @@ -1,41 +0,0 @@ - - - - - -
-

Schema

- -
-
-
-
- - -
-
- - -
- -
-
-
-
-
-
-
- - - - diff --git a/www/resources/template/history.php b/www/resources/template/history.php new file mode 100644 index 0000000..fd6850e --- /dev/null +++ b/www/resources/template/history.php @@ -0,0 +1,74 @@ + + + + + +
+

History

+

TypeSchema has evolved while developing a new Swagger/OpenAPI code generator. + During this development process we have noticed many problems + which a code generator needs to solve in + order to generate clean code. We have tried to solve those problems and over time TypeSchema has evolved into a separate specification which describes JSON payloads + and is optimized for code generation.

+ +

Type-safe programming languages

+

If we look at the history of programming languages we see a trend towards type-safety. Besides strongly typed programming languages + like Java, C# and Go which are automatically type-safe also weakly typed languages have added support for more type-safety, like i.e. + PHP, Python and even Ruby which have all improved and added support for type-hints, for JavaScript Microsoft has even developed + TypeScript which adds type-safety to JavaScript.

+ +

A big reason for this trend is that type-safe applications make it easier to find or prevent bugs. + Since at you code you always have explicit properties which you can access and in case the schema changes your will directly + get an error, that the property no longer exist.

+ +

TypeSchema can help you to build those type-safe applications by automatically generating clean DTOs to represent JSON payload.

+ +

Thought model

+

TypeSchema has a specific thought model which fits perfectly with classical OOP languages like Java, C#, PHP or TypeScript. + But it supports also languages like Go, which have a different approach. In this case the generator will try to apply these concepts on + generation so that you can still use them at the specification. For example Go does not support inheritance, in this case the code generator + copies all inherited properties into the structure.

+ +
    +
  • TypeSchema is designed to model data structures
  • +
  • TypeSchema abstracts OOP concepts like inheritance, polymorphism and generics
  • +
  • TypeSchema encourages code-first, this means it is easy possible to generate a TypeSchema through reflection without additional annotations
  • +
  • TypeSchema has no keywords to validate data
  • +
+ +

What is the difference to JSON Schema?

+

JSON Schema is a constraint system + which is designed to validate JSON data. Such a constraint system is not great for code generation, with TypeSchema + our focus is to model data to be able to generate high quality code.

+ +

For code generators it is difficult to work with JSON Schema since it is designed to validate JSON data. In JSON + Schema you dont need to provide any keywords i.e. {} is a valid JSON Schema which basically allows every + value and the defined keywords are applied based on the actual data. This means you can interpret a schema only if you + have also the actual data. A code generator on the other hand needs to determine a concrete type of a schema without + the actual data.

+ +

JSON Schema has many keywords which contain logic like dependencies, not, + if/then/else which are basically not needed for code generators and really complicates building them.

+ +

TypeSchema does not work with JSON pointer. In TypeSchema you reference every type simply by the name i.e. + Student. In JSON Schema you need to provide the path i.e. #/definitions/Student to the + schema. In TypeSchema you can also reference only local types. If you want to import a remote schema you need to + explicit declare it via import.

+ +

I have a problem with the generated code?

+

In case there are problems with the generated code you can always create an issue at our repository.

+ +

I have a question regarding the project?

+

You can contact us directly in case you have a question regarding + the project, or you can also take a look at our repository.

+ + +
+ + diff --git a/www/resources/template/inc/header.php b/www/resources/template/inc/header.php index 7d899b5..dc3d087 100644 --- a/www/resources/template/inc/header.php +++ b/www/resources/template/inc/header.php @@ -3,14 +3,18 @@ - - - TypeSchema + + + <?php if(isset($title)): ?><?php echo $title; ?><?php else: ?>TypeSchema<?php endif; ?> - + + + + +