Code Monkey home page Code Monkey logo

Comments (4)

cebe avatar cebe commented on August 21, 2024 1

This should be fixed by #30, thanks for reporting! The spec you linked showed off a lot of issues that existed in the code. Should work much better now.

from php-openapi.

cebe avatar cebe commented on August 21, 2024

Thanks for reporting, I will look into this.

Just to confirm, when I try to load the JSON file you specify I get that error:

Fatal error: Uncaught TypeError: Argument 1 passed to cebe\openapi\ReferenceContext::resolveRelativeUri() must be of the type string, null given, called in /tmp/test/vendor/cebe/php-openapi/src/spec/Reference.php on line 139 and defined in /tmp/test/vendor/cebe/php-openapi/src/ReferenceContext.php on line 77

TypeError: Argument 1 passed to cebe\openapi\ReferenceContext::resolveRelativeUri() must be of the type string, null given, called in /tmp/test/vendor/cebe/php-openapi/src/spec/Reference.php on line 139 in /tmp/test/vendor/cebe/php-openapi/src/ReferenceContext.php on line 77

Call Stack:
    0.0001     360784   1. {main}() /tmp/test/test.php:0
    0.0009     453776   2. cebe\openapi\Reader::readFromJsonFile() /tmp/test/test.php:7
    0.9087    4320888   3. cebe\openapi\spec\OpenApi->resolveReferences() /tmp/test/vendor/cebe/php-openapi/src/Reader.php:72
    0.9088    4320888   4. cebe\openapi\spec\Paths->resolveReferences() /tmp/test/vendor/cebe/php-openapi/src/SpecBaseObject.php:295
    0.9256    4183648   5. cebe\openapi\spec\PathItem->resolveReferences() /tmp/test/vendor/cebe/php-openapi/src/spec/Paths.php:228
    0.9256    4183648   6. cebe\openapi\spec\Operation->resolveReferences() /tmp/test/vendor/cebe/php-openapi/src/SpecBaseObject.php:295
    0.9256    4183648   7. cebe\openapi\spec\RequestBody->resolveReferences() /tmp/test/vendor/cebe/php-openapi/src/SpecBaseObject.php:295
    0.9256    4183648   8. cebe\openapi\spec\MediaType->resolveReferences() /tmp/test/vendor/cebe/php-openapi/src/SpecBaseObject.php:301
    0.9256    4183648   9. cebe\openapi\spec\Reference->resolve() /tmp/test/vendor/cebe/php-openapi/src/SpecBaseObject.php:293
    0.9256    4183648  10. cebe\openapi\ReferenceContext->resolveRelativeUri() /tmp/test/vendor/cebe/php-openapi/src/spec/Reference.php:139

is this the same error you are seeing?

from php-openapi.

githubuser441 avatar githubuser441 commented on August 21, 2024

Yes, also I just noticed a typo in the readme:
$openapi = Reader::readFromYamlFile(realpath('openapi.json'));
You see it's loading json with yaml function.

from php-openapi.

cebe avatar cebe commented on August 21, 2024

seems their spec has some interesting constructs.

  1. references that have additional properties
  2. recursive schema definitions

both cause multiple issues when loading and validating the spec.

from php-openapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.