mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-03 06:00:52 +00:00
Add "Contact" name, URL (#7164)
* update swagger parser, core version the latest * add info name and email
This commit is contained in:
parent
c774e98464
commit
81c0e81c77
@ -207,11 +207,17 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
|
|||||||
|
|
||||||
if (info.getContact() != null) {
|
if (info.getContact() != null) {
|
||||||
Contact contact = info.getContact();
|
Contact contact = info.getContact();
|
||||||
config.additionalProperties().put("infoUrl", config.escapeText(contact.getUrl()));
|
|
||||||
if (contact.getEmail() != null) {
|
if (contact.getEmail() != null) {
|
||||||
config.additionalProperties().put("infoEmail", config.escapeText(contact.getEmail()));
|
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) {
|
if (info.getLicense() != null) {
|
||||||
License license = info.getLicense();
|
License license = info.getLicense();
|
||||||
if (license.getName() != null) {
|
if (license.getName() != null) {
|
||||||
@ -221,12 +227,14 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
|
|||||||
config.additionalProperties().put("licenseUrl", config.escapeText(license.getUrl()));
|
config.additionalProperties().put("licenseUrl", config.escapeText(license.getUrl()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info.getVersion() != null) {
|
if (info.getVersion() != null) {
|
||||||
config.additionalProperties().put("version", config.escapeText(info.getVersion()));
|
config.additionalProperties().put("version", config.escapeText(info.getVersion()));
|
||||||
} else {
|
} else {
|
||||||
LOGGER.error("Missing required field info version. Default version set to 1.0.0");
|
LOGGER.error("Missing required field info version. Default version set to 1.0.0");
|
||||||
config.additionalProperties().put("version", "1.0.0");
|
config.additionalProperties().put("version", "1.0.0");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info.getTermsOfService() != null) {
|
if (info.getTermsOfService() != null) {
|
||||||
config.additionalProperties().put("termsOfService", config.escapeText(info.getTermsOfService()));
|
config.additionalProperties().put("termsOfService", config.escapeText(info.getTermsOfService()));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user