From 8651975881c75dd8af3965f098cda3f91bcd5bb2 Mon Sep 17 00:00:00 2001 From: Rory Schadler <48921090+roryschadler@users.noreply.github.com> Date: Thu, 26 Jun 2025 11:45:05 -0400 Subject: [PATCH 1/2] fix: skip license if not provided --- .../src/main/resources/python/pyproject.mustache | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/python/pyproject.mustache b/modules/openapi-generator/src/main/resources/python/pyproject.mustache index b97a1a5a77cc..fc949dffbc27 100644 --- a/modules/openapi-generator/src/main/resources/python/pyproject.mustache +++ b/modules/openapi-generator/src/main/resources/python/pyproject.mustache @@ -15,7 +15,9 @@ authors = [ {name = "{{infoName}}{{^infoName}}OpenAPI Generator Community{{/infoName}}",email = "{{infoEmail}}{{^infoEmail}}team@openapitools.org{{/infoEmail}}"}, ] {{/poetry1}} -license = "{{{licenseInfo}}}{{^licenseInfo}}NoLicense{{/licenseInfo}}" +{{#licenseInfo}} +license = "{{{licenseInfo}}}" +{{/licenseInfo}} readme = "README.md" {{#poetry1}} repository = "https://{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}}" From 67b04897ec49c5ec6498a491b9722c71e9ea8a45 Mon Sep 17 00:00:00 2001 From: Rory Schadler <48921090+roryschadler@users.noreply.github.com> Date: Thu, 26 Jun 2025 12:30:34 -0400 Subject: [PATCH 2/2] chore: formatting diff for JavaTimeFormatter.java, Pair.java --- .../client/JavaTimeFormatter.java | 74 ++++++++++--------- .../client/JavaTimeFormatter.java | 74 ++++++++++--------- .../client/JavaTimeFormatter.java | 74 ++++++++++--------- .../java/org/openapitools/client/Pair.java | 50 ++++--------- 4 files changed, 132 insertions(+), 140 deletions(-) diff --git a/samples/client/others/java/restclient-enum-in-multipart/src/main/java/org/openapitools/client/JavaTimeFormatter.java b/samples/client/others/java/restclient-enum-in-multipart/src/main/java/org/openapitools/client/JavaTimeFormatter.java index 3d41d2e57d6b..0a67a5a3f1c5 100644 --- a/samples/client/others/java/restclient-enum-in-multipart/src/main/java/org/openapitools/client/JavaTimeFormatter.java +++ b/samples/client/others/java/restclient-enum-in-multipart/src/main/java/org/openapitools/client/JavaTimeFormatter.java @@ -22,43 +22,47 @@ */ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0-SNAPSHOT") public class JavaTimeFormatter { + private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; - private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; + /** + * Get the date format used to parse/format {@code OffsetDateTime} parameters. + * + * @return DateTimeFormatter + */ + public DateTimeFormatter getOffsetDateTimeFormatter() { + return offsetDateTimeFormatter; + } - /** - * Get the date format used to parse/format {@code OffsetDateTime} parameters. - * @return DateTimeFormatter - */ - public DateTimeFormatter getOffsetDateTimeFormatter() { - return offsetDateTimeFormatter; - } + /** + * Set the date format used to parse/format {@code OffsetDateTime} parameters. + * + * @param offsetDateTimeFormatter {@code DateTimeFormatter} + */ + public void setOffsetDateTimeFormatter(DateTimeFormatter offsetDateTimeFormatter) { + this.offsetDateTimeFormatter = offsetDateTimeFormatter; + } - /** - * Set the date format used to parse/format {@code OffsetDateTime} parameters. - * @param offsetDateTimeFormatter {@code DateTimeFormatter} - */ - public void setOffsetDateTimeFormatter(DateTimeFormatter offsetDateTimeFormatter) { - this.offsetDateTimeFormatter = offsetDateTimeFormatter; + /** + * Parse the given string into {@code OffsetDateTime} object. + * + * @param str String + * @return {@code OffsetDateTime} + */ + public OffsetDateTime parseOffsetDateTime(String str) { + try { + return OffsetDateTime.parse(str, offsetDateTimeFormatter); + } catch (DateTimeParseException e) { + throw new RuntimeException(e); } + } - /** - * Parse the given string into {@code OffsetDateTime} object. - * @param str String - * @return {@code OffsetDateTime} - */ - public OffsetDateTime parseOffsetDateTime(String str) { - try { - return OffsetDateTime.parse(str, offsetDateTimeFormatter); - } catch (DateTimeParseException e) { - throw new RuntimeException(e); - } - } - /** - * Format the given {@code OffsetDateTime} object into string. - * @param offsetDateTime {@code OffsetDateTime} - * @return {@code OffsetDateTime} in string format - */ - public String formatOffsetDateTime(OffsetDateTime offsetDateTime) { - return offsetDateTimeFormatter.format(offsetDateTime); - } -} + /** + * Format the given {@code OffsetDateTime} object into string. + * + * @param offsetDateTime {@code OffsetDateTime} + * @return {@code OffsetDateTime} in string format + */ + public String formatOffsetDateTime(OffsetDateTime offsetDateTime) { + return offsetDateTimeFormatter.format(offsetDateTime); + } +} \ No newline at end of file diff --git a/samples/client/petstore/java/restclient-useSingleRequestParameter-static/src/main/java/org/openapitools/client/JavaTimeFormatter.java b/samples/client/petstore/java/restclient-useSingleRequestParameter-static/src/main/java/org/openapitools/client/JavaTimeFormatter.java index 31556fa9356a..7a47ac33de70 100644 --- a/samples/client/petstore/java/restclient-useSingleRequestParameter-static/src/main/java/org/openapitools/client/JavaTimeFormatter.java +++ b/samples/client/petstore/java/restclient-useSingleRequestParameter-static/src/main/java/org/openapitools/client/JavaTimeFormatter.java @@ -22,43 +22,47 @@ */ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0-SNAPSHOT") public class JavaTimeFormatter { + private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; - private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; + /** + * Get the date format used to parse/format {@code OffsetDateTime} parameters. + * + * @return DateTimeFormatter + */ + public DateTimeFormatter getOffsetDateTimeFormatter() { + return offsetDateTimeFormatter; + } - /** - * Get the date format used to parse/format {@code OffsetDateTime} parameters. - * @return DateTimeFormatter - */ - public DateTimeFormatter getOffsetDateTimeFormatter() { - return offsetDateTimeFormatter; - } + /** + * Set the date format used to parse/format {@code OffsetDateTime} parameters. + * + * @param offsetDateTimeFormatter {@code DateTimeFormatter} + */ + public void setOffsetDateTimeFormatter(DateTimeFormatter offsetDateTimeFormatter) { + this.offsetDateTimeFormatter = offsetDateTimeFormatter; + } - /** - * Set the date format used to parse/format {@code OffsetDateTime} parameters. - * @param offsetDateTimeFormatter {@code DateTimeFormatter} - */ - public void setOffsetDateTimeFormatter(DateTimeFormatter offsetDateTimeFormatter) { - this.offsetDateTimeFormatter = offsetDateTimeFormatter; + /** + * Parse the given string into {@code OffsetDateTime} object. + * + * @param str String + * @return {@code OffsetDateTime} + */ + public OffsetDateTime parseOffsetDateTime(String str) { + try { + return OffsetDateTime.parse(str, offsetDateTimeFormatter); + } catch (DateTimeParseException e) { + throw new RuntimeException(e); } + } - /** - * Parse the given string into {@code OffsetDateTime} object. - * @param str String - * @return {@code OffsetDateTime} - */ - public OffsetDateTime parseOffsetDateTime(String str) { - try { - return OffsetDateTime.parse(str, offsetDateTimeFormatter); - } catch (DateTimeParseException e) { - throw new RuntimeException(e); - } - } - /** - * Format the given {@code OffsetDateTime} object into string. - * @param offsetDateTime {@code OffsetDateTime} - * @return {@code OffsetDateTime} in string format - */ - public String formatOffsetDateTime(OffsetDateTime offsetDateTime) { - return offsetDateTimeFormatter.format(offsetDateTime); - } -} + /** + * Format the given {@code OffsetDateTime} object into string. + * + * @param offsetDateTime {@code OffsetDateTime} + * @return {@code OffsetDateTime} in string format + */ + public String formatOffsetDateTime(OffsetDateTime offsetDateTime) { + return offsetDateTimeFormatter.format(offsetDateTime); + } +} \ No newline at end of file diff --git a/samples/client/petstore/java/vertx-supportVertxFuture/src/main/java/org/openapitools/client/JavaTimeFormatter.java b/samples/client/petstore/java/vertx-supportVertxFuture/src/main/java/org/openapitools/client/JavaTimeFormatter.java index b5fc39069c1f..e84fc7f54629 100644 --- a/samples/client/petstore/java/vertx-supportVertxFuture/src/main/java/org/openapitools/client/JavaTimeFormatter.java +++ b/samples/client/petstore/java/vertx-supportVertxFuture/src/main/java/org/openapitools/client/JavaTimeFormatter.java @@ -22,43 +22,47 @@ */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0-SNAPSHOT") public class JavaTimeFormatter { + private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; - private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; + /** + * Get the date format used to parse/format {@code OffsetDateTime} parameters. + * + * @return DateTimeFormatter + */ + public DateTimeFormatter getOffsetDateTimeFormatter() { + return offsetDateTimeFormatter; + } - /** - * Get the date format used to parse/format {@code OffsetDateTime} parameters. - * @return DateTimeFormatter - */ - public DateTimeFormatter getOffsetDateTimeFormatter() { - return offsetDateTimeFormatter; - } + /** + * Set the date format used to parse/format {@code OffsetDateTime} parameters. + * + * @param offsetDateTimeFormatter {@code DateTimeFormatter} + */ + public void setOffsetDateTimeFormatter(DateTimeFormatter offsetDateTimeFormatter) { + this.offsetDateTimeFormatter = offsetDateTimeFormatter; + } - /** - * Set the date format used to parse/format {@code OffsetDateTime} parameters. - * @param offsetDateTimeFormatter {@code DateTimeFormatter} - */ - public void setOffsetDateTimeFormatter(DateTimeFormatter offsetDateTimeFormatter) { - this.offsetDateTimeFormatter = offsetDateTimeFormatter; + /** + * Parse the given string into {@code OffsetDateTime} object. + * + * @param str String + * @return {@code OffsetDateTime} + */ + public OffsetDateTime parseOffsetDateTime(String str) { + try { + return OffsetDateTime.parse(str, offsetDateTimeFormatter); + } catch (DateTimeParseException e) { + throw new RuntimeException(e); } + } - /** - * Parse the given string into {@code OffsetDateTime} object. - * @param str String - * @return {@code OffsetDateTime} - */ - public OffsetDateTime parseOffsetDateTime(String str) { - try { - return OffsetDateTime.parse(str, offsetDateTimeFormatter); - } catch (DateTimeParseException e) { - throw new RuntimeException(e); - } - } - /** - * Format the given {@code OffsetDateTime} object into string. - * @param offsetDateTime {@code OffsetDateTime} - * @return {@code OffsetDateTime} in string format - */ - public String formatOffsetDateTime(OffsetDateTime offsetDateTime) { - return offsetDateTimeFormatter.format(offsetDateTime); - } -} + /** + * Format the given {@code OffsetDateTime} object into string. + * + * @param offsetDateTime {@code OffsetDateTime} + * @return {@code OffsetDateTime} in string format + */ + public String formatOffsetDateTime(OffsetDateTime offsetDateTime) { + return offsetDateTimeFormatter.format(offsetDateTime); + } +} \ No newline at end of file diff --git a/samples/client/petstore/java/vertx-supportVertxFuture/src/main/java/org/openapitools/client/Pair.java b/samples/client/petstore/java/vertx-supportVertxFuture/src/main/java/org/openapitools/client/Pair.java index 9f059fa1d0e3..462a2d9c73c3 100644 --- a/samples/client/petstore/java/vertx-supportVertxFuture/src/main/java/org/openapitools/client/Pair.java +++ b/samples/client/petstore/java/vertx-supportVertxFuture/src/main/java/org/openapitools/client/Pair.java @@ -15,43 +15,23 @@ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0-SNAPSHOT") public class Pair { - private String name = ""; - private String value = ""; + private final String name; + private final String value; - public Pair (String name, String value) { - setName(name); - setValue(value); - } + public Pair(String name, String value) { + this.name = isValidString(name) ? name : ""; + this.value = isValidString(value) ? value : ""; + } - private void setName(String name) { - if (!isValidString(name)) { - return; - } + public String getName() { + return this.name; + } - this.name = name; - } + public String getValue() { + return this.value; + } - private void setValue(String value) { - if (!isValidString(value)) { - return; - } - - this.value = value; - } - - public String getName() { - return this.name; - } - - public String getValue() { - return this.value; - } - - private boolean isValidString(String arg) { - if (arg == null) { - return false; - } - - return true; - } + private static boolean isValidString(String arg) { + return arg != null; + } }