diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java index cc850a39e11..fceb69ac8db 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java @@ -792,7 +792,7 @@ public class DefaultCodegen { importMapping.put("LocalDate", "org.joda.time.*"); importMapping.put("LocalTime", "org.joda.time.*"); - supportingFiles.add(new SupportingFile.GlobalSupportingFile("LICENSE.mustache", "LICENSE")); + supportingFiles.add(new GlobalSupportingFile("LICENSE", "LICENSE")); cliOptions.add(CliOption.newBoolean(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG_DESC).defaultValue(Boolean.TRUE.toString())); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java index 1684bf40705..231cf496d05 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java @@ -531,7 +531,7 @@ public class DefaultGenerator extends AbstractGenerator implements Generator { continue; } String templateFile; - if( support instanceof SupportingFile.GlobalSupportingFile) { + if( support instanceof GlobalSupportingFile) { templateFile = config.getCommonTemplateDir() + File.separator + support.templateFile; } else { templateFile = getFullTemplateFile(config, support.templateFile); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/GlobalSupportingFile.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/GlobalSupportingFile.java new file mode 100644 index 00000000000..ee7a1dc659b --- /dev/null +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/GlobalSupportingFile.java @@ -0,0 +1,12 @@ +package io.swagger.codegen; + +public class GlobalSupportingFile extends SupportingFile { + + GlobalSupportingFile(String templateFile, String folder, String destinationFilename) { + super(templateFile, folder, destinationFilename); + } + + GlobalSupportingFile(String templateFile, String destinationFilename) { + super(templateFile, destinationFilename); + } +} diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/SupportingFile.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/SupportingFile.java index 3643c8c6a92..74bee83ef24 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/SupportingFile.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/SupportingFile.java @@ -48,17 +48,6 @@ public class SupportingFile { result = 31 * result + (destinationFilename != null ? destinationFilename.hashCode() : 0); return result; } - - static public class GlobalSupportingFile extends SupportingFile { - - GlobalSupportingFile(String templateFile, String folder, String destinationFilename) { - super(templateFile, folder, destinationFilename); - } - - GlobalSupportingFile(String templateFile, String destinationFilename) { - super(templateFile, destinationFilename); - } - } } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ObjcClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ObjcClientCodegen.java index 431bb4ba51f..0a2a812ab0e 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ObjcClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ObjcClientCodegen.java @@ -242,8 +242,8 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { supportingFiles.add(new SupportingFile("Sanitizer-header.mustache", coreFileFolder(), classPrefix + "Sanitizer.h")); supportingFiles.add(new SupportingFile("Logger-body.mustache", coreFileFolder(), classPrefix + "Logger.m")); supportingFiles.add(new SupportingFile("Logger-header.mustache", coreFileFolder(), classPrefix + "Logger.h")); - supportingFiles.add(new SupportingFile("JSONValueTransformer+ISO8601.m", coreFileFolder(), "JSONValueTransformer+ISO8601.m")); - supportingFiles.add(new SupportingFile("JSONValueTransformer+ISO8601.h", coreFileFolder(), "JSONValueTransformer+ISO8601.h")); + supportingFiles.add(new SupportingFile("JSONValueTransformer+ISO8601-body.mustache", coreFileFolder(), "JSONValueTransformer+ISO8601.m")); + supportingFiles.add(new SupportingFile("JSONValueTransformer+ISO8601-header.mustache", coreFileFolder(), "JSONValueTransformer+ISO8601.h")); supportingFiles.add(new SupportingFile("Configuration-body.mustache", coreFileFolder(), classPrefix + "Configuration.m")); supportingFiles.add(new SupportingFile("Configuration-header.mustache", coreFileFolder(), classPrefix + "Configuration.h")); supportingFiles.add(new SupportingFile("api-protocol.mustache", coreFileFolder(), classPrefix + "Api.h")); diff --git a/modules/swagger-codegen/src/main/resources/_common/LICENSE.mustache b/modules/swagger-codegen/src/main/resources/_common/LICENSE similarity index 89% rename from modules/swagger-codegen/src/main/resources/_common/LICENSE.mustache rename to modules/swagger-codegen/src/main/resources/_common/LICENSE index 8dada3edaf5..d9a10c0d8e8 100644 --- a/modules/swagger-codegen/src/main/resources/_common/LICENSE.mustache +++ b/modules/swagger-codegen/src/main/resources/_common/LICENSE @@ -174,28 +174,3 @@ of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/modules/swagger-codegen/src/main/resources/objc/JSONValueTransformer+ISO8601.m b/modules/swagger-codegen/src/main/resources/objc/JSONValueTransformer+ISO8601-body.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/objc/JSONValueTransformer+ISO8601.m rename to modules/swagger-codegen/src/main/resources/objc/JSONValueTransformer+ISO8601-body.mustache diff --git a/modules/swagger-codegen/src/main/resources/objc/JSONValueTransformer+ISO8601.h b/modules/swagger-codegen/src/main/resources/objc/JSONValueTransformer+ISO8601-header.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/objc/JSONValueTransformer+ISO8601.h rename to modules/swagger-codegen/src/main/resources/objc/JSONValueTransformer+ISO8601-header.mustache diff --git a/samples/client/petstore/objc/LICENSE b/samples/client/petstore/objc/LICENSE index 8dada3edaf5..d9a10c0d8e8 100644 --- a/samples/client/petstore/objc/LICENSE +++ b/samples/client/petstore/objc/LICENSE @@ -174,28 +174,3 @@ of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/samples/client/petstore/objc/README.md b/samples/client/petstore/objc/README.md index f129b95b501..44bff87c42e 100644 --- a/samples/client/petstore/objc/README.md +++ b/samples/client/petstore/objc/README.md @@ -6,7 +6,7 @@ This ObjC package is automatically generated by the [Swagger Codegen](https://gi - API version: 1.0.0 - Package version: -- Build date: 2016-05-27T12:41:24.581+02:00 +- Build date: 2016-05-27T16:03:28.462+02:00 - Build package: class io.swagger.codegen.languages.ObjcClientCodegen ## Requirements diff --git a/samples/client/petstore/objc/SwaggerClient/Core/JSONValueTransformer+ISO8601.h b/samples/client/petstore/objc/SwaggerClient/Core/JSONValueTransformer+ISO8601.h index 2a8d5b0c9e7..dd8e721b3b9 100644 --- a/samples/client/petstore/objc/SwaggerClient/Core/JSONValueTransformer+ISO8601.h +++ b/samples/client/petstore/objc/SwaggerClient/Core/JSONValueTransformer+ISO8601.h @@ -2,7 +2,29 @@ #import #import -{{>licenceInfo}} +/** +* Swagger Petstore +* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* OpenAPI spec version: 1.0.0 +* Contact: apiteam@wordnik.com +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ @interface JSONValueTransformer (ISO8601)