Comments (4)
Looks like this is fixed in dev-master, so it will be fixed by upgrading to 1.5.2, which I'll release today.
Thanks @marcelthole for checking.
from php-openapi.
i tried the example from @vdelau and can't reproduce the error with the latest dev-master version.
Repro:
composer require cebe/php-openapi
- use 5G Apis yaml files (in my example from https://github.com/WhyBingo/5GC_APIs)
- use the provided snipped.php
-> I got the same error
Fix:
composer require cebe/php-openapi:dev-master
-> No errors anymore.
In the second example from @samizdam i have the same result.
git clone https://github.com/FreeElephants/json-api-php-toolkit.git
git checkout a9e501736a6da9fbc9a6c82cbfec60cd7d9442ad
composer install
vendor/bin/phpunit
-> I got the same error
if i require "cebe/php-openapi": "dev-master"
and run the phpunit tests i got no errors anymore.
In that case a new tag for cebe/php-openapi 1.5.2
should fix the errors in this example.
Each package maintainer that requires cebe/php-openapi could add the following in the composer.json
"conflict": {
"cebe/php-openapi": "1.5.0 || 1.5.1"
}
from php-openapi.
I'm not sure I understand the original issue correctly, but I think I'm running into the same issue here. I'm trying to load a file from this repository (and branch): https://forge.etsi.org/rep/3GPP/5G_APIs/tree/REL-16
This is the simple snippet I'm using to do this, where ../specs/5G_APIs is a clone of the above repository:
<?php
require_once __DIR__ . '/../vendor/autoload.php';
use cebe\openapi\Reader;
$specfile = realpath(__DIR__ . '/../specs/5G_APIs/TS32291_Nchf_OfflineOnlyCharging.yaml');
$openapi = Reader::readFromYamlFile($specfile);
This fails with the following exception:
D:\Development\opt\php-8.0.0\php.exe D:\Development\PHP\5g_api\bin\generator.php
PHP Fatal error: Uncaught cebe\openapi\json\NonexistentJsonPointerReferenceException: Failed to evaluate pointer '/components/schemas/Tai'. Array has no member Tai at path '/components/schemas'. in D:\Development\PHP\5g_api\vendor\cebe\php-openapi\src\json\JsonPointer.php:116
Stack trace:
#0 D:\Development\PHP\5g_api\vendor\cebe\php-openapi\src\spec\Reference.php(199): cebe\openapi\json\JsonPointer->evaluate(Object(cebe\openapi\spec\OpenApi))
#1 D:\Development\PHP\5g_api\vendor\cebe\php-openapi\src\SpecBaseObject.php(391): cebe\openapi\spec\Reference->resolve(Object(cebe\openapi\ReferenceContext))
#2 D:\Development\PHP\5g_api\vendor\cebe\php-openapi\src\SpecBaseObject.php(397): cebe\openapi\SpecBaseObject->resolveReferences(NULL)
#3 D:\Development\PHP\5g_api\vendor\cebe\php-openapi\src\SpecBaseObject.php(394): cebe\openapi\SpecBaseObject->resolveReferences()
#4 D:\Development\PHP\5g_api\vendor\cebe\php-openapi\src\SpecBaseObject.php(394): cebe\openapi\SpecBaseObject->resolveReferences()
#5 D:\Development\PHP\5g_api\vendor\cebe\php-openapi\src\SpecBaseObject.php(384): cebe\openapi\SpecBaseObject->resolveReferences()
#6 D:\Development\PHP\5g_api\vendor\cebe\php-openapi\src\SpecBaseObject.php(397): cebe\openapi\SpecBaseObject->resolveReferences(NULL)
#7 D:\Development\PHP\5g_api\vendor\cebe\php-openapi\src\SpecBaseObject.php(384): cebe\openapi\SpecBaseObject->resolveReferences()
#8 D:\Development\PHP\5g_api\vendor\cebe\php-openapi\src\SpecBaseObject.php(397): cebe\openapi\SpecBaseObject->resolveReferences(NULL)
#9 D:\Development\PHP\5g_api\vendor\cebe\php-openapi\src\SpecBaseObject.php(384): cebe\openapi\SpecBaseObject->resolveReferences()
#10 D:\Development\PHP\5g_api\vendor\cebe\php-openapi\src\SpecBaseObject.php(397): cebe\openapi\SpecBaseObject->resolveReferences(NULL)
#11 D:\Development\PHP\5g_api\vendor\cebe\php-openapi\src\SpecBaseObject.php(387): cebe\openapi\SpecBaseObject->resolveReferences(NULL)
#12 D:\Development\PHP\5g_api\vendor\cebe\php-openapi\src\SpecBaseObject.php(387): cebe\openapi\SpecBaseObject->resolveReferences(NULL)
#13 D:\Development\PHP\5g_api\vendor\cebe\php-openapi\src\spec\PathItem.php(194): cebe\openapi\SpecBaseObject->resolveReferences(NULL)
#14 D:\Development\PHP\5g_api\vendor\cebe\php-openapi\src\spec\Paths.php(254): cebe\openapi\spec\PathItem->resolveReferences(NULL)
#15 D:\Development\PHP\5g_api\vendor\cebe\php-openapi\src\SpecBaseObject.php(387): cebe\openapi\spec\Paths->resolveReferences(NULL)
#16 D:\Development\PHP\5g_api\vendor\cebe\php-openapi\src\Reader.php(134): cebe\openapi\SpecBaseObject->resolveReferences()
#17 D:\Development\PHP\5g_api\bin\generator.php(7): cebe\openapi\Reader::readFromYamlFile('D:\\Development\\...')
#18 {main}
Based on the issue, I've downgraded to 1.4.2 and that executes without a problem.
from php-openapi.
After upgrade to 1.5.1 I'm get cebe\openapi\exceptions\UnresolvableReferenceException
on reference in referenced file:
https://github.com/FreeElephants/json-api-php-toolkit/runs/2539120065?check_suite_focus=true#step:9:15
from php-openapi.
Related Issues (20)
- Symfony 6 support HOT 2
- Missing functions to remove elements ? HOT 1
- Referenced Parameters compiling to Object instead of Array HOT 4
- Major Performance issue even with new caching? HOT 6
- Speccy uses dompurify with XSS vulnerability HOT 5
- Add a way to create schemas HOT 1
- Add (or document how to) read schema properties HOT 4
- Reference parsing doesn't work in the CLI tool using relative paths. HOT 3
- Wrong error message when using an undefined property for a schema object property definition HOT 1
- Convert the code-base to use Symfony Console HOT 1
- Make `symfony/yaml` dependency optional
- References to incorrect components should be considered invalid HOT 1
- Unable to reference other local json file HOT 2
- Duplicate OperationIds should be considered invalid
- Support for PHP 8.1 and 8.2 HOT 1
- Further library maintenance HOT 9
- Discriminator mapping throws validation error on valid discriminator mapping and accepts incorrect one. HOT 1
- Add support for symfony/yaml version ^7 HOT 3
- Nexmo/api-specification no longer exists HOT 2
- Security vulnerabilities funded by trivy
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-openapi.