@Test public void addsListAndSetMembers() { StringShape string = StringShape.builder().id("foo.bar#String").build(); MemberShape member = MemberShape.builder() .id("foo.bar#Scripts$member") .target("foo.bar#String") .build(); ListShape list = ListShape.builder() .id("foo.bar#Scripts") .member(member) .build(); Model model = Model.builder().addShapes(string, list, member).build(); RefStrategy ref = RefStrategy .createDefaultStrategy(model, new JsonSchemaConfig(), propertyNamingStrategy); String pointer = ref.toPointer(member.getId()); assertThat(pointer, equalTo("#/definitions/Scripts/items")); }
@Override public String toPointer(ShapeId id) { if (id.getMember().isPresent()) { MemberShape member = model.expectShape(id, MemberShape.class); return createMemberPointer(member); } return rootPointer + stripNonAlphaNumericCharsIfNecessary(id.getName()); }
DefaultRefStrategy implements RefStrategy { @Override public String toPointer(ShapeId id) { if (id.getMember().isPresent()) { MemberShape member = model.expectShape(id, MemberShape.class); return createMemberPointer(member); } return rootPointer + stripNonAlphaNumericCharsIfNecessary(id.getName()); } }
DefaultRefStrategy implements RefStrategy { @Override public String toPointer(ShapeId id) { if (id.getMember().isPresent()) { MemberShape member = model.expectShape(id, MemberShape.class); return createMemberPointer(member); } return rootPointer + stripNonAlphaNumericCharsIfNecessary(id.getName()); } DefaultRefStrategy(Model model, JsonSchemaConfig config, PropertyNamingStrategy propertyNamingStrategy); }
DefaultRefStrategy implements RefStrategy { @Override public String toPointer(ShapeId id) { if (id.getMember().isPresent()) { MemberShape member = model.expectShape(id, MemberShape.class); return createMemberPointer(member); } return rootPointer + stripNonAlphaNumericCharsIfNecessary(id.getName()); } DefaultRefStrategy(Model model, JsonSchemaConfig config, PropertyNamingStrategy propertyNamingStrategy); @Override String toPointer(ShapeId id); @Override boolean isInlined(Shape shape); }
DefaultRefStrategy implements RefStrategy { @Override public String toPointer(ShapeId id) { if (id.getMember().isPresent()) { MemberShape member = model.expectShape(id, MemberShape.class); return createMemberPointer(member); } return rootPointer + stripNonAlphaNumericCharsIfNecessary(id.getName()); } DefaultRefStrategy(Model model, JsonSchemaConfig config, PropertyNamingStrategy propertyNamingStrategy); @Override String toPointer(ShapeId id); @Override boolean isInlined(Shape shape);  }