8000 Case insensitive parsing of string · Issue #1 · terezka/yaml · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Case insensitive parsing of string #1
Open
@Natim

Description

@Natim

I tried to parse the following YAML:

  - name: GARLIC
    units: 
      - clove
      - grams
  - name: "GARLIC POWDER"
    units: 
      - grams

For some reasons GARLIC is parsed as garlic (lowercase) while GARLIC POWDER is parsed in uppercase.

As a fix, I used the following parser:

(Decode.field "name"
    (Decode.string
        |> Decode.andThen (String.toUpper >> Decode.succeed)
    )
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0