php-code-builder icon indicating copy to clipboard operation
php-code-builder copied to clipboard

path error and example run failed

Open Dadinos opened this issue 3 years ago • 1 comments

I try to use the example.php as a first learning point. Later I will use my own JSON.

After a first compuser update I got: .... Generating autoload files 3 packages you are using are looking for funding. Use the composer fund command to find out more! > patch -N -s -p0 < ./tests/phpunit.patch Het systeem kan het opgegeven pad niet vinden. Script patch -N -s -p0 < ./tests/phpunit.patch handling the post-update-cmd event returned with error code 1

I'm using php 7.4 and the example itself returns:

php -f example.php

Fatal error: Uncaught Swaggest\JsonSchema\Exception\LogicException: No valid results for anyOf { 0: Malformed URI at #->anyOf[0]->properties:$ref 1: Array expected, {"definitions":{"info":{"properties":{"lastName":{"type":"string"},"birthDate":{"type":"string","format":"date"},"options":{"$ref":"#/definitions/options"}},"type":"object"},"options":{"properties":{"rememberSession":{"type":"boolean"},"allowNotifications":{"type":"boolean"}},"type":"object"}},"properties":{"id":{"type":"integer"},"name":{"type":"string"},"parent":{"$ref":"#"},"children":{"$ref":"#"},"info":{"$ref":"#/definitions/info"}},"type":"object","$ref":"#"} received at #->anyOf[1] } in D:\commonground\php-code-builder-master\vendor\swaggest\json-schema\src\Schema.php:510 Stack trace: #0 D:\commonground\php-code-builder-master\vendor\swaggest\json-schema\src\Schema.php(1228): Swaggest\JsonSchema\Schema->processAnyOf() #1 D:\commonground\php-code-builder-master\vendor\swaggest\json-schema\src\Schema.php(1145): Swaggest\JsonSchema\Schema->process( in D:\commonground\php-code-builder-master\vendor\swaggest\json-schema\src\Schema.php on line 510

Is this because of the PHP version?

Dadinos avatar Jan 21 '22 12:01 Dadinos

Hi, this error looks weird. Is it happening with unmodified example.php from master? PHP 5.6 and later (including 7.4 and 8.1) should work equally well.

Could you pull latest master and try again? If the error still happens please share full stacktrace (starting from example.php).

vearutop avatar Jan 23 '22 22:01 vearutop

Not sure if this is still relevant, please reopen if it is.

vearutop avatar Dec 18 '23 16:12 vearutop