diff --git a/smithy-aws-cloudformation/src/main/java/software/amazon/smithy/aws/cloudformation/schema/fromsmithy/mappers/RequiredMapper.java b/smithy-aws-cloudformation/src/main/java/software/amazon/smithy/aws/cloudformation/schema/fromsmithy/mappers/RequiredMapper.java index 7bb2db87f4b..c85ab7b5241 100644 --- a/smithy-aws-cloudformation/src/main/java/software/amazon/smithy/aws/cloudformation/schema/fromsmithy/mappers/RequiredMapper.java +++ b/smithy-aws-cloudformation/src/main/java/software/amazon/smithy/aws/cloudformation/schema/fromsmithy/mappers/RequiredMapper.java @@ -45,7 +45,7 @@ public void before(Context context, ResourceSchema.Builder resourceSchema) { StructureShape resourceStructure = context.getResourceStructure(); for (MemberShape member : resourceStructure.members()) { if (member.getMemberTrait(model, RequiredTrait.class).isPresent()) { - resourceSchema.addRequired(context.getPropertyPointer(member.getMemberName())); + resourceSchema.addRequired(context.getJsonSchemaConverter().toPropertyName(member)); } } } diff --git a/smithy-aws-cloudformation/src/test/java/software/amazon/smithy/aws/cloudformation/schema/fromsmithy/mappers/RequiredMapperTest.java b/smithy-aws-cloudformation/src/test/java/software/amazon/smithy/aws/cloudformation/schema/fromsmithy/mappers/RequiredMapperTest.java index 8758a34b968..da8a16b4ad3 100644 --- a/smithy-aws-cloudformation/src/test/java/software/amazon/smithy/aws/cloudformation/schema/fromsmithy/mappers/RequiredMapperTest.java +++ b/smithy-aws-cloudformation/src/test/java/software/amazon/smithy/aws/cloudformation/schema/fromsmithy/mappers/RequiredMapperTest.java @@ -46,7 +46,7 @@ public void addsRequiredPropertiesByDefault() { .convertToNodes(model) .get("Smithy::TestService::FooResource"); - Assertions.assertEquals(ListUtils.of("/properties/FooRequiredProperty"), + Assertions.assertEquals(ListUtils.of("FooRequiredProperty"), resourceNode.expectArrayMember("required") .getElementsAs(StringNode::getValue)); }