Split interfaces to different files #385
Replies: 2 comments 4 replies
-
@sharpzilla thanks for taking the time to bring this up As of right now, there is no way to generate multiple files. This is something I am working on. To begin with, I want to enable an option to split the generated types into individual files. To begin with, that would be the following:
Unfortunately, I piggyback entirely on NSwag for generating the models, and as far as I know, they only support generating a single file for models I haven't thought about whether this would be the default, or should be enabled using some sort of option like |
Beta Was this translation helpful? Give feedback.
-
Hello @christianhelle, I realy like this project and want to contribute about this issue. I investigate the nswag generator toolchain and there is a option for generation only models and not client code (Source). Maybe we create some sort of option like This seperation is realy neccessary for me because we use clean architecture in our project and we want to store this generated client in our Infrastructure and models in Domain layer. But without seperation of client and models we force to use this generated file in our core (Business) layer but clean architecture recommends to store any external connection in Infra layer therefore we violated this clean architecture approach. For example, if you use database in your application, you put DbContext class in your Infra layer and put Entites class in Domain layer and there is genertor for this use case like Are you recommend me someway to implement this, I realy want to contribute this great project? |
Beta Was this translation helpful? Give feedback.
-
Hello, is there a way to generate file per tag when I'm generating clients with options "multipleInterfaces": "ByTag"?
Also is there a way to disable generation of models from open api specification? I have this structure of my solution: Api, Api.Client, Api.Models. Api.Models is shared project with projects: Api and Api.Client and it contains requets and response models and enums. Basically I don't need generated models from refitter I'm fine with my existed models from Api.Models.
Beta Was this translation helpful? Give feedback.
All reactions