mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 19:08:52 +00:00
Merge pull request #3965 from ButterflyNetwork/swift-enum
[Swift] Add / as enum separator
This commit is contained in:
commit
acfd2578dc
@ -396,8 +396,8 @@ public class SwiftCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
return value;
|
||||
}
|
||||
|
||||
char[] separators = {'-', '_', ' ', ':'};
|
||||
return WordUtils.capitalizeFully(StringUtils.lowerCase(value), separators).replaceAll("[-_ :]", "");
|
||||
char[] separators = {'-', '_', ' ', ':', '/'};
|
||||
return WordUtils.capitalizeFully(StringUtils.lowerCase(value), separators).replaceAll("[-_ :/]", "");
|
||||
}
|
||||
|
||||
|
||||
|
@ -49,6 +49,11 @@ public class SwiftCodegenTest {
|
||||
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")
|
||||
public void binaryDataTest() {
|
||||
final Swagger model = new SwaggerParser().read("src/test/resources/2_0/binaryDataTest.json");
|
||||
|
Loading…
Reference in New Issue
Block a user