How to specify API request header value in RAML

I’d like to specify the value that a request header should have. The specification seems to only mention properties of the header

/foo-resources:
  post:
    description: Creates a foo
    headers:
      Connection: close  # define that connection header should have close value
    body:
      #...

Is this possible?

yes, what you’re looking for is the enum facet.

Thanks for the info. I’m not fully sure how to apply this (not at the machine with IDE to be able to test ATM). Is the following correct:

headers:
  Connection:
    properties:
      enum: [ close ]
      required: true

Thanks

Close :slight_smile: (no pun intended)

headers:
  Connection:
    enum: [close]
1 Like