ahultgren / swagger-elm

Generate Elm types and decoders based on a Swagger file
74 stars 9 forks source link

Fix lower case key with value type object bug #11

Closed mxinden closed 7 years ago

mxinden commented 7 years ago

Having a lower case key with a value type object will fail, because the type definition will be defined in upper case but the decoder function argument will be lower case.

swagger.json example

    "lowerCaseDefinitionObject": {
      "type": "object"
    }

will result in

decodeLowerCaseDefinitionObject : Decoder LowerCaseDefinitionObject
decodeLowerCaseDefinitionObject =
    decode lowerCaseDefinitionObject

The compiler will grouch about it as it doesn't know the type lowerCaseDefinitionObject but only the type LowerCaseDefinitionObject.

@ahultgren Let me know what you think. Happy for any feedback!

I will look into implementing the map feature from issue #10 tomorrow.

Related to issue #10 and Alertmanager PR

ahultgren commented 7 years ago

Thanks! LGTM, although bugs like this (and #9) is why I need to rewrite the codebase...