forked from loafle/openapi-generator-original
[Swift] Add / as enum separator
This commit is contained in:
parent
504f8f1f21
commit
0a2d62a8ba
@ -396,8 +396,8 @@ public class SwiftCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
char[] separators = {'-', '_', ' ', ':'};
|
char[] separators = {'-', '_', ' ', ':', '/'};
|
||||||
return WordUtils.capitalizeFully(StringUtils.lowerCase(value), separators).replaceAll("[-_ :]", "");
|
return WordUtils.capitalizeFully(StringUtils.lowerCase(value), separators).replaceAll("[-_ :/]", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -49,6 +49,11 @@ public class SwiftCodegenTest {
|
|||||||
Assert.assertEquals(swiftCodegen.toSwiftyEnumName("entry_name"), "EntryName");
|
Assert.assertEquals(swiftCodegen.toSwiftyEnumName("entry_name"), "EntryName");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testSlash() throws Exception {
|
||||||
|
Assert.assertEquals(swiftCodegen.toSwiftyEnumName("application/x-tar"), "ApplicationXTar");
|
||||||
|
}
|
||||||
|
|
||||||
@Test(description = "returns NSData when response format is binary")
|
@Test(description = "returns NSData when response format is binary")
|
||||||
public void binaryDataTest() {
|
public void binaryDataTest() {
|
||||||
final Swagger model = new SwaggerParser().read("src/test/resources/2_0/binaryDataTest.json");
|
final Swagger model = new SwaggerParser().read("src/test/resources/2_0/binaryDataTest.json");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user