Deprecated: Set the expression directly on the apiKey plugin.
SPEL) during the request flow.Typical usage inside <apiKey> If the expression evaluates to null or an empty string, no key is extracted.
apiKey:
extractors:
- expressionExtractor:
language: SPEL
expression: request.headers['X-Api-Key']
apiKey:
extractors:
- expressionExtractor:
language: SPEL
expression: request.headers['X-Api-Key']
Syntax
expressionExtractor:
'$ref': <string>
expression: <string>
language: groovy
xmlConfig: {}
expressionExtractor:
'$ref': <string>
expression: <string>
language: groovy
xmlConfig: {}
Attributes
| Name | Required | Default | Description | Examples |
|---|---|---|---|---|
| $ref | false | - | Reference a component defined under components. | - |
| expression | false | - | The expression evaluated against the message. It must resolve to a String containing the API key. Empty or null results mean “no key found”. Examples (SPEL): | - |
| language | false | - | - | - |
Child Structure
| Element | Cardinality | Description |
|---|---|---|
| xmlConfig | 0..1 |