From df31479603186403323cdc66117c48a62db8ff15 Mon Sep 17 00:00:00 2001 From: "data-plane-api(CircleCI)" Date: Wed, 23 Sep 2020 19:21:09 +0000 Subject: [PATCH] docs: Fix REQ command operator usage example (#13197) This fixes the docs for REQ command operator usage example in LocalReplyConfig and SubstitutionFormatString protos. $REQ(:path)% is an invalid command operator, it should be %REQ(:path)%. Risk Level: N/A Testing: N/A Docs Changes: This is a docs change. Release Notes: N/A Signed-off-by: Dhi Aurrahman Mirrored from https://github.com/envoyproxy/envoy @ 130c7c4e271fe306ae4dd747daa5f09ff31aef79 --- .../core/v3/substitution_format_string.proto | 25 +++++++++++-------- .../v4alpha/substitution_format_string.proto | 25 +++++++++++-------- .../v3/http_connection_manager.proto | 24 ++++++++++-------- .../v4alpha/http_connection_manager.proto | 24 ++++++++++-------- 4 files changed, 56 insertions(+), 42 deletions(-) diff --git a/envoy/config/core/v3/substitution_format_string.proto b/envoy/config/core/v3/substitution_format_string.proto index 24f1687c..d3c0915c 100644 --- a/envoy/config/core/v3/substitution_format_string.proto +++ b/envoy/config/core/v3/substitution_format_string.proto @@ -23,15 +23,18 @@ message SubstitutionFormatString { // Specify a format with command operators to form a text string. // Its details is described in :ref:`format string`. // - // .. code-block:: + // For example, setting ``text_format`` like below, // - // text_format: %LOCAL_REPLY_BODY%:%RESPONSE_CODE%:path=$REQ(:path)% + // .. validated-code-block:: yaml + // :type-name: envoy.config.core.v3.SubstitutionFormatString // - // The following plain text will be created: + // text_format: "%LOCAL_REPLY_BODY%:%RESPONSE_CODE%:path=%REQ(:path)%\n" // - // .. code-block:: + // generates plain text similar to: // - // upstream connect error:204:path=/foo + // .. code-block:: text + // + // upstream connect error:503:path=/foo // string text_format = 1 [(validate.rules).string = {min_bytes: 1}]; @@ -41,11 +44,12 @@ message SubstitutionFormatString { // Nested JSON objects may be produced by some command operators (e.g. FILTER_STATE or DYNAMIC_METADATA). // See the documentation for a specific command operator for details. // - // .. code-block:: + // .. validated-code-block:: yaml + // :type-name: envoy.config.core.v3.SubstitutionFormatString // - // json_format: - // status: %RESPONSE_CODE% - // message: %LOCAL_REPLY_BODY% + // json_format: + // status: "%RESPONSE_CODE%" + // message: "%LOCAL_REPLY_BODY%" // // The following JSON object would be created: // @@ -70,7 +74,8 @@ message SubstitutionFormatString { // If this field is not set then ``text/plain`` is used for *text_format* and // ``application/json`` is used for *json_format*. // - // .. code-block:: + // .. validated-code-block:: yaml + // :type-name: envoy.config.core.v3.SubstitutionFormatString // // content_type: "text/html; charset=UTF-8" // diff --git a/envoy/config/core/v4alpha/substitution_format_string.proto b/envoy/config/core/v4alpha/substitution_format_string.proto index 39dd12c4..3cb2e678 100644 --- a/envoy/config/core/v4alpha/substitution_format_string.proto +++ b/envoy/config/core/v4alpha/substitution_format_string.proto @@ -27,15 +27,18 @@ message SubstitutionFormatString { // Specify a format with command operators to form a text string. // Its details is described in :ref:`format string`. // - // .. code-block:: + // For example, setting ``text_format`` like below, // - // text_format: %LOCAL_REPLY_BODY%:%RESPONSE_CODE%:path=$REQ(:path)% + // .. validated-code-block:: yaml + // :type-name: envoy.config.core.v3.SubstitutionFormatString // - // The following plain text will be created: + // text_format: "%LOCAL_REPLY_BODY%:%RESPONSE_CODE%:path=%REQ(:path)%\n" // - // .. code-block:: + // generates plain text similar to: // - // upstream connect error:204:path=/foo + // .. code-block:: text + // + // upstream connect error:503:path=/foo // string text_format = 1 [(validate.rules).string = {min_bytes: 1}]; @@ -45,11 +48,12 @@ message SubstitutionFormatString { // Nested JSON objects may be produced by some command operators (e.g. FILTER_STATE or DYNAMIC_METADATA). // See the documentation for a specific command operator for details. // - // .. code-block:: + // .. validated-code-block:: yaml + // :type-name: envoy.config.core.v3.SubstitutionFormatString // - // json_format: - // status: %RESPONSE_CODE% - // message: %LOCAL_REPLY_BODY% + // json_format: + // status: "%RESPONSE_CODE%" + // message: "%LOCAL_REPLY_BODY%" // // The following JSON object would be created: // @@ -74,7 +78,8 @@ message SubstitutionFormatString { // If this field is not set then ``text/plain`` is used for *text_format* and // ``application/json`` is used for *json_format*. // - // .. code-block:: + // .. validated-code-block:: yaml + // :type-name: envoy.config.core.v3.SubstitutionFormatString // // content_type: "text/html; charset=UTF-8" // diff --git a/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto b/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto index 68c5c8ca..b8c5f4de 100644 --- a/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto +++ b/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto @@ -571,27 +571,29 @@ message LocalReplyConfig { // The configuration to form response body from the :ref:`command operators ` // and to specify response content type as one of: plain/text or application/json. // - // Example one: plain/text body_format. + // Example one: "plain/text" ``body_format``. // - // .. code-block:: + // .. validated-code-block:: yaml + // :type-name: envoy.config.core.v3.SubstitutionFormatString // - // text_format: %LOCAL_REPLY_BODY%:%RESPONSE_CODE%:path=$REQ(:path)% + // text_format: "%LOCAL_REPLY_BODY%:%RESPONSE_CODE%:path=%REQ(:path)%\n" // - // The following response body in `plain/text` format will be generated for a request with + // The following response body in "plain/text" format will be generated for a request with // local reply body of "upstream connection error", response_code=503 and path=/foo. // - // .. code-block:: + // .. code-block:: text // // upstream connect error:503:path=/foo // - // Example two: application/json body_format. + // Example two: "application/json" ``body_format``. // - // .. code-block:: + // .. validated-code-block:: yaml + // :type-name: envoy.config.core.v3.SubstitutionFormatString // - // json_format: - // status: %RESPONSE_CODE% - // message: %LOCAL_REPLY_BODY% - // path: $REQ(:path)% + // json_format: + // status: "%RESPONSE_CODE%" + // message: "%LOCAL_REPLY_BODY%" + // path: "%REQ(:path)%" // // The following response body in "application/json" format would be generated for a request with // local reply body of "upstream connection error", response_code=503 and path=/foo. diff --git a/envoy/extensions/filters/network/http_connection_manager/v4alpha/http_connection_manager.proto b/envoy/extensions/filters/network/http_connection_manager/v4alpha/http_connection_manager.proto index 9db92927..6e92671b 100644 --- a/envoy/extensions/filters/network/http_connection_manager/v4alpha/http_connection_manager.proto +++ b/envoy/extensions/filters/network/http_connection_manager/v4alpha/http_connection_manager.proto @@ -573,27 +573,29 @@ message LocalReplyConfig { // The configuration to form response body from the :ref:`command operators ` // and to specify response content type as one of: plain/text or application/json. // - // Example one: plain/text body_format. + // Example one: "plain/text" ``body_format``. // - // .. code-block:: + // .. validated-code-block:: yaml + // :type-name: envoy.config.core.v3.SubstitutionFormatString // - // text_format: %LOCAL_REPLY_BODY%:%RESPONSE_CODE%:path=$REQ(:path)% + // text_format: "%LOCAL_REPLY_BODY%:%RESPONSE_CODE%:path=%REQ(:path)%\n" // - // The following response body in `plain/text` format will be generated for a request with + // The following response body in "plain/text" format will be generated for a request with // local reply body of "upstream connection error", response_code=503 and path=/foo. // - // .. code-block:: + // .. code-block:: text // // upstream connect error:503:path=/foo // - // Example two: application/json body_format. + // Example two: "application/json" ``body_format``. // - // .. code-block:: + // .. validated-code-block:: yaml + // :type-name: envoy.config.core.v3.SubstitutionFormatString // - // json_format: - // status: %RESPONSE_CODE% - // message: %LOCAL_REPLY_BODY% - // path: $REQ(:path)% + // json_format: + // status: "%RESPONSE_CODE%" + // message: "%LOCAL_REPLY_BODY%" + // path: "%REQ(:path)%" // // The following response body in "application/json" format would be generated for a request with // local reply body of "upstream connection error", response_code=503 and path=/foo.