Git Product home page Git Product logo

Comments (7)

dpopp07 avatar dpopp07 commented on September 26, 2024 2

🎉 This issue has been resolved in version 0.10.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

from openapi-validator.

jammi avatar jammi commented on September 26, 2024 1

Actually, forget that. It was a mistake on my end. I passed the parent object of it within a dynamic transformation. Maybe it should rather throw an error about the document not really being an openapi document. I’ll supply an example later.

from openapi-validator.

jammi avatar jammi commented on September 26, 2024

When used programmatically, it seems to have issues resolving refs on documents it otherwise validates fine, such as:
SyntaxError: Error resolving $ref pointer "/path/to/cwd/#/components/schemas/ref_thing".

from openapi-validator.

dpopp07 avatar dpopp07 commented on September 26, 2024

@jammi Interesting... you mean it works fine from the command line but fails if you run in as an imported module within code?

from openapi-validator.

apestov avatar apestov commented on September 26, 2024

Just would like to confirm the original problem statement with relative paths refs.
(If go with the assumption that expected starting point for relative path is document).

Version: ibm-openapi-validator-0.10.2

Launch option Execution result
$ npx lint-openapi subdir/main.yaml
[Error] There is a problem with the Swagger.
Error opening file "C:\example\schema.yaml
ENOENT: no such file or directory, open 'C:\example\schema.yaml
$ cd subdir && npx lint-openapi main.yaml
(some validation result)

Files

subdir/main.yml

openapi: 3.0.0
paths:
  /example:
    get:
      summary: Summary
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "./schema.yaml#/components/schemas/SchemaDef"

subdir/schema.yaml

openapi: 3.0.0
paths: {}
components:
  schemas:
    SchemaDef:
      type: object

from openapi-validator.

dpopp07 avatar dpopp07 commented on September 26, 2024

@dhudlow @apestov I am going to look at this issue this week

from openapi-validator.

dpopp07 avatar dpopp07 commented on September 26, 2024

Update: I identified the source of this issue. There are some challenges to work out but I hope to have a fix out sometime this coming week

from openapi-validator.

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.