Skip to content

Commit 525fa15

Browse files
authored
Add nonPublicProperties and nonPublicDefinitions lists of JSONPointers (#831)
* Add nonPublicProperties and nonPublicDefinitions lists of JSONPointers Add nonPublicProperties and nonPublicDefinitions lists of JSONPointers in metaschema. Adding top level lists to allow hidden property and definition paths to be accepted.
1 parent 90b23b0 commit 525fa15

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/rpdk/core/data/schema/provider.definition.schema.v1.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,14 @@
173173
"description": "A list of JSON pointers for properties that can only be updated under certain conditions. For example, you can upgrade the engine version of an RDS DBInstance but you cannot downgrade it. When updating this property for a resource in a CloudFormation stack, the resource will be replaced if it cannot be updated.",
174174
"$ref": "base.definition.schema.v1.json#/definitions/jsonPointerArray"
175175
},
176+
"nonPublicProperties": {
177+
"description": "A list of JSON pointers for properties that are hidden. These properties will still be used but will not be visible",
178+
"$ref": "base.definition.schema.v1.json#/definitions/jsonPointerArray"
179+
},
180+
"nonPublicDefinitions": {
181+
"description": "A list of JSON pointers for definitions that are hidden. These definitions will still be used but will not be visible",
182+
"$ref": "base.definition.schema.v1.json#/definitions/jsonPointerArray"
183+
},
176184
"createOnlyProperties": {
177185
"description": "A list of JSON pointers to properties that are only able to be specified by the customer when creating a resource. Conversely, any property *not* in this list can be applied to an Update request.",
178186
"$ref": "base.definition.schema.v1.json#/definitions/jsonPointerArray"

tests/test_data_loaders.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,21 @@ def test_load_resource_spec_conditionally_create_only_match_read_only():
154154
)
155155

156156

157+
def test_load_resource_spec_non_public_properties_and_definitions():
158+
schema = {
159+
"typeName": "AWS::FOO::BAR",
160+
"description": "test schema",
161+
"additionalProperties": False,
162+
"definitions": {"bar": {"type": "string"}},
163+
"properties": {"foo": {"type": "string"}},
164+
"primaryIdentifier": ["/properties/foo"],
165+
"readOnlyProperties": ["/properties/foo"],
166+
"nonPublicProperties": ["/properties/foo"],
167+
"nonPublicDefinitions": ["/definitions/bar"],
168+
}
169+
load_resource_spec(json_s(schema))
170+
171+
157172
@pytest.mark.parametrize(
158173
"schema",
159174
[

0 commit comments

Comments
 (0)