Skip to content

Commit

Permalink
docs: update docs and annotation of json formatter (#38484)
Browse files Browse the repository at this point in the history
Commit Message: docs: update docs and annotation of json formatter
Additional Description:
Risk Level: low.
Testing: n/a.
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional [API
Considerations](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):]

---------

Signed-off-by: wangbaiping(wbpcode) <wangbaiping@bytedance.com>
Signed-off-by: code <wbphub@gmail.com>
Co-authored-by: wangbaiping(wbpcode) <wangbaiping@bytedance.com>
Co-authored-by: phlax <phlax@users.noreply.github.com>
  • Loading branch information
3 people authored Feb 20, 2025
1 parent 5098cae commit 9ae7e04
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
13 changes: 12 additions & 1 deletion api/envoy/config/core/v3/substitution_format_string.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE;
// Optional configuration options to be used with json_format.
message JsonFormatOptions {
// The output JSON string properties will be sorted.
bool sort_properties = 1;
//
// .. note::
// As the properties are always sorted, this option has no effect and is deprecated.
//
bool sort_properties = 1
[deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];
}

// Configuration to use multiple :ref:`command operators <config_access_log_command_operators>`
Expand Down Expand Up @@ -101,6 +106,12 @@ message SubstitutionFormatString {
// * for ``text_format``, the output of the empty operator is changed from ``-`` to an
// empty string, so that empty values are omitted entirely.
// * for ``json_format`` the keys with null values are omitted in the output structure.
//
// .. note::
// This option does not work perfectly with ``json_format`` as keys with ``null`` values
// will still be included in the output. See https://github.com/envoyproxy/envoy/issues/37941
// for more details.
//
bool omit_empty_values = 3;

// Specify a ``content_type`` field.
Expand Down
1 change: 0 additions & 1 deletion test/integration/access_log_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ TEST_P(AccessLogIntegrationTest, ShouldReplaceInvalidUtf8) {
v.set_string_value("%REQ(X-FORWARDED-FOR)%");
auto fields = json->mutable_fields();
(*fields)["x_forwarded_for"] = v;
log_format->mutable_json_format_options()->set_sort_properties(true);
access_log_config_to_clobber->mutable_typed_config()->PackFrom(access_log_config);
});
testRouterDownstreamDisconnectBeforeRequestComplete();
Expand Down

0 comments on commit 9ae7e04

Please sign in to comment.