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 2c166e69577..bba4e9f0511 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 @@ -207,11 +207,17 @@ public class DefaultGenerator extends AbstractGenerator implements Generator { if (info.getContact() != null) { Contact contact = info.getContact(); - config.additionalProperties().put("infoUrl", config.escapeText(contact.getUrl())); if (contact.getEmail() != null) { config.additionalProperties().put("infoEmail", config.escapeText(contact.getEmail())); } + if (contact.getName() != null) { + config.additionalProperties().put("infoName", config.escapeText(contact.getName())); + } + if (contact.getUrl() != null) { + config.additionalProperties().put("infoUrl", config.escapeText(contact.getUrl())); + } } + if (info.getLicense() != null) { License license = info.getLicense(); if (license.getName() != null) { @@ -221,12 +227,14 @@ public class DefaultGenerator extends AbstractGenerator implements Generator { config.additionalProperties().put("licenseUrl", config.escapeText(license.getUrl())); } } + if (info.getVersion() != null) { config.additionalProperties().put("version", config.escapeText(info.getVersion())); } else { LOGGER.error("Missing required field info version. Default version set to 1.0.0"); config.additionalProperties().put("version", "1.0.0"); } + if (info.getTermsOfService() != null) { config.additionalProperties().put("termsOfService", config.escapeText(info.getTermsOfService())); }