Git Product home page Git Product logo

Comments (5)

dpopp07 avatar dpopp07 commented on June 24, 2024

I like this idea. I only added the --print_validator_modules option to be helpful in development but that was before the configuration support and names for all of the rules, etc. I don't expect it to be of any help to users and it really doesn't do much for the developer anymore either. It will be removed in a future release.

As for the --print_validator_name feature, I'm in support of it. I can see its usefulness in mapping back to the configuration file. I think I would prefer using the word "rule" instead of "validator" since that's the naming convention we use in the documentation but that's a small detail.

One thing to note is, not all validations have a "name" that maps back into a configuration rule. There are some rules that are so basic and fundamental to the OpenAPI spec that we don't bother documenting them or making them configurable (example). This isn't a deal-breaker of course but we would want to think about what to print for the output for these cases.

As always, you are more than welcome to write a PR for this! If you are unable, I can try to look at it in the coming weeks. Thanks for the issue

from openapi-validator.

aspear avatar aspear commented on June 24, 2024

--print_rule_name ? No opinion here, whatever you think is intuitive.

Perhaps for those validations you mention above we can make up a name for them that follows a pattern, e.g. "builtin_xxxxx" where and then simply document that it is not possible to turn builtin_* rules off or something like that. I am guessing that implementing this will require adding an additional field to the JSON result object in each individual test? I suppose it will be easy enough since in the place where the test is run you are checking for the config enabling the test anyway so the string is right there.

As an FYI, I am currently writing an API validation SaaS offering and associated command line tools that will be used internally inside of VMware for API specifications across the company. We have many different APIs and lots of different legacy APIs that have their own way of doing things, so flexibility is key. Right now I am planning on spawning/calling lint-openapi from this service as a major part of the API validation. This is driving my desire for the --json option as well as the --print_rule_names and such. This service itself may end up being open source (I am pushing for this)

from openapi-validator.

mkistler avatar mkistler commented on June 24, 2024

@aspear I want to echo @dpopp07 and say thanks for the interest and contributions. From the beginning our goal was to create a configurable and extensible linter for OpenAPI documents, so all contributions in this spirit are welcome!

from openapi-validator.

jorge-ibm avatar jorge-ibm commented on June 24, 2024

We should evaluate the open pr that Barrett openend.

from openapi-validator.

mkistler avatar mkistler commented on June 24, 2024

Fixed in #44.

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.