How to return a Static JSON Document

Using the template element, we can easily define static content with specified content type and dynamic generation using groovy.

Ingredients

Configuration

<api port="2000">
  <response>
    <template contentType="application/json">
      {
        "city": "bonn",
        "country": "germany"
      }
    </template>
  </response>
  <return />
</api>

Resources

Template Documentation Examples