Created
August 31, 2016 17:47
-
-
Save tao-qian/2fd68d6035186247ee20519b05ffe437 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void fieldsUseLowerCaseCamel() { | |
String schema = readFileToString(new File(getClass().getResource("/schema.json").getPath()), Charset.forName("UTF-8")); | |
Swagger swagger = new SwaggerParser().parse(schema); | |
for (Map.Entry<String, Model> entry : swagger.getDefinitions().entrySet()) { | |
if (entry.getValue().getProperties() == null) { | |
continue; | |
} | |
for (String fieldName : entry.getValue().getProperties().keySet()) { | |
assertTrue(fieldName + " of " + entry.getKey() + " should be lowerCaseCamel", LOWER_CASE_CAMEL.matcher(fieldName).matches()); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment