What is the License of Generated Code?

770 views
Skip to first unread message

Tristan Juricek

unread,
Feb 26, 2016, 12:09:19 PM2/26/16
to Swagger
Is the license of the generated code output of Swagger also necessarily Apache License 2.0? Or is it "whatever we want".

We have products we're looking to include this in, but, some of the tools (notably the C++ stuff) would probably build using the generated client library as source, which we want to keep commercially licensed. 

Ergo, I'm wondering if we can generate some client API libraries, and even release a few of them under different licenses (we typically release them under MIT).

Tony Tam

unread,
Feb 26, 2016, 12:19:39 PM2/26/16
to swagger-sw...@googlegroups.com
I believe we should clarify that all generated code is Apache 2.0, like the parent project.  The dependencies are going to be your job to verify, though.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

wing328

unread,
Feb 29, 2016, 9:54:08 PM2/29/16
to Swagger
Hi Tony,

Currently, we've the following mustache template in the auto-generated Ruby files:

{{#appName}}{{{appName}}}

{{/appName}}
{{#appDescription}}{{{appDescription}}}

{{/appDescription}}
{{#version}}OpenAPI spec version: {{version}}{{/version}}
{{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}}

{{#licenseInfo}}
License: {{{licenseInfo}}}
{{#licenseUrl}}{{licenseUrl}}{{/licenseUrl}}

{{/licenseInfo}}
{{#termsOfService}}
Terms of Service: {{{termsOfService}}}
{{/termsOfService}}

The license info and URL are obtained from the spec. Shall we remove it and hard-code to Apache 2.0?

I will apply the same "partial" mustache template to all langauges if you're ok with it.

William



tony tam於 2016年2月27日星期六 UTC+8上午1時19分39秒寫道:
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.

tony tam

unread,
Feb 29, 2016, 11:56:24 PM2/29/16
to swagger-sw...@googlegroups.com
Interesting dilemma.  The templates are Apache 2.0 and what they output is really up to the person generating them.  How do you think we best convey this?

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.

William Cheng

unread,
Mar 1, 2016, 2:15:17 AM3/1/16
to swagger-sw...@googlegroups.com
I prefer sticking with parent licence (Apache 2.0) and we'll revisit
this only if there's a demand to use the license specified in OpenAPI
spec.
>> email to swagger-swaggers...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Swagger" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to swagger-swaggers...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Swagger" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/swagger-swaggersocket/6JcsR4mWpYk/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to

Ron Ratovsky

unread,
Mar 1, 2016, 2:15:59 AM3/1/16
to swagger-sw...@googlegroups.com
I think it’s simple. The codegen itself is Apache 2.0, and so are the templates.
The license of the API has nothing to do with the with license of the generated libraries.

It’s not up to us or our concern what license is used for the generated code.
By definition it should be unlicensed (and unlicensed software is open to interpretation), and it’s up to the user to decide which license they want to attach to the generated code (and any conflicts in licenses would be their responsibility).

Tristan Juricek

unread,
Mar 1, 2016, 10:08:09 AM3/1/16
to Swagger
I just had a conversation with a legal advisor, who said to stick with the parent license for generated code. There's an unclear distinction between the licensed code in the parent and what can "leak" into the client, so the generated code should basically be considered part of the parent. 

This was one data point, but a good one.

I'll be treating the generated code this way: the client libraries will all be separate Apache Licensed projects, and my other code that consumes it will do the standard attribution to Swagger, as if it were a library directly included in the code.

-Tristan
Reply all
Reply to author
Forward
0 new messages