From a89e7b2c8b5c49eaafec7888f0338fc2da1b0369 Mon Sep 17 00:00:00 2001 From: Jim Anderson Date: Wed, 4 Sep 2024 10:34:18 -0500 Subject: [PATCH] fix: set a different example for ConsistencyPreference --- docs/openapiv2/apidocs.swagger.json | 3 ++- scripts/update_swagger.sh | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/openapiv2/apidocs.swagger.json b/docs/openapiv2/apidocs.swagger.json index 79b2974b..957f8bf7 100644 --- a/docs/openapiv2/apidocs.swagger.json +++ b/docs/openapiv2/apidocs.swagger.json @@ -1707,7 +1707,8 @@ "HIGHER_CONSISTENCY" ], "default": "UNSPECIFIED", - "description": "Controls the consistency preferences when calling the query APIs.\n\n - UNSPECIFIED: Default if not set. Behavior will be the same as MINIMIZE_LATENCY.\n - MINIMIZE_LATENCY: Minimize latency at the potential expense of lower consistency.\n - HIGHER_CONSISTENCY: Prefer higher consistency, at the potential expense of increased latency." + "description": "Controls the consistency preferences when calling the query APIs.\n\n - UNSPECIFIED: Default if not set. Behavior will be the same as MINIMIZE_LATENCY.\n - MINIMIZE_LATENCY: Minimize latency at the potential expense of lower consistency.\n - HIGHER_CONSISTENCY: Prefer higher consistency, at the potential expense of increased latency.", + "example": "MINIMIZE_LATENCY" }, "ContextualTupleKeys": { "type": "object", diff --git a/scripts/update_swagger.sh b/scripts/update_swagger.sh index a260440d..800d032b 100755 --- a/scripts/update_swagger.sh +++ b/scripts/update_swagger.sh @@ -16,6 +16,12 @@ cat ${filename} | \ 'del(.paths[][]."responses"|select(has("400"))."default" ) | del(.paths[][]."responses"|select(has("201"))."200") | del(.paths[][]."responses"|select(has("204"))."200")' > ${tmp_filename} mv ${tmp_filename} ${filename} +# Add an example value to the ConsistencyPreference to override the default of UNSPECIFIED being shown in the docs +cat ${filename} | \ + jq \ + '.definitions.ConsistencyPreference.example = "MINIMIZE_LATENCY"' > ${tmp_filename} +mv ${tmp_filename} ${filename} + # Finally, for 204, there should be no schema cat ${filename} | \ jq \