forked from loafle/openapi-generator-original
Moved GlobalSupportingFile to separate file
This commit is contained in:
parent
d82c77da34
commit
ef66f9622c
@ -792,7 +792,7 @@ public class DefaultCodegen {
|
|||||||
importMapping.put("LocalDate", "org.joda.time.*");
|
importMapping.put("LocalDate", "org.joda.time.*");
|
||||||
importMapping.put("LocalTime", "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,
|
cliOptions.add(CliOption.newBoolean(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG,
|
||||||
CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG_DESC).defaultValue(Boolean.TRUE.toString()));
|
CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG_DESC).defaultValue(Boolean.TRUE.toString()));
|
||||||
|
@ -531,7 +531,7 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
String templateFile;
|
String templateFile;
|
||||||
if( support instanceof SupportingFile.GlobalSupportingFile) {
|
if( support instanceof GlobalSupportingFile) {
|
||||||
templateFile = config.getCommonTemplateDir() + File.separator + support.templateFile;
|
templateFile = config.getCommonTemplateDir() + File.separator + support.templateFile;
|
||||||
} else {
|
} else {
|
||||||
templateFile = getFullTemplateFile(config, support.templateFile);
|
templateFile = getFullTemplateFile(config, support.templateFile);
|
||||||
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
@ -48,17 +48,6 @@ public class SupportingFile {
|
|||||||
result = 31 * result + (destinationFilename != null ? destinationFilename.hashCode() : 0);
|
result = 31 * result + (destinationFilename != null ? destinationFilename.hashCode() : 0);
|
||||||
return result;
|
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -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("Sanitizer-header.mustache", coreFileFolder(), classPrefix + "Sanitizer.h"));
|
||||||
supportingFiles.add(new SupportingFile("Logger-body.mustache", coreFileFolder(), classPrefix + "Logger.m"));
|
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("Logger-header.mustache", coreFileFolder(), classPrefix + "Logger.h"));
|
||||||
supportingFiles.add(new SupportingFile("JSONValueTransformer+ISO8601.m", coreFileFolder(), "JSONValueTransformer+ISO8601.m"));
|
supportingFiles.add(new SupportingFile("JSONValueTransformer+ISO8601-body.mustache", coreFileFolder(), "JSONValueTransformer+ISO8601.m"));
|
||||||
supportingFiles.add(new SupportingFile("JSONValueTransformer+ISO8601.h", coreFileFolder(), "JSONValueTransformer+ISO8601.h"));
|
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-body.mustache", coreFileFolder(), classPrefix + "Configuration.m"));
|
||||||
supportingFiles.add(new SupportingFile("Configuration-header.mustache", coreFileFolder(), classPrefix + "Configuration.h"));
|
supportingFiles.add(new SupportingFile("Configuration-header.mustache", coreFileFolder(), classPrefix + "Configuration.h"));
|
||||||
supportingFiles.add(new SupportingFile("api-protocol.mustache", coreFileFolder(), classPrefix + "Api.h"));
|
supportingFiles.add(new SupportingFile("api-protocol.mustache", coreFileFolder(), classPrefix + "Api.h"));
|
||||||
|
@ -174,28 +174,3 @@
|
|||||||
of your accepting any such warranty or additional liability.
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
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.
|
|
@ -174,28 +174,3 @@
|
|||||||
of your accepting any such warranty or additional liability.
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
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.
|
|
||||||
|
@ -6,7 +6,7 @@ This ObjC package is automatically generated by the [Swagger Codegen](https://gi
|
|||||||
|
|
||||||
- API version: 1.0.0
|
- API version: 1.0.0
|
||||||
- Package version:
|
- 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
|
- Build package: class io.swagger.codegen.languages.ObjcClientCodegen
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
@ -2,7 +2,29 @@
|
|||||||
#import <ISO8601/ISO8601.h>
|
#import <ISO8601/ISO8601.h>
|
||||||
#import <JSONModel/JSONValueTransformer.h>
|
#import <JSONModel/JSONValueTransformer.h>
|
||||||
|
|
||||||
{{>licenceInfo}}
|
/**
|
||||||
|
* Swagger Petstore
|
||||||
|
* This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> 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)
|
@interface JSONValueTransformer (ISO8601)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user