Skip to content

Commit

Permalink
[fix] Allow single character field names (#243)
Browse files Browse the repository at this point in the history
## Before this PR
The CaseConverter in conjure was updated https://github.com/palantir/conjure/blob/master/conjure-generator-common/src/main/java/com/palantir/conjure/CaseConverter.java

So we need to update it here also.

## After this PR

The CaseConverter is updated, allowing single character field names. Additionally I have filed #244 to track using the CaseConverter from conjure
  • Loading branch information
jamesthomp authored and dansanduleac committed Feb 21, 2019
1 parent 8a6ab76 commit 5762117
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@

public final class CaseConverter {
private static final Pattern CAMEL_CASE_PATTERN =
Pattern.compile("^[a-z]([A-Z]{1,2}[a-z0-9]|[a-z0-9])+[A-Z]?$");
Pattern.compile("^[a-z]([A-Z]{1,2}[a-z0-9]|[a-z0-9])*[A-Z]?$");
private static final Pattern KEBAB_CASE_PATTERN =
Pattern.compile("^[a-z]((-[a-z]){1,2}[a-z0-9]|[a-z0-9])+(-[a-z])?$");
Pattern.compile("^[a-z]((-[a-z]){1,2}[a-z0-9]|[a-z0-9])*(-[a-z])?$");
private static final Pattern SNAKE_CASE_PATTERN =
Pattern.compile("^[a-z]((_[a-z]){1,2}[a-z0-9]|[a-z0-9])+(_[a-z])?$");
Pattern.compile("^[a-z]((_[a-z]){1,2}[a-z0-9]|[a-z0-9])*(_[a-z])?$");

private CaseConverter() {}

Expand Down

0 comments on commit 5762117

Please sign in to comment.