Using !include on the headers section


#1

Hi all,

I need to use the same headers in mos of my requests. Is there a way to use !include on the headers section?

Thanks


#2

Hello, fificito.

If you need to use the same headers in the most of your requests, then try use traits.
Example:

    #%RAML 0.8
---
title: example
version: 1.0
traits:
  - withCommonHeaders:
      headers:
        producerName:
          description: Specify producer name value
          type: string

/config:
  get:
    is: [withCommonHeaders]
    responses:
      200:

Traits are similar mixins in JavaScript.


#3

Thanks!!! This did it.