MCPcopy Create free account
hub / github.com/apolloconfig/apollo / normalize

Function normalize

scripts/openapi/check_openapi_compatibility.py:91–99  ·  view source on GitHub ↗
(value: Any, parent_key: Optional[str] = None)

Source from the content-addressed store, hash-verified

89 return json.dumps(value, sort_keys=True, separators=(",", ":"))
90
91 def normalize(value: Any, parent_key: Optional[str] = None) -> Any:
92 if isinstance(value, dict):
93 return {key: normalize(value[key], key) for key in sorted(value)}
94 if isinstance(value, list):
95 normalized_items = [normalize(item) for item in value]
96 if parent_key in UNORDERED_SCHEMA_LIST_KEYS:
97 return sorted(normalized_items, key=normalized_sort_key)
98 return normalized_items
99 return value
100
101 keys = (
102 "$ref",

Callers 1

schema_signatureFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected