Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enum parse enhancement #67

Open
ratoshniuk opened this issue Jan 4, 2019 · 0 comments
Open

Enum parse enhancement #67

ratoshniuk opened this issue Jan 4, 2019 · 0 comments

Comments

@ratoshniuk
Copy link

Current parse method is case sensitive.

enum CustomEnum {
    Field1
    Field2
}

def parse(str: String) : CustomEnum = {
     str match {
          case "Field1" => Field1
          case "Field2" => Field2
     }
} 

it could be much better to parse lower case. we could use enum values as path prefixes in http routes, for example

def parse(str: String) : CustomEnum = {
     str.toLowerCase match {
} 
@neko-kai neko-kai transferred this issue from 7mind/izumi Mar 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant