GithubHelp home page GithubHelp logo

raml-cop's Introduction

raml-cop's People

Contributors

darkrodry avatar thebinarypenguin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

raml-cop's Issues

Output RAML

Is it possible to output RAML as well as JSON, in order to generate a single RAML file with external files, such as schema and examples?

Validation of examples

raml-cop doesn't appear to validate examples, at least not the pattern-controlled types that I just tried.

Re-org code after discovery of warnings

When raml-cop was originally written it was only checking for one type of issue (errors) but after PR #11 it now checks for two types of issues (errors and warnings). As a result the code is now a little disorganized.

For example

  • errorsToReport should be renamed to issuesToReport
  • Issue messages should be prepended with a word like ERR or WARN so that SublimeLinter-contrib-raml-cop can pick up on it.
  • and more...

Report the raml filename at end of processing if there are issuesToReport

When raml-cop processes a valid file then it gives a green "VALID" message and shows the filename.

When there are problems with the raml or schema or examples, then raml-cop reports each of those and gives a clue about which file is the origin.

However it would be useful to also report the outer RAML filename at the end with a yellow "Has issues" or some such.

It is not really needed when only processing one file. But when doing raml-cop *.raml it can be difficult to know which raml file had the problems. Normally one can get a clue from the individual messages, but when the issues arise from "example" files, then sometimes the messages do not tell which raml file has the issues.

Cannot read property 'absolutePath' of null

I believe there is a problem parsing !include statements. Here's some example RAML for testing:

api.raml

#%RAML 1.0
title: AwesomeAPI
version: v1
baseUri: https://awesome.api
mediaType: application/json

types:
  UUID: !include UUID.raml

UUID.raml

#%RAML 1.0 DataType
displayName: Universally Unique Identifier
type: string
example: 9922f203-641e-4e60-9729-78547f67b68b
pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on Greenkeeper branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please click the 'fix repo' button on account.greenkeeper.io.

Validation of JSON Schemas does not respect Draft 07

Hi,

I am using JSON schemas imported into my RAML and RAML-COP is giving out warnings due to invalid JSON schema.

After some search I realized that it must be using an old draft and not respecting the $schema parameter that states the use of draft 7 ("$schema": "http://json-schema.org/draft-07/schema#").

Example output:

[../../schemas/order_specification.json:371:28] WARNING Invalid JSON schema: Keyword 'exclusiveMinimum' is expected to be of type 'boolean'
[api.raml:30:12] WARNING Invalid JSON schema: Keyword 'exclusiveMinimum' is expected to be of type 'boolean'
[examples/order_251985.json:698:0] WARNING Invalid JSON schema: Keyword 'exclusiveMinimum' is expected to be of type 'boolean'
[examples/order_251985.json:96:4] WARNING Draft 3 schema must have boolean as 'required' property value
[examples/order_251985.json:110:12] WARNING Draft 3 schema must have boolean as 'required' property value
[examples/order_251985.json:125:7] WARNING Draft 3 schema must have boolean as 'required' property value
[examples/order_251985.json:158:20] WARNING Draft 3 schema must have boolean as 'required' property value
[examples/order_251985.json:184:28] WARNING Draft 3 schema must have boolean as 'required' property value
[examples/order_251985.json:232:20] WARNING Draft 3 schema must have boolean as 'required' property value
[examples/order_251985.json:316:16] WARNING Draft 3 schema must have boolean as 'required' property value
[examples/order_251985.json:391:28] WARNING Draft 3 schema must have boolean as 'required' property value
[examples/order_251985.json:410:12] WARNING Draft 3 schema must have boolean as 'required' property value
[examples/order_251985.json:456:1] WARNING Draft 3 schema must have boolean as 'required' property value
[examples/order_251985.json:482:4] WARNING Draft 3 schema must have boolean as 'required' property value
[examples/order_251985.json:571:8] WARNING Draft 3 schema must have boolean as 'required' property value
[examples/order_251985.json:698:0] WARNING Draft 3 schema must have boolean as 'required' property value

raml-cop stoped working after 1.1.25 version of raml-1-parser released

Hi, I use raml-cop in my CI jobs. After new release (1.1.25) of raml-1-parser raml-cop throws an error

Error: Cannot find module 'raml-1-parser'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/???/raml-cop/src/raml-cop.js:9:19)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:427:7)
    at startup (bootstrap_node.js:151:9)
    at bootstrap_node.js:542:3

Steps to reproduce:

1. npm install raml-cop --silent
2. node_modules/raml-cop/src/raml-cop.js .raml/api.raml

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.