cancel
Showing results for 
Search instead for 
Did you mean: 

Code-gen for Domain Models

Highlighted
New Member

Code-gen for Domain Models

Hi - I have a question I cannot find the answer to in documentation, hoping you can assist!

 

I have a project with a number of APIs defined. I also have a number of Domains defined, and I reference models in the domains from the APIs.


My problem/query relates to the code generation from the combination of Model/API.

 

When I generate code (java) from an API, where models are referenced, the API 'pulls' a copy of the domain models locally into the generated code. I understand the logic of this, however, from a production point of view, I don't expect to have multiple copies of domain models spread across each API. Instead, I wanted to do what we would see as standard, which is to make a Java JAR file from the Domain models, and deploy this with the individual API projects as a dependency. This allows us to ensure that each API is using the same version of our shared (domain) models, with no fear of different APIs using different model versions.

 

I am aware that perhaps what I have described above is not 'the way' to use domains, so am open to any suggestions to get to a workable solution.


thanks,


Allen.

 

 

 

1 REPLY 1
Highlighted
Community Hero

Re: Code-gen for Domain Models

Not exactly same question, but seems to be a little related. Please this thread and there is reply
https://community.smartbear.com/t5/SwaggerHub/Best-Practices-for-Generating-Client-code-amp-Build-li...


Regards,
Rao.
New Here?
Join us and watch the welcome video: