このページは、まだ日本語ではご利用いただけません。翻訳中です。
古いプラグインバージョンのドキュメントを閲覧しています。
構成
このプラグインはDBレスモードに対応しています。
互換性のあるプロトコル
Request Validatorプラグインは以下のプロトコルに対応しています:
grpc, grpcs, http, https
パラメータ
このプラグインの設定で使用できるすべてのパラメータのリストは次のとおりです。
-
name or plugin
string requiredプラグイン名。この場合は
request-validator。- Kong Admin API、Kong Konnect API、宣言型構成、または decK ファイルを使用する場合、フィールドは
nameです。 - Kubernetes で KongPlugin オブジェクトを使用する場合、フィールドは
pluginです。
- Kong Admin API、Kong Konnect API、宣言型構成、または decK ファイルを使用する場合、フィールドは
-
instance_name
stringプラグインのインスタンスを識別するための任意のカスタム名 (例:
request-validator_my-service。インスタンス名はKong ManagerとKonnectに表示されるので、 例えば複数のサービスで同じプラグインを複数のコンテキストで実行する場合に便利です。また、Kong Admin API経由で特定のプラグインインスタンスに アクセスするためにも使用できます。
インスタンス名は、次のコンテキスト内で一意である必要があります。
- Kong Gateway Enterpriseのワークスペース内
- Konnectのコントロールプレーン(CP)またはコントロールプレーン(CP)グループ内
- Kong Gateway (OSS)の全世界
-
service.name or service.id
stringプラグインが対象とするサービス名または ID。最上位の
/pluginsエンドポイント. からプラグインをサービスに追加する場合は、これらのパラメータのいずれかを設定してください/services/{serviceName|Id}/pluginsを使用する場合は必要ありません。 -
route.name or route.id
stringプラグインがターゲットとするルート名または ID。最上位の
/pluginsエンドポイント. を通るルートにプラグインを追加する場合は、これらのパラメータのいずれかを設定してください/routes/{routeName|Id}/pluginsを使用する場合は必要ありません。 -
consumer.name or consumer.id
stringプラグインがターゲットとするコンシューマーの名前または ID。 最上位の
/pluginsエンドポイント. からコンシューマーにプラグインを追加する場合は、これらのパラメーターのいずれかを設定してください/consumers/{consumerName|Id}/pluginsを使用する場合は必要ありません。 -
enabled
boolean default:trueこのプラグインが適用されるかどうか。
-
config
record required-
body_schema
stringThe request body schema specification. One of
body_schemaorparameter_schemamust be specified.
-
allowed_content_types
set of typestringdefault:application/jsonList of allowed content types. The value can be configured with the
charsetparameter. For example,application/json; charset=UTF-8.
-
version
string required default:kongMust be one of:kong,draft4Which validator to use. Supported values are
kong(default) for using Kong’s own schema validator, ordraft4for using a JSON Schema Draft 4-compliant validator.
-
parameter_schema
array of typerecordArray of parameter validator specification. One of
body_schemaorparameter_schemamust be specified.-
in
string required Must be one of:query,header,pathThe location of the parameter.
-
name
string requiredThe name of the parameter. Parameter names are case-sensitive, and correspond to the parameter name used by the
inproperty. Ifinispath, thenamefield MUST correspond to the named capture group from the configuredroute.
-
required
boolean requiredDetermines whether this parameter is mandatory.
-
style
string Must be one of:label,form,matrix,simple,spaceDelimited,pipeDelimited,deepObjectRequired when
schemaandexplodeare set. Describes how the parameter value will be deserialized depending on the type of the parameter value.
-
explode
booleanRequired when
schemaandstyleare set. Whenexplodeistrue, parameter values of typearrayorobjectgenerate 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.
-
schema
stringRequred when
styleandexplodeare set. This is the schema defining the type used for the parameter. It is validated usingdraft4for JSON Schema draft 4 compliant validator. In addition to being a valid JSON Schema, the parameter schema MUST have a top-leveltypeproperty to enable proper deserialization before validating.
-
-
verbose_response
boolean required default:falseIf enabled, the plugin returns more verbose and detailed validation errors.
-