ensure consistency in doc generation by always sorting json keys (#449)

This commit is contained in:
bmc-msft
2021-01-21 10:28:11 -05:00
committed by GitHub
parent b499b9b17d
commit 7e6415b15f
2 changed files with 1943 additions and 1936 deletions

File diff suppressed because it is too large Load Diff

View File

@ -223,7 +223,9 @@ def main():
"Each event will be submitted via HTTP POST to the user provided URL.",
)
typed(3, "Example", message.json(indent=4, exclude_none=True), "json")
typed(
3, "Example", message.json(indent=4, exclude_none=True, sort_keys=True), "json"
)
layer(2, "Event Types (EventType)")
event_map = {get_event_type(x).name: x for x in examples}
@ -236,10 +238,15 @@ def main():
for name in sorted(event_map.keys()):
example = event_map[name]
layer(3, name)
typed(4, "Example", example.json(indent=4, exclude_none=True), "json")
typed(4, "Schema", example.schema_json(indent=4), "json")
typed(
4,
"Example",
example.json(indent=4, exclude_none=True, sort_keys=True),
"json",
)
typed(4, "Schema", example.schema_json(indent=4, sort_keys=True), "json")
typed(2, "Full Event Schema", message.schema_json(indent=4), "json")
typed(2, "Full Event Schema", message.schema_json(indent=4, sort_keys=True), "json")
if __name__ == "__main__":