Git Product home page Git Product logo

apigility-raml-validator's Introduction

apigility-raml-validator

Build Status License

This is a tool to help validate your Apigility implementation against a RAML specification. This way you can make sure the implementation matches the specification requirements.

In comparison with similar tools this application does not check the output of the api but the code structure directly.

Please note that this tool is in early stages of development.

Table of contents

Installation

composer require --dev "robertboloc/apigility-raml-validator"
chmod +x vendor/bin/apigility-raml-validator

Usage

vendor/bin/apigility-raml-validator [--help] [-s spec, --spec spec] [-p project, --project project]

Options

spec (-s | --spec)

Path to the RAML specification file

target (-p | --project)

Path to the Apigility project containing the source code

module (-m | --module)

Hint the name of the module in case it's different from the API name

help (--help)

Display the usage message

debug (--debug)

Enable debug messages when running the application

Validation

This is the list of fields from the RAML specification currently being validated

RAML Apigility
title Check a module matching title exists
version Check a version folder matching version exists
resource * Check a route has been defined for the resource
method Check a collection route implements the methods of a top resource

* only top level resources are detected for now

Example

Highlighted in green are the lines of the RAML specification currently being validated against the implementation

  #%RAML 1.0
+ title: Test
+ version: v1
- protocols: HTTPS
- mediaType: application/json
- baseUri: https://api.test.com/{version}
- description: My Test API

+ /foo:
+   get:
+     description: My test endpoint

+ /bar:
+   post:
+     description: Another test endpoint

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.