swagger-elm
swagger-elm copied to clipboard
Name collisions when enums are also used as a response name
E.g type ResourceType = Text | Title | Article
and type Article = Article ArticleRecord
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?