Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort more enum values to create more consistency #3161

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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