-
Notifications
You must be signed in to change notification settings - Fork 154
Use newest templates for java client #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Do we want to do this or just check in the generated code into the java client tree? |
The point of this gen repo is to let user generate a client for their
custom API server (that would be possible after creating java-core repo).
To do so, all generating parts should remain in this repo (mobile short
reply again)
…On Jun 30, 2017 9:29 PM, "Brendan Burns" ***@***.***> wrote:
Do we want to do this or just check in the generated code into the java
client tree?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#16 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABic4CvHTpPnWjrnIDsi032818tphWoVks5sJcsngaJpZM4OIWXo>
.
|
Hrm, I thought that a better approach would be to freeze the relevant manually updated files. (I did this with the swagger-codegen-ignore file. That way manual updates don't get reverted, but we don't have to host the full set of mustache files (which are inevitably going to get out of sync with the main repo...) |
The ultimate goal for repo separation is to enable users to provide an OpenAPI spec and get a fully functional client. Our own client should be ultimately the result of this generation process. The design is to have three repos:
Putting these files in java client makes a dependency from More of (maybe unrelated) thoughts on the design:
|
I think I view it slightly differently. When we pin something because of an upstream fix where we are waiting for the generators to catch up, we are effectively moving something from I think vendoring the mustache files is going to be disasterous, since we will have to continually re-vendor in fixes from the upstream generators, etc. And/or there will always be the temptation to fix things in the mustache files and never upstream those changes back into the I really don't think that mustache template files belong in our repos. If we want to make the Additionally, I kind of disagree with your plan, I think it is overly complicated for what it is trying to achieve. What is wrong with just having a |
I want to break discussion into two section: A. Should we copy templates from swagger-codegen main repo? B. If we want to copy templates, where should we put them? Sorry for long reply. We can continue discussion on another more interactive medium (chat/VC) if you want. |
@mbohlool I totally understand where you are coming from, but I have a couple of concerns:
I'm quite concerned that what will actually happen is that we will copy "latest" but then "latest" will be "released" and eventually "old" and we won't actually update the template files so we'll end up lagging.
On the other hand, what is the cost of freezing/updating the generated source code instead of the templates? I don't see any real cost to that (and it's even ok if we move things from the But, if you would rather take this approach, as long as we get the right automation in place to deal with these concerns, it seems fine with me. |
I think I did not understand this approach and how it solves the problem of:
Can you elaborate on that? |
I thought about this some more, how is this for a revised compromise: We don't check in the files here, but we do build a Docker image for generating the client code. That way, when we want to rev. the templates, we can rev the Docker image to include the newest templates. We can check in the Dockerfile to build that image (which includes checking out/building swagger-gen at the right commit) That way, we can use the latest templates, enable people to generate from a Docker image, but still not check the templates into our source tree... Does that work for you? Thanks |
That sounds like a reasonable compromise to me. I will try to make that docker image. The docker image can also get a specific swagger-codegen branch/tag/sha and build that locally inside the image and use that instead of only templates (there could be logical changes with those new templates, this is safer I guess). |
closing in favor of #20 |
The new swagger-codegen templates for java has a way to create an Operation's Call object. That is required to implement watch. We can remove this when swagger-codegen releases 2.3.0.
depends on #15