Sample RAML File Fomat

RAML file stands for REST ful API Modeling Language which is an open specification language. It is built on YAML 1.2. It makes it easy to manage the whole of the lifecycle of API. From design to sharing the whole of the things can be managed.

It greatly enhances and encourages ever-better API platforms. The way of writing RAML is as follows.

The starting of the RAML file is done with a declaration which indicates the format. After that, there is a need to define the available resources. Moreover one needs to define the HTTP method, describing the response and query parameters. With the help of the API editor, the sample RAML file can be easily edited with auto-completion. For using AnyPoint a user needs to first need to sign up, this process is free.

RAML’s tool library is one of its advantages. They can range from API document generation to converting APIs written in other languages to RAML (or even just from one specification to another), or they can be a tool that helps parse, validate, and modify RAML types.S

After that add an API and click on “Define an API in API Designer.”

Use of RAML: 

The most important use of  sample RAML file is generating the documentation. Moreover, it is also useful in the designing and specification stage that describes the API you plan to build. 

So here are the some sample Raml file examples Just go throw it and use it according to your needs

#%RAML 1.0

title: Brochure

version: v1

baseUri: http://localhost:8080

protocols: HTTP

mediaType: application/json

types:

  ModelTree:

    type: object

    properties:

      modelTreeReference: string

      brand: string

      series?: string

      constructionSeries?: string

      bodyType?: string

      AGModelCode?: string

      UKModelCode?: string

      levelCode?: number

  Brochure:

    type: object

    properties:

      recordNumber: number

      partNumber: number

      name: string

      brand: string

      brochureType: string

      CRMGroup: string

      CRMSubGroup: string

      isActiveIndicator: string

      modelTree: ModelTree

  Status:

    type: object

    properties:

      responseStatus:

        enum: [COMPLETE, ERROR, FATAL]

      responseId: number

  Transaction:

    type: object

    properties:

      status: Status

      data:

        type: object

        properties:

          brochures?: Brochure[]

/brochures:

  get:

    responses:

      200:

        description: Status and a list of Brochures

        body:

          application/json:

            example: {

              status: {

                responseStatus: ‘COMPLETE’,

                responseId: 123

                },

              data: {

                brochures: [{

                    recordNumber: 1,

                    partNumber: 56,

                    name: “Activity Brochure”,

                    brand: “My Brand Ltd”,

                    brochureType: “HARDCOPY”,

                    CRMGroup: “Sales”,

                    CRMSubGroup: “Lifestyle/Access”,

                    isActiveIndicator: “N”,

                    modelTree: {

                      modelTreeReference: “My Brand”,

                      brand: “My Brand Ltd”,

                      levelCode: 1

                      }

                  }

                ]

                }

              }

 

            type: Transaction