Skip to content

Commit

Permalink
test resource schemas with common issue warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
PatMyron committed Jan 28, 2021
1 parent 8fb40f2 commit 8955e66
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rpdk/core/data_loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ def load_resource_spec(resource_spec_file): # pylint: disable=R0912 # noqa: C90
for enum in nested_lookup("enum", resource_spec):
if len(enum) > 15:
LOG.warning(
"Consider not manually maintaining large constantly evolving enums like ",
"instance types, lambda runtimes, partitions, regions, availability zones, etc. that get outdated quickly: %s",
"Consider not manually maintaining large constantly evolving enums like"
+ "instance types, lambda runtimes, partitions, regions, availability zones, etc. that get outdated quickly: %s",
enum,
)

Expand Down
16 changes: 16 additions & 0 deletions tests/data/schema/valid/invalid_property_constraints.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"typeName" : "AWS::Service::Type",
"description" : "",
"additionalProperties" : false,
"properties" : {
"Property" : {
"type" : "string",
"pattern" : "arn:aws:[A-Za-z0-9]+{1,255}",
"enum" : [ "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" ]
}
},
"readOnlyProperties": [
"/properties/Property"
],
"primaryIdentifier" : [ "/properties/Property" ]
}

0 comments on commit 8955e66

Please sign in to comment.