-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Add Apache v2 license to auto-generated files #2963
Comments
Is this needed for some legal reason? Also, is this legally sound? One could say that the generated code is derived from both the template files (which certainly have the same license as the rest of this project) and the API definition – the latter one is provided by the user, and could have conflicting licensing requirements (e.g. a copyleft license as GPL). In that case I guess the generated code would need to be GPL, too (or the user would not be allowed to use the generator). |
@ePaul thanks for your questions and please refer to the following discussion for more information. https://twitter.com/TimHaines/status/729717172889489408 Disclaimer: I'm no expert in software licensing |
@wing328 Thanks. Just for the future, it would be nice if (in cases there has been some discussion) this discussion is linked right when the issue is opened, so people know why stuff is done. |
Yup, definitely valid point. I've been trying my best to keep the community informed but sometimes I did miss it. Feel free to ask whenever you've questions for us. |
tl;dr: You should license the template files Apache 2, but not assume it applies it to the resulting generated code. The reasoning in the linked discussions is not sound. Swift is licensed Apache 2, but not every application built using the swift compiler is infected with the same license. Only the most viral licenses work this way, and Apache is not one of them. In the same way, since the templates are processed and the generated code represents a new product, the license does not persist. I'm not a lawyer, but this seems to be the intent of the license and of the swagger team. If you make an exception (making Apache viral across swagger-codegen use) and put the license on the generated code, it isn't as simple as "do what you want". You must state changes, grant use of patents, and otherwise comply with the terms of the Apache License.... otherwise what you have is just some comments in a header and not really a license. The output code is also possibly further restricted in use by the input swagger definition, which may be incompatible with Apache 2 or not be relicensable. Specifically, Mozilla and GPL* are not relicensable (but I don't know if people actually license their swagger defs under those licenses, though I imagine AGPL is likely to come up). Putting the Apache 2 license in the resulting files:
At the end of the day, putting the license in the generated code violates user expectations, is probably not the intent of the license or the developers, and makes adoption more risky/complicated. |
My reaction now on my second time trying to run new versions with this change on some gem code. I didn't share it the first time because I thought I did something wrong, and wanted to try again, but now I have so:
|
I would like to second @xtoddx's sentiment. This is tantamount to my compiler or code editor enforcing a licence on the code I write. It is claimed that I can "do what you want" with the generated code, but there is no documentation telling me that I can "do what you want" with the code other than a tweet and some hard to find Github issues. The files themselves say: "may not use this file except in compliance with the License". I cannot find the part of the Apache License that allows you to remove the license, because it doesn't exist. So i cannot do what ever I want, because that would violate the license. Do I now have to write tests to make sure that any Apache License is removed before I publish the generated library? This makes it very difficult to use swagger-codegen as anything other than a toy. Suggestions:
In what cases is the output of a GPL program covered by the GPL too?
It goes on to say that:
I'm not clear on the internals of swagger-codegen, does it fill in templates? Does it just fill in the template and copy it out? If so then take a look a Bison and do what they did: http://www.gnu.org/software/bison/manual/html_node/Conditions.html I know copyright and licensing can be difficult, especially in an international context, but this is really important. |
Well, to be clear, the intent is that you can do anything you want with the generated files, period. This is no trick, but if someone wants to get a legal opinion on how to update the repository to make this 100% clear, I'd be happy to see if we can follow their recommendations. Saying that the templates must have the license in them is silly. You can use your own templates with the We can add something in the |
You need a lawyer's opinion. Open Source Institute or Software Freedom Conservancy would be good choice for a consultation and probably at no cost. |
@wearpants thanks for the suggestion. I've contacted Software Freedom Conservancy to get their view/opinion on this as well. |
Is there any follow up on being able to remove the Apache license in generated code? I'm using a custom template, so I don't want to be forced to use the Apache license with the generated library. |
Yes, I reached out to Software Freedom Conservancy via email (like 2 months ago) but no reply (maybe they're very busy) I believe Tony has engaged Open Source Institute to review but I foresee it would take some time to see some progress. |
Yes, as @wing328 the Linux Foundation legal team is reviewing this. I will report back. |
Hi - any updates on the Linux Foundation review? My specific questions are in #4104, but I wanted to check if I could use the above statement from @fehguy as official guidance from the Swagger team:
Does this mean that we are free to modify the provided template files as we see fit, for our own use cases? And that we are free to remove the Apache 2.0 license terms / SmartBear copyright notice from our versions of the template files, so that those terms don't appear in our generated libraries? |
I will ping them again, it has been slow going... It is my intent that you can indeed remove the copyright from the templates and therefore the generated files. I want to make sure the license interpretation lines up with that--let me see if I can get an answer. |
Folks, I had another interaction with the Linux Foundation leaders. Their suggestion: ask your lawyer. I understand the confusion and some changes that were made in the generation can also aggravate it. This project has been as a service to users of the Swagger / Open API Specification and has no intent in controlling what you do with the generated files, period. I will update the README to make this clear. I will also suggest that, like has been asked, there should be no generated LICENSE file in any clients. Finally, the README will state that the templates are apache 2.0 licensed and that the derived files are subject to the licensing of your choice. This is like ProGuard--the code is yours after you generate it, period. |
Thanks Tony. I've filed #4149 to demostrate how to remove the license for a generator (Ruby API client as an example). What I would suggest is to provide instruction for users to customize the license instead (while keeping Apache 2.0 as the default):
and then generate the code using That way users can more easily customize the license of the auto-generated code by simply replacing Apache 2.0 license with other license of their choice in just 2 files. |
As discussed with Tony, we'll completely remove all the license-related text in the auto-generated code and I'll write up a tutorial on how to customize swagger codegen to generate code with software license based on user's choice. ETA: next Wed (Nov 16) |
Licence text has been removed. Closing this. |
@wing328 could you share the link of tutorial mentioned? |
We will update the auto-generated files for all languages (both API clients and server stubs).
#2960 for C# API client is a good reference.
API clients
Server stubs
The text was updated successfully, but these errors were encountered: