swagger-elm icon indicating copy to clipboard operation
swagger-elm copied to clipboard

Name collisions when enums are also used as a response name

Open eeue56 opened this issue 7 years ago • 1 comments

E.g type ResourceType = Text | Title | Article and type Article = Article ArticleRecord

eeue56 avatar Aug 01 '17 15:08 eeue56

This was caused by me listening to #7. I don't see any other solution than prefixing enum's, which is ugly. Maybe a config param is the solution again?

One solution which i would like in general would be to generate one file per definition. That would also solve naming of nested objects (eg instead of ParentChild it would be a module named Parent.Child. That way Resource.Type.Article would not collide with Article. However that would make recursive types impossible...

Speaking of that, do you know if there's any theoretical reason why modules can't have cyclical dependencies? I guess there are compiling reasons i know nothing about, but if functions and types can be recursive, and modules are just collections of functions and types, why not?

ahultgren avatar Aug 07 '17 19:08 ahultgren