Giter VIP home page Giter VIP logo

Comments (5)

daveshanley avatar daveshanley commented on May 26, 2024 2

This is a missing feature rather than a bug, it's the same problem as #230 vacuum needs more intelligence to detect this.

In regard to the update for #230 this is high on the list of fixes I want to make in the next round of updates, that should be coming along soon, I am working on some other tooling at the moment.

from vacuum.

daveshanley avatar daveshanley commented on May 26, 2024

Please try v0.1.0 and let me know how you get on.

from vacuum.

sezgigumus avatar sezgigumus commented on May 26, 2024

Hi @daveshanley thanks for quick fix

Now, I get a circular-references error after using 0.1.0 version. Please see the example:

Command: vacuum report v1/routes.yaml -p v1

v1/routes.yaml

components:
  schema:
    testSchema:
      type: object
      metadata:
        $ref: >-
          ../base-yaml#/components/schemas/metadata

base.yaml

components:
  schema:
    metadata:
      type: object
      properties:
        data1:
          type: string
          description: data 1
        data2:
          type: string
          description: data 2

The error that I get:

  {
      "message": "cannot resolve reference `../base.yaml#/components/schemas/metadata`, it's missing: $components.schemas['metadata'] [...:..]",
      "range": {
          ...
      },
      "path": "$components.schemas['metadata']",
      "ruleId": "circular-references",
      "ruleSeverity": "error"
  }

Could you please tell me if there is any problem on my side or if it is a bug in this version? Thanks

from vacuum.

daveshanley avatar daveshanley commented on May 26, 2024

Hi @sezgigumus

What you're now seeing is improved detection for missing references or un-resolved references. This is supposed to happen, before these bad refs were not being reported.

However what is wrong here, is that the rule is marked as 'circular-references' it should not be lumped into that category. I will fix that to be something appropriate, however the error is accurate.

To use local / remote or relative references, use the -p / --base flag to set a base directory or URL for vacuum to use to look up the references.

https://quobix.com/vacuum/commands/lint/

Thanks

from vacuum.

daveshanley avatar daveshanley commented on May 26, 2024

I cleaned up the rule for reporting circular references and resolving issues in v0.1.1

from vacuum.

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.