このページは、まだ日本語ではご利用いただけません。翻訳中です。
構成
このプラグインはDBレスモードに対応しています。
互換性のあるプロトコル
Request Validatorプラグインは以下のプロトコルに対応しています:
grpc
, grpcs
, http
, https
パラメータ
このプラグインの設定で使用できるすべてのパラメータのリストは次のとおりです。
-
string required
プラグイン名。この場合は
request-validator
。- Kong Admin API、Kong Konnect API、宣言型構成、または decK ファイルを使用する場合、フィールドは
name
です。 - Kubernetes で KongPlugin オブジェクトを使用する場合、フィールドは
plugin
です。
- Kong Admin API、Kong Konnect API、宣言型構成、または decK ファイルを使用する場合、フィールドは
-
string
プラグインのインスタンスを識別するための任意のカスタム名 (例:
request-validator_my-service
。インスタンス名はKong ManagerとKonnectに表示されるので、 例えば複数のサービスで同じプラグインを複数のコンテキストで実行する場合に便利です。また、Kong Admin API経由で特定のプラグインインスタンスに アクセスするためにも使用できます。
インスタンス名は、次のコンテキスト内で一意である必要があります。
- Kong Gateway Enterpriseのワークスペース内
- Konnectのコントロールプレーン(CP)またはコントロールプレーン(CP)グループ内
- Kong Gateway (OSS)の全世界
-
string
プラグインが対象とするサービス名または ID。最上位の
/plugins
エンドポイント. からプラグインをサービスに追加する場合は、これらのパラメータのいずれかを設定してください/services/{serviceName|Id}/plugins
を使用する場合は必要ありません。 -
string
プラグインがターゲットとするルート名または ID。最上位の
/plugins
エンドポイント. を通るルートにプラグインを追加する場合は、これらのパラメータのいずれかを設定してください/routes/{routeName|Id}/plugins
を使用する場合は必要ありません。 -
string
プラグインがターゲットとするコンシューマーの名前または ID。 最上位の
/plugins
エンドポイント. からコンシューマーにプラグインを追加する場合は、これらのパラメーターのいずれかを設定してください/consumers/{consumerName|Id}/plugins
を使用する場合は必要ありません。 -
boolean default:
true
このプラグインが適用されるかどうか。
-
record required
-
string
The request body schema specification. One of
body_schema
orparameter_schema
must be specified.
-
set of type
string
default:application/json
List of allowed content types. The value can be configured with the
charset
parameter. For example,application/json; charset=UTF-8
.
-
string required default:
kong
Must be one of:kong
,draft4
Which validator to use. Supported values are
kong
(default) for using Kong’s own schema validator, ordraft4
for using a JSON Schema Draft 4-compliant validator.
-
array of type
record
Array of parameter validator specification. One of
body_schema
orparameter_schema
must be specified.-
string required Must be one of:
query
,header
,path
The location of the parameter.
-
string required
The name of the parameter. Parameter names are case-sensitive, and correspond to the parameter name used by the
in
property. Ifin
ispath
, thename
field MUST correspond to the named capture group from the configuredroute
.
-
boolean required
Determines whether this parameter is mandatory.
-
string Must be one of:
label
,form
,matrix
,simple
,spaceDelimited
,pipeDelimited
,deepObject
Required when
schema
andexplode
are set. Describes how the parameter value will be deserialized depending on the type of the parameter value.
-
boolean
Required when
schema
andstyle
are set. Whenexplode
istrue
, parameter values of typearray
orobject
generate separate parameters for each value of the array or key-value pair of the map. For other types of parameters, this property has no effect.
-
string
Requred when
style
andexplode
are set. This is the schema defining the type used for the parameter. It is validated usingdraft4
for JSON Schema draft 4 compliant validator. In addition to being a valid JSON Schema, the parameter schema MUST have a top-leveltype
property to enable proper deserialization before validating.
-
-
boolean required default:
false
If enabled, the plugin returns more verbose and detailed validation errors.
-
boolean required default:
true
Determines whether to enable parameters validation of request content-type.
-