HttpServletRequest and HttpServletResponse in RAML



If I have a REST interface:

public void doStuff(@Context HttpServletRequest request, @Context HttpServletResponse response, …);

How to I document the following in RAML?

  • HttpServletRequest
  • HttpServletResponse

Thank you! :slight_smile:


MH, do you want to describe what specifically goes in and whats coming out? Right now it seems that you only have request and response, but what do you want to describe is not really clear to me.


Hi Christian,

See in RESTEasy:

Chapter 15. @Context

The @Context annotation allows you to inject instances of,,, javax.servlet.HttpServletRequest, javax.servlet.HttpServletResponse, javax.servlet.ServletConfig, javax.servlet.ServletContext, and objects.

In the Java code, I’m doing stuff like:

public void doStuff(HttpServletRequest request, HttpServletResponse response)
    HttpSession session = request.getSession();
    setCookie(response, ....);


I am not really sure I understand what you’d like to capture in RAML? So what are the information that the consumers of your API should know?