Parser

microgateway.airlock.com/v1alpha1


Parser contains the configuration for content parsers (default and custom).

apiVersion: microgateway.airlock.com/v1alpha1
kind: Parser
metadata:
  name: ...
spec:
  ...
apiVersion: microgateway.airlock.com/v1alpha1
kind: Parser
metadata:
  name: default
spec: 
  request: 
    parsers: 
      json: 
        enable: true
        mediaTypePattern: ".*json.*"
      form: 
        enable: true
        mediaTypePattern: ".*urlencoded.*"
    defaultContentType: "application/x-www-form-urlencoded"

Parser

Field Type Description Required Default Allowed Values
metadata ObjectMeta Refer to Kubernetes API documentation for fields of metadata yes
spec object Specification of the desired parser behavior. no

Parser.spec

Field Type Description Required Default Allowed Values
request object Request defines the parsing for downstream requests. no

Parser.spec.request

Field Type Description Required Default Allowed Values
defaultContentType string DefaultContentType specifies the content-type header which should be injected into the request before parser selection if it is not already present and the request has a body. no application/x-www-form-urlencoded
parsers object Parsers defines the configuration for the available content parsers. no

Parser.spec.request.parsers

Field Type Description Required Default Allowed Values
form object Form defines the configuration for the form parser. no
json object JSON defines the configuration for the JSON parser no

Parser.spec.request.parsers.form

Field Type Description Required Default Allowed Values
enable bool Enable defines whether form payloads are inspected. no true true, false
mediaTypePattern string MediaTypePattern is a regex specifying the media types for which the request body should be treated as form arguments. no .*urlencoded.*

Parser.spec.request.parsers.json

Field Type Description Required Default Allowed Values
enable bool Enable defines whether json payloads are inspected. no true true, false
mediaTypePattern string MediaTypePattern is a regex specifying the media types for which the request body should be treated as JSON. no .*json.*