use of io.swagger.v3.jaxrs2.resources.MyClass in project swagger-core by swagger-api.
the class ReaderTest method testModelResolverXMLPropertiesName.
@Test(description = "Resolve Model with XML Properties starting with is prefix per #2635")
public void testModelResolverXMLPropertiesName() {
final MyClass myClass = new MyClass();
myClass.populate("isotonicDrink value", "softDrink value", "isoDrink value", "isotonicDrinkOnlyXmlElement value");
Map<String, Schema> schemas = resolveJaxb(MyClass.class);
assertNull(schemas.get("MyClass").getProperties().get("isotonicDrink"));
assertNotNull(schemas.get("MyClass").getProperties().get("beerDrink"));
assertNotNull(schemas.get("MyClass").getProperties().get("saltDrink"));
// No JsonProperty or ApiModelProperty, keep original name
assertNull(schemas.get("MyClass").getProperties().get("beerDrinkXmlElement"));
assertNotNull(schemas.get("MyClass").getProperties().get("isotonicDrinkOnlyXmlElement"));
}
Aggregations