1. Proxies and Flow

if

Version

if allows conditional execution of nested interceptors.

if:
test: method == 'POST'
language: SpEL
flow:
- log: {} # nested plugins here
else:
- return: {}
if:
   test: method == 'POST'
   language: SpEL
   flow:
     - log: {} # nested plugins here
   else:
     - return: {}

Syntax

if:
test: <string> # required
'$ref': <string>
else:
- <flow>
flow:
- <flow>
language: groovy
xmlConfig: {}
if:
  test: <string> # required
  '$ref': <string>
  else:
    - <flow>
  flow:
    - <flow>
  language: groovy
  xmlConfig: {}

Attributes

NameRequiredDefaultDescriptionExamples
$reffalse-Reference a component defined under components.-
languagefalseSpELLanguage of the 'test' conditionSpEL, groovy, jsonpath, xpath
testtrue-Condition to be tested
  • request.isJSON()
  • params['limit'] >= 0
  • statusCode matches '[45]\d\d'

Child Structure

ElementCardinalityDescription
flow0..*
flow0..*Sets the flow of plugins that will be executed.
xmlConfig0..1

Can be used in