Skip to content

Commit

Permalink
Sort more enum values to create more consistency (#3161)
Browse files Browse the repository at this point in the history
  • Loading branch information
kddejong committed May 2, 2024
1 parent be82bab commit f54f66b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
12 changes: 8 additions & 4 deletions scripts/update_schemas_from_aws_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def write_db_cluster(results):
"then": {
"properties": {
"Engine": {
"enum": engines,
"enum": sorted(engines),
}
}
},
Expand All @@ -85,7 +85,9 @@ def write_db_cluster(results):
"required": ["Engine", "EngineVersion"],
},
"then": {
"properties": {"EngineVersion": {"enum": results.get(engine)}}
"properties": {
"EngineVersion": {"enum": sorted(results.get(engine))}
}
},
}
)
Expand Down Expand Up @@ -132,7 +134,7 @@ def write_db_instance(results):
"then": {
"properties": {
"Engine": {
"enum": engines,
"enum": sorted(engines),
}
}
},
Expand All @@ -156,7 +158,9 @@ def write_db_instance(results):
"required": ["Engine", "EngineVersion"],
},
"then": {
"properties": {"EngineVersion": {"enum": results.get(engine)}}
"properties": {
"EngineVersion": {"enum": sorted(results.get(engine))}
}
},
}
)
Expand Down
2 changes: 1 addition & 1 deletion scripts/update_schemas_from_boto.py
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ def build_resource_type_patches(dir: str, resource_patches: ResourcePatch):
{
"op": "add",
"path": f"{patch.path}/enum",
"value": enums,
"value": sorted(enums),
}
)

Expand Down
2 changes: 1 addition & 1 deletion scripts/update_specs_from_pricing.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ def write_output(resource, filename, obj):
"_description": "Automatically updated using update_specs_from_pricing",
}
for region, values in obj.items():
output[region] = {"enum": list(values)}
output[region] = {"enum": sorted(list(values))}

with open(filename, "w+", encoding="utf-8") as f:
json.dump(output, f, indent=1, sort_keys=True, separators=(",", ": "))
Expand Down

0 comments on commit f54f66b

Please sign in to comment.