fix example string generation for types with isBasicLatin pattern
[netconf.git] / restconf / sal-rest-docgen / src / test / java / org / opendaylight / controller / sal / rest / doc / impl / SwaggerObjectTest.java
index 8bace3ac7f971c5814b91b42b4c8dcda55a82c04..6de33841206ca864fdbe399787d9febfb85dea97 100644 (file)
@@ -54,4 +54,18 @@ public class SwaggerObjectTest {
         }
     }
 
+    @Test
+    public void testStringTypes() throws Exception {
+        Preconditions.checkArgument(this.helper.getModules() != null, "No modules found");
+        Module strTypes = this.helper.getModules().stream()
+                .filter(module -> module.getName().equals("string-types"))
+                .findFirst()
+                .orElseThrow(() -> new IllegalArgumentException("String types module not found"));
+
+        final DefinitionGenerator generator = new DefinitionGenerator();
+        final ObjectNode jsonObject = generator.convertToJsonSchema(strTypes, this.schemaContext, new DefinitionNames(),
+                ApiDocServiceImpl.OAversion.V2_0, true);
+
+        Assert.assertNotNull(jsonObject);
+    }
 }