diff --git a/composer.json b/composer.json index d425e49..e231159 100644 --- a/composer.json +++ b/composer.json @@ -14,6 +14,12 @@ "homepage": "https://jolicode.com/" } ], + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/Korbeil/jane-v8" + } + ], "require": { "php": ">=8.0", "ext-json": "*", @@ -22,13 +28,12 @@ "symfony/deprecation-contracts": "^2.4 || ^3.0", "symfony/property-access": "^5.4 || ^6.0", "symfony/property-info": "^5.4 || ^6.0", - "symfony/serializer": "^5.4 || ^6.0", - "symfony/yaml": "^5.4 || ^6.0" + "symfony/serializer": "^7.0", + "symfony/yaml": "^7.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.17.0", - "jane-php/json-schema": "^7.4", - "jane-php/json-schema-runtime": "^7.4", + "jane-php/jane-php": "@dev", "phpstan/phpstan": "^1.9", "symfony/browser-kit": "^5.4 || ^6.0", "symfony/framework-bundle": "^5.4.17 || ^6.0", diff --git a/tests/Jane/JaneTest.php b/tests/Jane/JaneTest.php index 35e4373..4a2ccf7 100644 --- a/tests/Jane/JaneTest.php +++ b/tests/Jane/JaneTest.php @@ -13,9 +13,8 @@ namespace JoliCode\Elastically\Tests\Jane; -use Jane\Component\JsonSchema\Console\Command\GenerateCommand; -use Jane\Component\JsonSchema\Console\Loader\ConfigLoader; -use Jane\Component\JsonSchema\Console\Loader\SchemaLoader; +use Jane\Component\JsonSchemaGenerator\Configuration; +use Jane\Component\JsonSchemaGenerator\Generator; use JoliCode\Elastically\Client; use JoliCode\Elastically\IndexBuilder; use JoliCode\Elastically\Indexer; @@ -28,8 +27,6 @@ use JoliCode\Elastically\Tests\Jane\generated\Model\MyModelIngredientsItemAnyOf; use JoliCode\Elastically\Tests\Jane\generated\Normalizer\JaneObjectNormalizer; use PHPUnit\Framework\TestCase; -use Symfony\Component\Console\Input\ArrayInput; -use Symfony\Component\Console\Output\NullOutput; use Symfony\Component\Serializer\Encoder\JsonDecode; use Symfony\Component\Serializer\Encoder\JsonEncode; use Symfony\Component\Serializer\Encoder\JsonEncoder; @@ -41,12 +38,11 @@ class JaneTest extends TestCase public function testCreateIndexAndSearchWithJaneObject() { // Build the models - $command = new GenerateCommand(new ConfigLoader(), new SchemaLoader()); - $inputArray = new ArrayInput([ - '--config-file' => __DIR__ . '/jane-config.php', - ], $command->getDefinition()); - - $command->execute($inputArray, new NullOutput()); + $generator = new Generator(new Configuration( + outputDirectory: __DIR__ . '/generated/', + baseNamespace: 'JoliCode\\Elastically\\Tests\\Jane\\generated', + )); + $generator->fromPath(__DIR__ . '/schema.json', 'MyModel'); // Build the Serializer $normalizers = [ diff --git a/tests/Jane/jane-config.php b/tests/Jane/jane-config.php deleted file mode 100644 index f77407b..0000000 --- a/tests/Jane/jane-config.php +++ /dev/null @@ -1,18 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return [ - 'json-schema-file' => __DIR__ . '/schema.json', - 'root-class' => 'MyModel', - 'namespace' => 'JoliCode\Elastically\Tests\Jane\generated', - 'directory' => __DIR__ . '/generated', - 'clean-generated' => false, -]; diff --git a/tests/SearchTest.php b/tests/SearchTest.php index bdaba10..ac4ad52 100644 --- a/tests/SearchTest.php +++ b/tests/SearchTest.php @@ -134,6 +134,8 @@ public function supportsDenormalization($data, $type, $format = null, array $con public function serialize(mixed $data, string $format, array $context = []): string {} public function deserialize(mixed $data, string $type, string $format, array $context = []): mixed {} + + public function getSupportedTypes(?string $format): array {} } class SearchTestDto