Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
59c67f2
Merge pull request #4 from OpenAPITools/master
jpfinne May 11, 2026
784da69
Merge branch 'OpenAPITools:master' into master
jpfinne May 12, 2026
9ee6075
Merge branch 'OpenAPITools:master' into master
jpfinne May 14, 2026
91ce7ba
Merge branch 'OpenAPITools:master' into master
jpfinne May 15, 2026
0808d0e
Merge branch 'OpenAPITools:master' into master
jpfinne May 17, 2026
46d9c9c
Merge branch 'OpenAPITools:master' into master
jpfinne May 18, 2026
7b6cf90
Merge branch 'OpenAPITools:master' into master
jpfinne May 30, 2026
b50a337
Merge branch 'OpenAPITools:master' into master
jpfinne Jun 1, 2026
ae1bff7
Merge branch 'OpenAPITools:master' into master
jpfinne Jun 2, 2026
5229d8d
Merge branch 'OpenAPITools:master' into master
jpfinne Jun 3, 2026
cdc74eb
Merge branch 'OpenAPITools:master' into master
jpfinne Jun 13, 2026
9c059d1
Merge remote-tracking branch 'upstream/master'
jpfinne Jun 13, 2026
df30bd2
Merge branch 'OpenAPITools:master' into master
jpfinne Jul 4, 2026
246b21d
Merge branch 'OpenAPITools:master' into master
jpfinne Jul 8, 2026
8e39563
Merge branch 'OpenAPITools:master' into master
jpfinne Aug 1, 2026
deec130
Merge branch 'OpenAPITools:master' into master
jpfinne Aug 4, 2026
da9270c
Merge branch 'OpenAPITools:master' into master
jpfinne Aug 8, 2026
7e4ce22
Merge branch 'OpenAPITools:master' into master
jpfinne Aug 8, 2026
4f55095
Merge branch 'OpenAPITools:master' into master
jpfinne Aug 9, 2026
a614eb2
Merge branch 'OpenAPITools:master' into master
jpfinne Aug 10, 2026
12cb648
Merge remote-tracking branch 'upstream/master'
jpfinne Aug 12, 2026
e8f0a38
Merge branch 'OpenAPITools:master' into master
jpfinne Aug 13, 2026
8199a48
Merge branch 'OpenAPITools:master' into master
jpfinne Aug 18, 2026
4757c1f
Merge branch 'OpenAPITools:master' into master
jpfinne Aug 19, 2026
a410286
Fix spring-http-interface @Nullable if default
jpfinne Aug 19, 2026
16f02cc
Force build
jpfinne Aug 20, 2026
61eb6bf
Force build
jpfinne Aug 20, 2026
455affe
Refactoring of nullableAnnotation -> nullable_apiArgument for api par…
jpfinne Aug 20, 2026
9d1fc7d
Refactoring of nullableAnnotation -> nullable_apiArgument for api par…
jpfinne Aug 20, 2026
5d162d1
fix double @Nullable
jpfinne Aug 20, 2026
fb38a0c
Revert missing test
jpfinne Aug 20, 2026
c2003fa
Better default vs !default
jpfinne Aug 21, 2026
0923570
Fix typo
jpfinne Aug 21, 2026
4e821b1
Force build
jpfinne Aug 21, 2026
3f7b9f4
Merge remote-tracking branch 'refs/remotes/upstream/master'
jpfinne Aug 24, 2026
5d103b7
Merge branch 'master' into bugfix_24737
jpfinne Aug 31, 2026
c62a962
Handling of SPRING_HTTP_INTERFACE query param required=false, nullabl…
jpfinne Sep 1, 2026
6432c0b
Handling of SPRING_HTTP_INTERFACE query param required=false, nullabl…
jpfinne Sep 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{#isBodyParam}}{{>paramDoc}}{{#useBeanValidation}} {{>beanValidationBodyParams}}@Valid{{/useBeanValidation}} @RequestBody{{^required}}(required = false){{/required}} {{^reactive}}{{>nullableAnnotation}}{{>optionalDataType}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}} {{paramName}}{{/isBodyParam}}
{{#isBodyParam}}{{>paramDoc}}{{#useBeanValidation}} {{>beanValidationBodyParams}}@Valid{{/useBeanValidation}} @RequestBody{{^required}}(required = false){{/required}} {{^reactive}}{{>nullableAnnotation_apiArgument}}{{>optionalDataType}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}} {{paramName}}{{/isBodyParam}}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{#isCookieParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{>paramDoc}} @CookieValue(name = "{{baseName}}"{{^required}}, required = false{{/required}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}){{>dateTimeParam}} {{>nullableAnnotation}}{{>optionalDataType}} {{paramName}}{{/isCookieParam}}
{{#isCookieParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{>paramDoc}} @CookieValue(name = "{{baseName}}"{{^required}}, required = false{{/required}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}){{>dateTimeParam}} {{>nullableAnnotation_apiArgument}}{{>optionalDataType}} {{paramName}}{{/isCookieParam}}
Comment thread
jpfinne marked this conversation as resolved.
Resolved
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{#isHeaderParam}}{{#vendorExtensions.x-field-extra-annotation}}{{{.}}} {{/vendorExtensions.x-field-extra-annotation}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{>paramDoc}} @RequestHeader(value = "{{baseName}}", required = {{#required}}true{{/required}}{{^required}}false{{/required}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}){{>dateTimeParam}} {{>nullableAnnotation}}{{>optionalDataType}} {{paramName}}{{/isHeaderParam}}
{{#isHeaderParam}}{{#vendorExtensions.x-field-extra-annotation}}{{{.}}} {{/vendorExtensions.x-field-extra-annotation}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{>paramDoc}} @RequestHeader(value = "{{baseName}}", required = {{#required}}true{{/required}}{{^required}}false{{/required}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}){{>dateTimeParam}} {{>nullableAnnotation_apiArgument}}{{>optionalDataType}} {{paramName}}{{/isHeaderParam}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{#lambda.jSpecifyNullable}}{{#defaultValue}}@Nullable {{/defaultValue}}{{^defaultValue}}{{^required}}{{^useOptional}}@Nullable {{/useOptional}}{{/required}}{{/defaultValue}}{{/lambda.jSpecifyNullable}}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{#paramName}}{{>nullableAnnotation_default}}{{/paramName}}{{^paramName}}{{>nullableAnnotation_jspecify}}{{^useJspecify}}{{!backward compatibility}}{{>nullableAnnotation_default}}{{/useJspecify}}{{/paramName}}
{{#useJspecify}}{{>nullableAnnotation_jspecify}}{{/useJspecify}}{{^useJspecify}}{{!backward compatibility}}{{>nullableAnnotation_default}}{{/useJspecify}}
Comment thread
jpfinne marked this conversation as resolved.
Resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{#lambda.jSpecifyNullable}}{{^required}}{{^defaultValue}}{{^useOptional}}{{#openApiNullable}}{{^isNullable}}@Nullable {{/isNullable}}{{/openApiNullable}}{{^openApiNullable}}@Nullable {{/openApiNullable}}{{/useOptional}}{{/defaultValue}}{{#defaultValue}}{{^openApiNullable}}{{#isNullable}}@Nullable {{/isNullable}}{{/openApiNullable}}{{/defaultValue}}{{/required}}{{/lambda.jSpecifyNullable}}
Comment thread
jpfinne marked this conversation as resolved.
Resolved
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{#useJspecify}}{{#lambda.jSpecifyNullable}}{{#required}}{{#isNullable}}{{^openApiNullable}}@Nullable {{/openApiNullable}}{{/isNullable}}{{/required}}{{^required}}{{^useOptional}}{{#openApiNullable}}{{^isNullable}}@Nullable {{/isNullable}}{{/openApiNullable}}{{^openApiNullable}}@Nullable {{/openApiNullable}}{{/useOptional}}{{/required}}{{/lambda.jSpecifyNullable}}{{/useJspecify}}
{{#lambda.jSpecifyNullable}}{{#required}}{{#isNullable}}{{^openApiNullable}}@Nullable {{/openApiNullable}}{{/isNullable}}{{/required}}{{^required}}{{^useOptional}}{{#openApiNullable}}{{^isNullable}}@Nullable {{/isNullable}}{{/openApiNullable}}{{^openApiNullable}}@Nullable {{/openApiNullable}}{{/useOptional}}{{/required}}{{/lambda.jSpecifyNullable}}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{#isPathParam}}{{#vendorExtensions.x-field-extra-annotation}}{{{.}}} {{/vendorExtensions.x-field-extra-annotation}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}{{>paramDoc}} @PathVariable("{{baseName}}"){{>dateTimeParam}}{{#isDeprecated}} @Deprecated{{/isDeprecated}} {{>nullableAnnotation}}{{>optionalDataType}} {{paramName}}{{/isPathParam}}
{{#isPathParam}}{{#vendorExtensions.x-field-extra-annotation}}{{{.}}} {{/vendorExtensions.x-field-extra-annotation}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}{{>paramDoc}} @PathVariable("{{baseName}}"){{>dateTimeParam}}{{#isDeprecated}} @Deprecated{{/isDeprecated}} {{>nullableAnnotation_apiArgument}}{{>optionalDataType}} {{paramName}}{{/isPathParam}}
Comment thread
jpfinne marked this conversation as resolved.
Resolved
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{#isQueryParam}}{{#vendorExtensions.x-field-extra-annotation}}{{{.}}} {{/vendorExtensions.x-field-extra-annotation}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{>paramDoc}}{{#useBeanValidation}} @Valid{{/useBeanValidation}}{{^isModel}} @RequestParam(value = {{#isMap}}""{{/isMap}}{{^isMap}}"{{baseName}}"{{/isMap}}{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}){{/isModel}}{{>dateTimeParam}}{{#isDeprecated}} @Deprecated{{/isDeprecated}} {{>nullableAnnotation}}{{>optionalDataType}} {{paramName}}{{/isQueryParam}}
{{#isQueryParam}}{{#vendorExtensions.x-field-extra-annotation}}{{{.}}} {{/vendorExtensions.x-field-extra-annotation}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{>paramDoc}}{{#useBeanValidation}} @Valid{{/useBeanValidation}}{{^isModel}} @RequestParam(value = {{#isMap}}""{{/isMap}}{{^isMap}}"{{baseName}}"{{/isMap}}{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}){{/isModel}}{{>dateTimeParam}}{{#isDeprecated}} @Deprecated{{/isDeprecated}} {{>nullableAnnotation_apiArgument}}{{>optionalDataType}} {{paramName}}{{/isQueryParam}}
Original file line number Diff line number Diff line change
Expand Up @@ -7224,14 +7224,29 @@ public void testJspecify(String library, int springBootVersion) throws IOExcepti
"javax.annotation.Nullable",
"jakarta.annotation.Nullable")
.assertMethod("getRequiredDt").assertMethodAnnotations().containsWithName("NotNull").containsWithName("Valid");
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Resolved
JavaFileAssert.assertThat(files.get("FooApi.java"))
JavaFileAssert fooApiAssert = JavaFileAssert.assertThat(files.get("FooApi.java"))
.assertTypeAnnotations().doesImportAnnotation("org.jspecify.annotations.Nullable").toType()
.fileContains(
"java.time.@Nullable Instant dtParam",
"java.time.@Nullable Instant dtQuery",
"java.time.@Nullable Instant dtCookie",
" @RequestParam(value = \"color\", required = false, defaultValue = \"red\") String color"
);
"java.time.@Nullable Instant dtCookie");

JavaFileAssert nbleApi = JavaFileAssert.assertThat(files.get("NbleApi.java"));
// SPRING_HTTP_INTERFACE has other requirements for default in api arguments
if (SPRING_HTTP_INTERFACE.equals(library)) {
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Resolved
nbleApi.fileContains(
") String mandatory",
") @Nullable String optional");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: In testJspecify the nbleApi.fileContains(") String mandatory", ") @nullable String optional") block is now byte-for-byte identical in the SPRING_HTTP_INTERFACE branch and the else branch, so the if/else reads as if it varies the NbleApi assertions when only the fooApiAssert color value differs. Hoist the identical nbleApi assertion above the if/else and keep only the differing color assertion inside each branch.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java, line 7239:

<comment>In testJspecify the nbleApi.fileContains(") String mandatory", ") @Nullable String optional") block is now byte-for-byte identical in the SPRING_HTTP_INTERFACE branch and the else branch, so the if/else reads as if it varies the NbleApi assertions when only the fooApiAssert color value differs. Hoist the identical nbleApi assertion above the if/else and keep only the differing color assertion inside each branch.</comment>

<file context>
@@ -7231,16 +7231,18 @@ public void testJspecify(String library, int springBootVersion) throws IOExcepti
-                    " @Nullable String filter");
+            nbleApi.fileContains(
+                    ") String mandatory",
+                    ") @Nullable String optional");
             fooApiAssert.fileContains(
                         "@RequestParam(value = \"color\", required = false, defaultValue = \"red\") @Nullable String color");
</file context>

fooApiAssert.fileContains(
"@RequestParam(value = \"color\", required = false, defaultValue = \"red\") @Nullable String color");
} else {
nbleApi.fileContains(
") String mandatory",
") @Nullable String optional");
fooApiAssert.fileContains(
"@RequestParam(value = \"color\", required = false, defaultValue = \"red\") String color");
}

JavaFileAssert.assertThat(files.get("RequiredAndNullable.java"))
.fileContains(
"private @Nullable String str = null;",
Expand Down Expand Up @@ -7314,13 +7329,7 @@ public void testJspecify_openapiNullable(String library, int springBootVersion)
"javax.annotation.Nullable",
"jakarta.annotation.Nullable")
.assertMethod("getRequiredDt").assertMethodAnnotations().containsWithName("NotNull").containsWithName("Valid");
JavaFileAssert.assertThat(files.get("FooApi.java"))
.assertTypeAnnotations().doesImportAnnotation("org.jspecify.annotations.Nullable").toType()
.fileContains(
"java.time.@Nullable Instant dtParam",
"java.time.@Nullable Instant dtQuery",
"java.time.@Nullable Instant dtCookie"
);

JavaFileAssert.assertThat(files.get("RequiredAndNullable.java"))
.fileContains(
"private JsonNullable<String> str = JsonNullable.<String>undefined();",
Expand All @@ -7344,6 +7353,23 @@ public void testJspecify_openapiNullable(String library, int springBootVersion)
.doesNotContainWithName("Nullable")
.doesImportAnnotation("org.jspecify.annotations.Nullable");
}
JavaFileAssert.assertThat(files.get("FooApi.java"))
.assertTypeAnnotations().doesImportAnnotation("org.jspecify.annotations.Nullable").toType()
.fileContains(
"java.time.@Nullable Instant dtParam",
"java.time.@Nullable Instant dtQuery",
"java.time.@Nullable Instant dtCookie");
JavaFileAssert nbleApi = JavaFileAssert.assertThat(files.get("NbleApi.java"));
if (SPRING_HTTP_INTERFACE.equals(library)) {
nbleApi .fileContains(
"@RequestParam(value = \"mandatory\", required = true) String mandatory",
"@RequestParam(value = \"optional\", required = false) @Nullable String optional");
} else {
// incorrect generation for required=false, nullable=true?
nbleApi .fileContains(
"@RequestParam(value = \"mandatory\", required = true) String mandatory",
"@RequestParam(value = \"optional\", required = false) String optional");
}
}

@DataProvider(name = "jspecifyLibrariesUseOptional")
Expand Down Expand Up @@ -7439,7 +7465,10 @@ public void testJspecify_useOptional(String library, int springBootVersion, bool
.doesNotContainWithName("Nullable")
.doesImportAnnotation("org.jspecify.annotations.Nullable");
}
}
JavaFileAssert.assertThat(files.get("NbleApi.java")).fileContains(
"@RequestParam(value = \"mandatory\", required = true) String mandatory",
"@RequestParam(value = \"optional\", required = false) Optional<String> optional");
}

// -------------------------------------------------------------------------
// autoXSpringPaginated tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,29 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Foo'
/requiredAndNullable:
/nble:
get:
tags:
- nble

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: Operations are now tagged nble, but the top-level tags: list still declares requiredAndNullable (now unused) and has no nble entry. Update the top-level tag list to match the renamed operations so the fixture does not carry a stale tag declaration.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At modules/openapi-generator/src/test/resources/3_0/java/jspecify.yaml, line 53:

<comment>Operations are now tagged `nble`, but the top-level `tags:` list still declares `requiredAndNullable` (now unused) and has no `nble` entry. Update the top-level tag list to match the renamed operations so the fixture does not carry a stale tag declaration.</comment>

<file context>
@@ -47,23 +47,29 @@ paths:
     get:
       tags:
-        - requiredAndNullable
+        - nble
       parameters:
-        - name: filter
</file context>

parameters:
- name: optional
in: query
required: false
schema:
type: string
nullable: true
- name: mandatory
in: query
required: true
schema:
type: string
nullable: true
responses:
default:
description: OK
post:
tags:
- requiredAndNullable
- nble
requestBody:
required: true
description: bodyWithRequiredAndNullableAttributes
Expand All @@ -65,6 +84,7 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/RequiredAndNullable'

/upload:
post:
tags:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ docs/FileApi.md
docs/FileContent.md
docs/Foo.md
docs/FooApi.md
docs/NbleApi.md
docs/RequiredAndNullable.md
docs/RequiredAndNullableApi.md
docs/UploadApi.md
git_push.sh
gradle.properties
Expand All @@ -34,7 +34,7 @@ src/main/java/org/openapitools/client/ServerConfiguration.java
src/main/java/org/openapitools/client/ServerVariable.java
src/main/java/org/openapitools/client/api/FileApi.java
src/main/java/org/openapitools/client/api/FooApi.java
src/main/java/org/openapitools/client/api/RequiredAndNullableApi.java
src/main/java/org/openapitools/client/api/NbleApi.java
src/main/java/org/openapitools/client/api/UploadApi.java
src/main/java/org/openapitools/client/api/package-info.java
src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,10 @@ Class | Method | HTTP request | Description
*FileApi* | [**fileIdGetWithHttpInfo**](docs/FileApi.md#fileIdGetWithHttpInfo) | **GET** /file/{id} |
*FooApi* | [**fooDtParamGet**](docs/FooApi.md#fooDtParamGet) | **GET** /foo/{dtParam} |
*FooApi* | [**fooDtParamGetWithHttpInfo**](docs/FooApi.md#fooDtParamGetWithHttpInfo) | **GET** /foo/{dtParam} |
*RequiredAndNullableApi* | [**requiredAndNullablePost**](docs/RequiredAndNullableApi.md#requiredAndNullablePost) | **POST** /requiredAndNullable |
*RequiredAndNullableApi* | [**requiredAndNullablePostWithHttpInfo**](docs/RequiredAndNullableApi.md#requiredAndNullablePostWithHttpInfo) | **POST** /requiredAndNullable |
*NbleApi* | [**nbleGet**](docs/NbleApi.md#nbleGet) | **GET** /nble |
*NbleApi* | [**nbleGetWithHttpInfo**](docs/NbleApi.md#nbleGetWithHttpInfo) | **GET** /nble |
*NbleApi* | [**nblePost**](docs/NbleApi.md#nblePost) | **POST** /nble |
*NbleApi* | [**nblePostWithHttpInfo**](docs/NbleApi.md#nblePostWithHttpInfo) | **POST** /nble |
*UploadApi* | [**uploadFilesPost**](docs/UploadApi.md#uploadFilesPost) | **POST** /uploadFiles |
*UploadApi* | [**uploadFilesPostWithHttpInfo**](docs/UploadApi.md#uploadFilesPostWithHttpInfo) | **POST** /uploadFiles |
*UploadApi* | [**uploadPost**](docs/UploadApi.md#uploadPost) | **POST** /upload |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,32 @@ paths:
- foo
x-accepts:
- application/json
/requiredAndNullable:
/nble:
get:
parameters:
- explode: true
in: query
name: optional
required: false
schema:
nullable: true
type: string
style: form
- explode: true
in: query
name: mandatory
required: true
schema:
nullable: true
type: string
style: form
responses:
default:
description: OK
tags:
- nble
x-accepts:
- application/json
post:
requestBody:
content:
Expand All @@ -78,7 +103,7 @@ paths:
$ref: "#/components/schemas/RequiredAndNullable"
description: response
tags:
- requiredAndNullable
- nble
x-content-type: application/json
x-accepts:
- application/json
Expand Down
Loading
Loading