adding extra nodeClientOptions

This commit is contained in:
Kristof Vrolijkx
2016-04-25 23:00:48 +02:00
parent 28f444e808
commit c91f23c2ca
3 changed files with 35 additions and 16 deletions

View File

@@ -7,7 +7,9 @@ import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Date;
import io.swagger.codegen.CliOption;
import io.swagger.codegen.SupportingFile;
import io.swagger.models.properties.BooleanProperty;
public class TypeScriptNodeClientCodegen extends AbstractTypeScriptClientCodegen {
private static final Logger LOGGER = LoggerFactory.getLogger(TypeScriptNodeClientCodegen.class);
@@ -22,15 +24,17 @@ public class TypeScriptNodeClientCodegen extends AbstractTypeScriptClientCodegen
protected String npmVersion = "1.0.0";
protected String npmRepository = null;
@Override
public String getName() {
return "typescript-node";
public TypeScriptNodeClientCodegen() {
super();
outputFolder = "generated-code/typescript-node";
embeddedTemplateDir = templateDir = "typescript-node";
this.cliOptions.add(new CliOption(NPM_NAME, "The name under which you want to publish generated npm package"));
this.cliOptions.add(new CliOption(NPM_VERSION, "The version of your npm package"));
this.cliOptions.add(new CliOption(NPM_REPOSITORY, "Use this property to set an url your private npmRepo in the package.json"));
this.cliOptions.add(new CliOption(SNAPSHOT, "When setting this property to true the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm", BooleanProperty.TYPE).defaultValue(Boolean.FALSE.toString()));
}
@Override
public String getHelp() {
return "Generates a TypeScript nodejs client library.";
}
@Override
public void processOpts() {
@@ -73,13 +77,18 @@ public class TypeScriptNodeClientCodegen extends AbstractTypeScriptClientCodegen
String indexPackage = modelPackage.substring(0, Math.max(0, modelPackage.lastIndexOf('.')));
return indexPackage.replace('.', File.separatorChar);
}
public TypeScriptNodeClientCodegen() {
super();
outputFolder = "generated-code/typescript-node";
embeddedTemplateDir = templateDir = "typescript-node";
@Override
public String getName() {
return "typescript-node";
}
@Override
public String getHelp() {
return "Generates a TypeScript nodejs client library.";
}
public void setNpmName(String npmName) {
this.npmName = npmName;
}