diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/bodyParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/bodyParams.mustache index 26bea8c9b706..fb36a1407072 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/bodyParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/bodyParams.mustache @@ -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}} \ No newline at end of file +{{#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}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/cookieParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/cookieParams.mustache index a255b5c7daf2..32db956c4813 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/cookieParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/cookieParams.mustache @@ -1 +1 @@ -{{#isCookieParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{>paramDoc}} @CookieValue(name = "{{baseName}}"{{^required}}, required = false{{/required}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}){{>dateTimeParam}} {{>nullableAnnotation}}{{>optionalDataType}} {{paramName}}{{/isCookieParam}} \ No newline at end of file +{{#isCookieParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{>paramDoc}} @CookieValue(name = "{{baseName}}"{{^required}}, required = false{{/required}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}){{>dateTimeParam}} {{>nullableAnnotation_apiArgument}}{{>optionalDataType}} {{paramName}}{{/isCookieParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/headerParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/headerParams.mustache index 80b1d0a82341..61c5b3e6257c 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/headerParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/headerParams.mustache @@ -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}} \ No newline at end of file +{{#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}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/nullableAnnotation_apiArgument.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/nullableAnnotation_apiArgument.mustache new file mode 100644 index 000000000000..b533e787a36b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/nullableAnnotation_apiArgument.mustache @@ -0,0 +1 @@ +{{#lambda.jSpecifyNullable}}{{#defaultValue}}@Nullable {{/defaultValue}}{{^defaultValue}}{{^required}}{{^useOptional}}@Nullable {{/useOptional}}{{/required}}{{/defaultValue}}{{/lambda.jSpecifyNullable}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/nullableAnnotation.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/nullableAnnotation.mustache index 65c0e39b2ead..f389ca095c8c 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/nullableAnnotation.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/nullableAnnotation.mustache @@ -1 +1 @@ -{{#paramName}}{{>nullableAnnotation_default}}{{/paramName}}{{^paramName}}{{>nullableAnnotation_jspecify}}{{^useJspecify}}{{!backward compatibility}}{{>nullableAnnotation_default}}{{/useJspecify}}{{/paramName}} \ No newline at end of file +{{#useJspecify}}{{>nullableAnnotation_jspecify}}{{/useJspecify}}{{^useJspecify}}{{!backward compatibility}}{{>nullableAnnotation_default}}{{/useJspecify}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/nullableAnnotation_apiArgument.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/nullableAnnotation_apiArgument.mustache new file mode 100644 index 000000000000..a3ff1bad10e2 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/JavaSpring/nullableAnnotation_apiArgument.mustache @@ -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}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/nullableAnnotation_jspecify.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/nullableAnnotation_jspecify.mustache index c7624e180091..a121f6bc6625 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/nullableAnnotation_jspecify.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/nullableAnnotation_jspecify.mustache @@ -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}} \ No newline at end of file +{{#lambda.jSpecifyNullable}}{{#required}}{{#isNullable}}{{^openApiNullable}}@Nullable {{/openApiNullable}}{{/isNullable}}{{/required}}{{^required}}{{^useOptional}}{{#openApiNullable}}{{^isNullable}}@Nullable {{/isNullable}}{{/openApiNullable}}{{^openApiNullable}}@Nullable {{/openApiNullable}}{{/useOptional}}{{/required}}{{/lambda.jSpecifyNullable}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/pathParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/pathParams.mustache index 5a351829131d..881becf0f0de 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/pathParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/pathParams.mustache @@ -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}} \ No newline at end of file +{{#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}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/queryParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/queryParams.mustache index 56f7527eb92a..786be39bba78 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/queryParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/queryParams.mustache @@ -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}} \ No newline at end of file +{{#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}} \ No newline at end of file diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java index b7184f853396..9530753e256f 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java @@ -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"); - 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)) { + nbleApi.fileContains( + ") String mandatory", + ") @Nullable String optional"); + 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;", @@ -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 str = JsonNullable.undefined();", @@ -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") @@ -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 optional"); + } // ------------------------------------------------------------------------- // autoXSpringPaginated tests diff --git a/modules/openapi-generator/src/test/resources/3_0/java/jspecify.yaml b/modules/openapi-generator/src/test/resources/3_0/java/jspecify.yaml index 4d166384f1ad..9ccca42ec630 100644 --- a/modules/openapi-generator/src/test/resources/3_0/java/jspecify.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/java/jspecify.yaml @@ -47,10 +47,29 @@ paths: application/json: schema: $ref: '#/components/schemas/Foo' - /requiredAndNullable: + /nble: + get: + tags: + - nble + 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 @@ -65,6 +84,7 @@ paths: application/json: schema: $ref: '#/components/schemas/RequiredAndNullable' + /upload: post: tags: diff --git a/samples/client/petstore/java/native-jackson3-jspecify/.openapi-generator/FILES b/samples/client/petstore/java/native-jackson3-jspecify/.openapi-generator/FILES index b169aa1ef064..89d15fb8016f 100644 --- a/samples/client/petstore/java/native-jackson3-jspecify/.openapi-generator/FILES +++ b/samples/client/petstore/java/native-jackson3-jspecify/.openapi-generator/FILES @@ -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 @@ -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 diff --git a/samples/client/petstore/java/native-jackson3-jspecify/README.md b/samples/client/petstore/java/native-jackson3-jspecify/README.md index 7acdf0a9430c..e0425bfbbb0c 100644 --- a/samples/client/petstore/java/native-jackson3-jspecify/README.md +++ b/samples/client/petstore/java/native-jackson3-jspecify/README.md @@ -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 | diff --git a/samples/client/petstore/java/native-jackson3-jspecify/api/openapi.yaml b/samples/client/petstore/java/native-jackson3-jspecify/api/openapi.yaml index 15c1f4176a50..9c5f4e7cdb47 100644 --- a/samples/client/petstore/java/native-jackson3-jspecify/api/openapi.yaml +++ b/samples/client/petstore/java/native-jackson3-jspecify/api/openapi.yaml @@ -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: @@ -78,7 +103,7 @@ paths: $ref: "#/components/schemas/RequiredAndNullable" description: response tags: - - requiredAndNullable + - nble x-content-type: application/json x-accepts: - application/json diff --git a/samples/client/petstore/java/native-jackson3-jspecify/docs/NbleApi.md b/samples/client/petstore/java/native-jackson3-jspecify/docs/NbleApi.md new file mode 100644 index 000000000000..53d0df32ae58 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3-jspecify/docs/NbleApi.md @@ -0,0 +1,274 @@ +# NbleApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**nbleGet**](NbleApi.md#nbleGet) | **GET** /nble | | +| [**nbleGetWithHttpInfo**](NbleApi.md#nbleGetWithHttpInfo) | **GET** /nble | | +| [**nblePost**](NbleApi.md#nblePost) | **POST** /nble | | +| [**nblePostWithHttpInfo**](NbleApi.md#nblePostWithHttpInfo) | **POST** /nble | | + + + +## nbleGet + +> void nbleGet(mandatory, optional) + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.NbleApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + NbleApi apiInstance = new NbleApi(defaultClient); + String mandatory = "mandatory_example"; // String | + String optional = "optional_example"; // String | + try { + apiInstance.nbleGet(mandatory, optional); + } catch (ApiException e) { + System.err.println("Exception when calling NbleApi#nbleGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **mandatory** | **String**| | | +| **optional** | **String**| | [optional] | + +### Return type + + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | OK | - | + +## nbleGetWithHttpInfo + +> ApiResponse nbleGetWithHttpInfo(mandatory, optional) + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.NbleApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + NbleApi apiInstance = new NbleApi(defaultClient); + String mandatory = "mandatory_example"; // String | + String optional = "optional_example"; // String | + try { + ApiResponse response = apiInstance.nbleGetWithHttpInfo(mandatory, optional); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + } catch (ApiException e) { + System.err.println("Exception when calling NbleApi#nbleGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **mandatory** | **String**| | | +| **optional** | **String**| | [optional] | + +### Return type + + +ApiResponse + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | OK | - | + + +## nblePost + +> RequiredAndNullable nblePost(requiredAndNullable) + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.NbleApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + NbleApi apiInstance = new NbleApi(defaultClient); + RequiredAndNullable requiredAndNullable = new RequiredAndNullable(); // RequiredAndNullable | bodyWithRequiredAndNullableAttributes + try { + RequiredAndNullable result = apiInstance.nblePost(requiredAndNullable); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling NbleApi#nblePost"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requiredAndNullable** | [**RequiredAndNullable**](RequiredAndNullable.md)| bodyWithRequiredAndNullableAttributes | | + +### Return type + +[**RequiredAndNullable**](RequiredAndNullable.md) + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | response | - | + +## nblePostWithHttpInfo + +> ApiResponse nblePostWithHttpInfo(requiredAndNullable) + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.NbleApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + NbleApi apiInstance = new NbleApi(defaultClient); + RequiredAndNullable requiredAndNullable = new RequiredAndNullable(); // RequiredAndNullable | bodyWithRequiredAndNullableAttributes + try { + ApiResponse response = apiInstance.nblePostWithHttpInfo(requiredAndNullable); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); + } catch (ApiException e) { + System.err.println("Exception when calling NbleApi#nblePost"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requiredAndNullable** | [**RequiredAndNullable**](RequiredAndNullable.md)| bodyWithRequiredAndNullableAttributes | | + +### Return type + +ApiResponse<[**RequiredAndNullable**](RequiredAndNullable.md)> + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | response | - | + diff --git a/samples/client/petstore/java/native-jackson3-jspecify/src/main/java/org/openapitools/client/api/RequiredAndNullableApi.java b/samples/client/petstore/java/native-jackson3-jspecify/src/main/java/org/openapitools/client/api/NbleApi.java similarity index 62% rename from samples/client/petstore/java/native-jackson3-jspecify/src/main/java/org/openapitools/client/api/RequiredAndNullableApi.java rename to samples/client/petstore/java/native-jackson3-jspecify/src/main/java/org/openapitools/client/api/NbleApi.java index 0209382a5611..c6d9fb056507 100644 --- a/samples/client/petstore/java/native-jackson3-jspecify/src/main/java/org/openapitools/client/api/RequiredAndNullableApi.java +++ b/samples/client/petstore/java/native-jackson3-jspecify/src/main/java/org/openapitools/client/api/NbleApi.java @@ -18,6 +18,7 @@ import org.openapitools.client.Configuration; import org.openapitools.client.Pair; +import org.jspecify.annotations.Nullable; import org.openapitools.client.model.RequiredAndNullable; import tools.jackson.core.JacksonException; @@ -47,7 +48,7 @@ import java.util.function.Consumer; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") -public class RequiredAndNullableApi { +public class NbleApi { /** * Utility class for extending HttpRequest.Builder functionality. */ @@ -76,11 +77,11 @@ static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Ma private final Consumer> memberVarResponseInterceptor; private final Consumer> memberVarAsyncResponseInterceptor; - public RequiredAndNullableApi() { + public NbleApi() { this(Configuration.getDefaultApiClient()); } - public RequiredAndNullableApi(ApiClient apiClient) { + public NbleApi(ApiClient apiClient) { memberVarHttpClient = apiClient.getHttpClient(); memberVarObjectMapper = apiClient.getObjectMapper(); memberVarBaseUri = apiClient.getBaseUri(); @@ -163,6 +164,130 @@ private File prepareDownloadFile(HttpResponse response) throws IOEx return file; } + /** + * + * + * @param mandatory (required) + * @param optional (optional) + * @throws ApiException if fails to make API call + */ + public void nbleGet(@Nullable String mandatory, @Nullable String optional) throws ApiException { + nbleGet(mandatory, optional, null); + } + + /** + * + * + * @param mandatory (required) + * @param optional (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void nbleGet(@Nullable String mandatory, @Nullable String optional, Map headers) throws ApiException { + nbleGetWithHttpInfo(mandatory, optional, headers); + } + + /** + * + * + * @param mandatory (required) + * @param optional (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse nbleGetWithHttpInfo(@Nullable String mandatory, @Nullable String optional) throws ApiException { + return nbleGetWithHttpInfo(mandatory, optional, null); + } + + /** + * + * + * @param mandatory (required) + * @param optional (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse nbleGetWithHttpInfo(@Nullable String mandatory, @Nullable String optional, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = nbleGetRequestBuilder(mandatory, optional, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("nbleGet", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody != null) { + localVarResponseBody.readAllBytes(); + } + return new ApiResponse<>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder nbleGetRequestBuilder(@Nullable String mandatory, @Nullable String optional, Map headers) throws ApiException { + // verify the required parameter 'mandatory' is set + if (mandatory == null) { + throw new ApiException(400, "Missing the required parameter 'mandatory' when calling nbleGet"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/nble"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "optional"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("optional", optional)); + localVarQueryParameterBaseName = "mandatory"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mandatory", mandatory)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** * * @@ -170,8 +295,8 @@ private File prepareDownloadFile(HttpResponse response) throws IOEx * @return RequiredAndNullable * @throws ApiException if fails to make API call */ - public RequiredAndNullable requiredAndNullablePost(RequiredAndNullable requiredAndNullable) throws ApiException { - return requiredAndNullablePost(requiredAndNullable, null); + public RequiredAndNullable nblePost(RequiredAndNullable requiredAndNullable) throws ApiException { + return nblePost(requiredAndNullable, null); } /** @@ -182,8 +307,8 @@ public RequiredAndNullable requiredAndNullablePost(RequiredAndNullable requiredA * @return RequiredAndNullable * @throws ApiException if fails to make API call */ - public RequiredAndNullable requiredAndNullablePost(RequiredAndNullable requiredAndNullable, Map headers) throws ApiException { - ApiResponse localVarResponse = requiredAndNullablePostWithHttpInfo(requiredAndNullable, headers); + public RequiredAndNullable nblePost(RequiredAndNullable requiredAndNullable, Map headers) throws ApiException { + ApiResponse localVarResponse = nblePostWithHttpInfo(requiredAndNullable, headers); return localVarResponse.getData(); } @@ -194,8 +319,8 @@ public RequiredAndNullable requiredAndNullablePost(RequiredAndNullable requiredA * @return ApiResponse<RequiredAndNullable> * @throws ApiException if fails to make API call */ - public ApiResponse requiredAndNullablePostWithHttpInfo(RequiredAndNullable requiredAndNullable) throws ApiException { - return requiredAndNullablePostWithHttpInfo(requiredAndNullable, null); + public ApiResponse nblePostWithHttpInfo(RequiredAndNullable requiredAndNullable) throws ApiException { + return nblePostWithHttpInfo(requiredAndNullable, null); } /** @@ -206,8 +331,8 @@ public ApiResponse requiredAndNullablePostWithHttpInfo(Requ * @return ApiResponse<RequiredAndNullable> * @throws ApiException if fails to make API call */ - public ApiResponse requiredAndNullablePostWithHttpInfo(RequiredAndNullable requiredAndNullable, Map headers) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = requiredAndNullablePostRequestBuilder(requiredAndNullable, headers); + public ApiResponse nblePostWithHttpInfo(RequiredAndNullable requiredAndNullable, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = nblePostRequestBuilder(requiredAndNullable, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( localVarRequestBuilder.build(), @@ -218,7 +343,7 @@ public ApiResponse requiredAndNullablePostWithHttpInfo(Requ InputStream localVarResponseBody = null; try { if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("requiredAndNullablePost", localVarResponse); + throw getApiException("nblePost", localVarResponse); } localVarResponseBody = ApiClient.getResponseBody(localVarResponse); if (localVarResponseBody == null) { @@ -254,15 +379,15 @@ public ApiResponse requiredAndNullablePostWithHttpInfo(Requ } } - private HttpRequest.Builder requiredAndNullablePostRequestBuilder(RequiredAndNullable requiredAndNullable, Map headers) throws ApiException { + private HttpRequest.Builder nblePostRequestBuilder(RequiredAndNullable requiredAndNullable, Map headers) throws ApiException { // verify the required parameter 'requiredAndNullable' is set if (requiredAndNullable == null) { - throw new ApiException(400, "Missing the required parameter 'requiredAndNullable' when calling requiredAndNullablePost"); + throw new ApiException(400, "Missing the required parameter 'requiredAndNullable' when calling nblePost"); } HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - String localVarPath = "/requiredAndNullable"; + String localVarPath = "/nble"; localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); diff --git a/samples/client/petstore/java/native-jackson3-jspecify/src/test/java/org/openapitools/client/api/RequiredAndNullableApiTest.java b/samples/client/petstore/java/native-jackson3-jspecify/src/test/java/org/openapitools/client/api/NbleApiTest.java similarity index 63% rename from samples/client/petstore/java/native-jackson3-jspecify/src/test/java/org/openapitools/client/api/RequiredAndNullableApiTest.java rename to samples/client/petstore/java/native-jackson3-jspecify/src/test/java/org/openapitools/client/api/NbleApiTest.java index e978305a1590..8a9f7cacc7eb 100644 --- a/samples/client/petstore/java/native-jackson3-jspecify/src/test/java/org/openapitools/client/api/RequiredAndNullableApiTest.java +++ b/samples/client/petstore/java/native-jackson3-jspecify/src/test/java/org/openapitools/client/api/NbleApiTest.java @@ -14,6 +14,7 @@ package org.openapitools.client.api; import org.openapitools.client.ApiException; +import org.jspecify.annotations.Nullable; import org.openapitools.client.model.RequiredAndNullable; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -26,12 +27,12 @@ /** - * API tests for RequiredAndNullableApi + * API tests for NbleApi */ @Disabled -public class RequiredAndNullableApiTest { +public class NbleApiTest { - private final RequiredAndNullableApi api = new RequiredAndNullableApi(); + private final NbleApi api = new NbleApi(); /** @@ -43,10 +44,27 @@ public class RequiredAndNullableApiTest { * if the Api call fails */ @Test - public void requiredAndNullablePostTest() throws ApiException { + public void nbleGetTest() throws ApiException { + String filter = null; + + api.nbleGet(filter); + + // TODO: test validations + } + + /** + * + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void nblePostTest() throws ApiException { RequiredAndNullable requiredAndNullable = null; RequiredAndNullable response = - api.requiredAndNullablePost(requiredAndNullable); + api.nblePost(requiredAndNullable); // TODO: test validations } diff --git a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/.openapi-generator/FILES b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/.openapi-generator/FILES index a9762735bc0b..6e335fb89a26 100644 --- a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/.openapi-generator/FILES +++ b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/.openapi-generator/FILES @@ -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 @@ -30,7 +30,7 @@ src/main/java/org/openapitools/client/ServerVariable.java src/main/java/org/openapitools/client/StringUtil.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/auth/ApiKeyAuth.java diff --git a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/README.md b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/README.md index d39d8c8a37a4..4e5ccb264c9b 100644 --- a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/README.md +++ b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/README.md @@ -117,7 +117,8 @@ Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *FileApi* | [**fileIdGet**](docs/FileApi.md#fileIdGet) | **GET** /file/{id} | *FooApi* | [**fooDtParamGet**](docs/FooApi.md#fooDtParamGet) | **GET** /foo/{dtParam} | -*RequiredAndNullableApi* | [**requiredAndNullablePost**](docs/RequiredAndNullableApi.md#requiredAndNullablePost) | **POST** /requiredAndNullable | +*NbleApi* | [**nbleGet**](docs/NbleApi.md#nbleGet) | **GET** /nble | +*NbleApi* | [**nblePost**](docs/NbleApi.md#nblePost) | **POST** /nble | *UploadApi* | [**uploadFilesPost**](docs/UploadApi.md#uploadFilesPost) | **POST** /uploadFiles | *UploadApi* | [**uploadPost**](docs/UploadApi.md#uploadPost) | **POST** /upload | diff --git a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/api/openapi.yaml b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/api/openapi.yaml index 15c1f4176a50..9c5f4e7cdb47 100644 --- a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/api/openapi.yaml +++ b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/api/openapi.yaml @@ -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: @@ -78,7 +103,7 @@ paths: $ref: "#/components/schemas/RequiredAndNullable" description: response tags: - - requiredAndNullable + - nble x-content-type: application/json x-accepts: - application/json diff --git a/samples/client/petstore/java/native-jackson3-jspecify/docs/RequiredAndNullableApi.md b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/docs/NbleApi.md similarity index 58% rename from samples/client/petstore/java/native-jackson3-jspecify/docs/RequiredAndNullableApi.md rename to samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/docs/NbleApi.md index eaad2b9ed25c..0ad469cec5e2 100644 --- a/samples/client/petstore/java/native-jackson3-jspecify/docs/RequiredAndNullableApi.md +++ b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/docs/NbleApi.md @@ -1,17 +1,17 @@ -# RequiredAndNullableApi +# NbleApi All URIs are relative to *http://localhost* | Method | HTTP request | Description | |------------- | ------------- | -------------| -| [**requiredAndNullablePost**](RequiredAndNullableApi.md#requiredAndNullablePost) | **POST** /requiredAndNullable | | -| [**requiredAndNullablePostWithHttpInfo**](RequiredAndNullableApi.md#requiredAndNullablePostWithHttpInfo) | **POST** /requiredAndNullable | | +| [**nbleGet**](NbleApi.md#nbleGet) | **GET** /nble | | +| [**nblePost**](NbleApi.md#nblePost) | **POST** /nble | | -## requiredAndNullablePost +## nbleGet -> RequiredAndNullable requiredAndNullablePost(requiredAndNullable) +> nbleGet(mandatory, optional) @@ -23,20 +23,20 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; import org.openapitools.client.models.*; -import org.openapitools.client.api.RequiredAndNullableApi; +import org.openapitools.client.api.NbleApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("http://localhost"); - RequiredAndNullableApi apiInstance = new RequiredAndNullableApi(defaultClient); - RequiredAndNullable requiredAndNullable = new RequiredAndNullable(); // RequiredAndNullable | bodyWithRequiredAndNullableAttributes + NbleApi apiInstance = new NbleApi(defaultClient); + String mandatory = "mandatory_example"; // String | + String optional = "optional_example"; // String | try { - RequiredAndNullable result = apiInstance.requiredAndNullablePost(requiredAndNullable); - System.out.println(result); + apiInstance.nbleGet(mandatory, optional); } catch (ApiException e) { - System.err.println("Exception when calling RequiredAndNullableApi#requiredAndNullablePost"); + System.err.println("Exception when calling NbleApi#nbleGet"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -51,12 +51,12 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **requiredAndNullable** | [**RequiredAndNullable**](RequiredAndNullable.md)| bodyWithRequiredAndNullableAttributes | | +| **mandatory** | **String**| | | +| **optional** | **String**| | [optional] | ### Return type -[**RequiredAndNullable**](RequiredAndNullable.md) - +null (empty response body) ### Authorization @@ -64,17 +64,19 @@ No authorization required ### HTTP request headers -- **Content-Type**: application/json -- **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: Not defined + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **0** | response | - | +| **0** | OK | - | + -## requiredAndNullablePostWithHttpInfo +## nblePost -> ApiResponse requiredAndNullablePostWithHttpInfo(requiredAndNullable) +> RequiredAndNullable nblePost(requiredAndNullable) @@ -84,28 +86,25 @@ No authorization required // Import classes: import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; -import org.openapitools.client.ApiResponse; import org.openapitools.client.Configuration; import org.openapitools.client.models.*; -import org.openapitools.client.api.RequiredAndNullableApi; +import org.openapitools.client.api.NbleApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("http://localhost"); - RequiredAndNullableApi apiInstance = new RequiredAndNullableApi(defaultClient); + NbleApi apiInstance = new NbleApi(defaultClient); RequiredAndNullable requiredAndNullable = new RequiredAndNullable(); // RequiredAndNullable | bodyWithRequiredAndNullableAttributes try { - ApiResponse response = apiInstance.requiredAndNullablePostWithHttpInfo(requiredAndNullable); - System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders()); - System.out.println("Response body: " + response.getData()); + RequiredAndNullable result = apiInstance.nblePost(requiredAndNullable); + System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling RequiredAndNullableApi#requiredAndNullablePost"); + System.err.println("Exception when calling NbleApi#nblePost"); System.err.println("Status code: " + e.getCode()); - System.err.println("Response headers: " + e.getResponseHeaders()); System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); } } @@ -121,8 +120,7 @@ public class Example { ### Return type -ApiResponse<[**RequiredAndNullable**](RequiredAndNullable.md)> - +[**RequiredAndNullable**](RequiredAndNullable.md) ### Authorization @@ -133,6 +131,7 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| diff --git a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/docs/RequiredAndNullableApi.md b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/docs/RequiredAndNullableApi.md deleted file mode 100644 index ada434bf0b9e..000000000000 --- a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/docs/RequiredAndNullableApi.md +++ /dev/null @@ -1,73 +0,0 @@ -# RequiredAndNullableApi - -All URIs are relative to *http://localhost* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**requiredAndNullablePost**](RequiredAndNullableApi.md#requiredAndNullablePost) | **POST** /requiredAndNullable | | - - - -## requiredAndNullablePost - -> RequiredAndNullable requiredAndNullablePost(requiredAndNullable) - - - -### Example - -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; -import org.openapitools.client.api.RequiredAndNullableApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - RequiredAndNullableApi apiInstance = new RequiredAndNullableApi(defaultClient); - RequiredAndNullable requiredAndNullable = new RequiredAndNullable(); // RequiredAndNullable | bodyWithRequiredAndNullableAttributes - try { - RequiredAndNullable result = apiInstance.requiredAndNullablePost(requiredAndNullable); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling RequiredAndNullableApi#requiredAndNullablePost"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **requiredAndNullable** | [**RequiredAndNullable**](RequiredAndNullable.md)| bodyWithRequiredAndNullableAttributes | | - -### Return type - -[**RequiredAndNullable**](RequiredAndNullable.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **0** | response | - | - diff --git a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/src/main/java/org/openapitools/client/api/NbleApi.java b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/src/main/java/org/openapitools/client/api/NbleApi.java new file mode 100644 index 000000000000..09a811a25c70 --- /dev/null +++ b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/src/main/java/org/openapitools/client/api/NbleApi.java @@ -0,0 +1,233 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiClient; + +import org.jspecify.annotations.Nullable; +import org.openapitools.client.model.RequiredAndNullable; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Objects; +import java.util.Arrays; +import java.util.stream.Collectors; + +import org.springframework.core.io.FileSystemResource; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.web.client.RestClient.ResponseSpec; +import org.springframework.web.client.RestClientResponseException; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") +public class NbleApi { + private ApiClient apiClient; + + public NbleApi() { + this(new ApiClient()); + } + + public NbleApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public record NbleGetRequest(@Nullable String mandatory, @Nullable String optional){} + + /** + * + * + *

0 - OK + * @param requestParameters The nbleGet request parameters as object + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void nbleGet(NbleGetRequest requestParameters) throws RestClientResponseException { + this.nbleGet(requestParameters.mandatory(), requestParameters.optional()); + } + + /** + * + * + *

0 - OK + * @param requestParameters The nbleGet request parameters as object + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity nbleGetWithHttpInfo(NbleGetRequest requestParameters) throws RestClientResponseException { + return this.nbleGetWithHttpInfo(requestParameters.mandatory(), requestParameters.optional()); + } + + /** + * + * + *

0 - OK + * @param requestParameters The nbleGet request parameters as object + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec nbleGetWithResponseSpec(NbleGetRequest requestParameters) throws RestClientResponseException { + return this.nbleGetWithResponseSpec(requestParameters.mandatory(), requestParameters.optional()); + } + + /** + * + * + *

0 - OK + * @param mandatory The mandatory parameter + * @param optional The optional parameter + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec nbleGetRequestCreation(@Nullable String mandatory, @Nullable String optional) throws RestClientResponseException { + Object postBody = null; + // verify the required parameter 'mandatory' is set + if (mandatory == null) { + throw new RestClientResponseException("Missing the required parameter 'mandatory' when calling nbleGet", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "optional", optional)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "mandatory", mandatory)); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/nble", HttpMethod.GET, pathParams, localVarQueryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * + * + *

0 - OK + * @param mandatory The mandatory parameter + * @param optional The optional parameter + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void nbleGet(@Nullable String mandatory, @Nullable String optional) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + nbleGetRequestCreation(mandatory, optional).body(localVarReturnType); + } + + /** + * + * + *

0 - OK + * @param mandatory The mandatory parameter + * @param optional The optional parameter + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity nbleGetWithHttpInfo(@Nullable String mandatory, @Nullable String optional) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return nbleGetRequestCreation(mandatory, optional).toEntity(localVarReturnType); + } + + /** + * + * + *

0 - OK + * @param mandatory The mandatory parameter + * @param optional The optional parameter + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec nbleGetWithResponseSpec(@Nullable String mandatory, @Nullable String optional) throws RestClientResponseException { + return nbleGetRequestCreation(mandatory, optional); + } + + /** + * + * + *

0 - response + * @param requiredAndNullable bodyWithRequiredAndNullableAttributes + * @return RequiredAndNullable + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec nblePostRequestCreation(RequiredAndNullable requiredAndNullable) throws RestClientResponseException { + Object postBody = requiredAndNullable; + // verify the required parameter 'requiredAndNullable' is set + if (requiredAndNullable == null) { + throw new RestClientResponseException("Missing the required parameter 'requiredAndNullable' when calling nblePost", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/nble", HttpMethod.POST, pathParams, localVarQueryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * + * + *

0 - response + * @param requiredAndNullable bodyWithRequiredAndNullableAttributes + * @return RequiredAndNullable + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public RequiredAndNullable nblePost(RequiredAndNullable requiredAndNullable) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return nblePostRequestCreation(requiredAndNullable).body(localVarReturnType); + } + + /** + * + * + *

0 - response + * @param requiredAndNullable bodyWithRequiredAndNullableAttributes + * @return ResponseEntity<RequiredAndNullable> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity nblePostWithHttpInfo(RequiredAndNullable requiredAndNullable) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return nblePostRequestCreation(requiredAndNullable).toEntity(localVarReturnType); + } + + /** + * + * + *

0 - response + * @param requiredAndNullable bodyWithRequiredAndNullableAttributes + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec nblePostWithResponseSpec(RequiredAndNullable requiredAndNullable) throws RestClientResponseException { + return nblePostRequestCreation(requiredAndNullable); + } +} diff --git a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/src/main/java/org/openapitools/client/api/RequiredAndNullableApi.java b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/src/main/java/org/openapitools/client/api/RequiredAndNullableApi.java deleted file mode 100644 index fb14eed980f0..000000000000 --- a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/src/main/java/org/openapitools/client/api/RequiredAndNullableApi.java +++ /dev/null @@ -1,121 +0,0 @@ -package org.openapitools.client.api; - -import org.openapitools.client.ApiClient; - -import org.openapitools.client.model.RequiredAndNullable; - -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Objects; -import java.util.Arrays; -import java.util.stream.Collectors; - -import org.springframework.core.io.FileSystemResource; -import org.springframework.core.ParameterizedTypeReference; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpMethod; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.util.LinkedMultiValueMap; -import org.springframework.util.MultiValueMap; -import org.springframework.web.client.RestClient.ResponseSpec; -import org.springframework.web.client.RestClientResponseException; - -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") -public class RequiredAndNullableApi { - private ApiClient apiClient; - - public RequiredAndNullableApi() { - this(new ApiClient()); - } - - public RequiredAndNullableApi(ApiClient apiClient) { - this.apiClient = apiClient; - } - - public ApiClient getApiClient() { - return apiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * - * - *

0 - response - * @param requiredAndNullable bodyWithRequiredAndNullableAttributes - * @return RequiredAndNullable - * @throws RestClientResponseException if an error occurs while attempting to invoke the API - */ - private ResponseSpec requiredAndNullablePostRequestCreation(RequiredAndNullable requiredAndNullable) throws RestClientResponseException { - Object postBody = requiredAndNullable; - // verify the required parameter 'requiredAndNullable' is set - if (requiredAndNullable == null) { - throw new RestClientResponseException("Missing the required parameter 'requiredAndNullable' when calling requiredAndNullablePost", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); - } - // create path and map variables - final Map pathParams = new HashMap<>(); - - final MultiValueMap localVarQueryParams = new LinkedMultiValueMap<>(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); - final MultiValueMap formParams = new LinkedMultiValueMap<>(); - - final String[] localVarAccepts = { - "application/json" - }; - final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - "application/json" - }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; - return apiClient.invokeAPI("/requiredAndNullable", HttpMethod.POST, pathParams, localVarQueryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } - - /** - * - * - *

0 - response - * @param requiredAndNullable bodyWithRequiredAndNullableAttributes - * @return RequiredAndNullable - * @throws RestClientResponseException if an error occurs while attempting to invoke the API - */ - public RequiredAndNullable requiredAndNullablePost(RequiredAndNullable requiredAndNullable) throws RestClientResponseException { - ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; - return requiredAndNullablePostRequestCreation(requiredAndNullable).body(localVarReturnType); - } - - /** - * - * - *

0 - response - * @param requiredAndNullable bodyWithRequiredAndNullableAttributes - * @return ResponseEntity<RequiredAndNullable> - * @throws RestClientResponseException if an error occurs while attempting to invoke the API - */ - public ResponseEntity requiredAndNullablePostWithHttpInfo(RequiredAndNullable requiredAndNullable) throws RestClientResponseException { - ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; - return requiredAndNullablePostRequestCreation(requiredAndNullable).toEntity(localVarReturnType); - } - - /** - * - * - *

0 - response - * @param requiredAndNullable bodyWithRequiredAndNullableAttributes - * @return ResponseSpec - * @throws RestClientResponseException if an error occurs while attempting to invoke the API - */ - public ResponseSpec requiredAndNullablePostWithResponseSpec(RequiredAndNullable requiredAndNullable) throws RestClientResponseException { - return requiredAndNullablePostRequestCreation(requiredAndNullable); - } -} diff --git a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/src/test/java/org/openapitools/client/api/RequiredAndNullableApiTest.java b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/src/test/java/org/openapitools/client/api/NbleApiTest.java similarity index 63% rename from samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/src/test/java/org/openapitools/client/api/RequiredAndNullableApiTest.java rename to samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/src/test/java/org/openapitools/client/api/NbleApiTest.java index 41e971ae1aa5..3aa85c44cec3 100644 --- a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/src/test/java/org/openapitools/client/api/RequiredAndNullableApiTest.java +++ b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/src/test/java/org/openapitools/client/api/NbleApiTest.java @@ -13,6 +13,7 @@ package org.openapitools.client.api; +import org.jspecify.annotations.Nullable; import org.openapitools.client.model.RequiredAndNullable; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -24,12 +25,12 @@ import java.util.stream.Collectors; /** - * API tests for RequiredAndNullableApi + * API tests for NbleApi */ @Disabled -public class RequiredAndNullableApiTest { +public class NbleApiTest { - private final RequiredAndNullableApi api = new RequiredAndNullableApi(); + private final NbleApi api = new NbleApi(); /** @@ -38,9 +39,22 @@ public class RequiredAndNullableApiTest { * */ @Test - public void requiredAndNullablePostTest() { + public void nbleGetTest() { + String filter = null; + api.nbleGet(filter); + + // TODO: test validations + } + + /** + * + * + * + */ + @Test + public void nblePostTest() { RequiredAndNullable requiredAndNullable = null; - RequiredAndNullable response = api.requiredAndNullablePost(requiredAndNullable); + RequiredAndNullable response = api.nblePost(requiredAndNullable); // TODO: test validations } diff --git a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/.openapi-generator/FILES b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/.openapi-generator/FILES index a9762735bc0b..6e335fb89a26 100644 --- a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/.openapi-generator/FILES +++ b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/.openapi-generator/FILES @@ -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 @@ -30,7 +30,7 @@ src/main/java/org/openapitools/client/ServerVariable.java src/main/java/org/openapitools/client/StringUtil.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/auth/ApiKeyAuth.java diff --git a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/README.md b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/README.md index d39d8c8a37a4..4e5ccb264c9b 100644 --- a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/README.md +++ b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/README.md @@ -117,7 +117,8 @@ Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *FileApi* | [**fileIdGet**](docs/FileApi.md#fileIdGet) | **GET** /file/{id} | *FooApi* | [**fooDtParamGet**](docs/FooApi.md#fooDtParamGet) | **GET** /foo/{dtParam} | -*RequiredAndNullableApi* | [**requiredAndNullablePost**](docs/RequiredAndNullableApi.md#requiredAndNullablePost) | **POST** /requiredAndNullable | +*NbleApi* | [**nbleGet**](docs/NbleApi.md#nbleGet) | **GET** /nble | +*NbleApi* | [**nblePost**](docs/NbleApi.md#nblePost) | **POST** /nble | *UploadApi* | [**uploadFilesPost**](docs/UploadApi.md#uploadFilesPost) | **POST** /uploadFiles | *UploadApi* | [**uploadPost**](docs/UploadApi.md#uploadPost) | **POST** /upload | diff --git a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/api/openapi.yaml b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/api/openapi.yaml index 15c1f4176a50..9c5f4e7cdb47 100644 --- a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/api/openapi.yaml +++ b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/api/openapi.yaml @@ -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: @@ -78,7 +103,7 @@ paths: $ref: "#/components/schemas/RequiredAndNullable" description: response tags: - - requiredAndNullable + - nble x-content-type: application/json x-accepts: - application/json diff --git a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/docs/NbleApi.md b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/docs/NbleApi.md new file mode 100644 index 000000000000..0ad469cec5e2 --- /dev/null +++ b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/docs/NbleApi.md @@ -0,0 +1,139 @@ +# NbleApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**nbleGet**](NbleApi.md#nbleGet) | **GET** /nble | | +| [**nblePost**](NbleApi.md#nblePost) | **POST** /nble | | + + + +## nbleGet + +> nbleGet(mandatory, optional) + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.NbleApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + NbleApi apiInstance = new NbleApi(defaultClient); + String mandatory = "mandatory_example"; // String | + String optional = "optional_example"; // String | + try { + apiInstance.nbleGet(mandatory, optional); + } catch (ApiException e) { + System.err.println("Exception when calling NbleApi#nbleGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **mandatory** | **String**| | | +| **optional** | **String**| | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | OK | - | + + +## nblePost + +> RequiredAndNullable nblePost(requiredAndNullable) + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.NbleApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + NbleApi apiInstance = new NbleApi(defaultClient); + RequiredAndNullable requiredAndNullable = new RequiredAndNullable(); // RequiredAndNullable | bodyWithRequiredAndNullableAttributes + try { + RequiredAndNullable result = apiInstance.nblePost(requiredAndNullable); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling NbleApi#nblePost"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requiredAndNullable** | [**RequiredAndNullable**](RequiredAndNullable.md)| bodyWithRequiredAndNullableAttributes | | + +### Return type + +[**RequiredAndNullable**](RequiredAndNullable.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | response | - | + diff --git a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/docs/RequiredAndNullableApi.md b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/docs/RequiredAndNullableApi.md deleted file mode 100644 index ada434bf0b9e..000000000000 --- a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/docs/RequiredAndNullableApi.md +++ /dev/null @@ -1,73 +0,0 @@ -# RequiredAndNullableApi - -All URIs are relative to *http://localhost* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**requiredAndNullablePost**](RequiredAndNullableApi.md#requiredAndNullablePost) | **POST** /requiredAndNullable | | - - - -## requiredAndNullablePost - -> RequiredAndNullable requiredAndNullablePost(requiredAndNullable) - - - -### Example - -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; -import org.openapitools.client.api.RequiredAndNullableApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - RequiredAndNullableApi apiInstance = new RequiredAndNullableApi(defaultClient); - RequiredAndNullable requiredAndNullable = new RequiredAndNullable(); // RequiredAndNullable | bodyWithRequiredAndNullableAttributes - try { - RequiredAndNullable result = apiInstance.requiredAndNullablePost(requiredAndNullable); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling RequiredAndNullableApi#requiredAndNullablePost"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **requiredAndNullable** | [**RequiredAndNullable**](RequiredAndNullable.md)| bodyWithRequiredAndNullableAttributes | | - -### Return type - -[**RequiredAndNullable**](RequiredAndNullable.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **0** | response | - | - diff --git a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/api/NbleApi.java b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/api/NbleApi.java new file mode 100644 index 000000000000..09a811a25c70 --- /dev/null +++ b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/api/NbleApi.java @@ -0,0 +1,233 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiClient; + +import org.jspecify.annotations.Nullable; +import org.openapitools.client.model.RequiredAndNullable; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Objects; +import java.util.Arrays; +import java.util.stream.Collectors; + +import org.springframework.core.io.FileSystemResource; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.web.client.RestClient.ResponseSpec; +import org.springframework.web.client.RestClientResponseException; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") +public class NbleApi { + private ApiClient apiClient; + + public NbleApi() { + this(new ApiClient()); + } + + public NbleApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public record NbleGetRequest(@Nullable String mandatory, @Nullable String optional){} + + /** + * + * + *

0 - OK + * @param requestParameters The nbleGet request parameters as object + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void nbleGet(NbleGetRequest requestParameters) throws RestClientResponseException { + this.nbleGet(requestParameters.mandatory(), requestParameters.optional()); + } + + /** + * + * + *

0 - OK + * @param requestParameters The nbleGet request parameters as object + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity nbleGetWithHttpInfo(NbleGetRequest requestParameters) throws RestClientResponseException { + return this.nbleGetWithHttpInfo(requestParameters.mandatory(), requestParameters.optional()); + } + + /** + * + * + *

0 - OK + * @param requestParameters The nbleGet request parameters as object + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec nbleGetWithResponseSpec(NbleGetRequest requestParameters) throws RestClientResponseException { + return this.nbleGetWithResponseSpec(requestParameters.mandatory(), requestParameters.optional()); + } + + /** + * + * + *

0 - OK + * @param mandatory The mandatory parameter + * @param optional The optional parameter + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec nbleGetRequestCreation(@Nullable String mandatory, @Nullable String optional) throws RestClientResponseException { + Object postBody = null; + // verify the required parameter 'mandatory' is set + if (mandatory == null) { + throw new RestClientResponseException("Missing the required parameter 'mandatory' when calling nbleGet", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "optional", optional)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "mandatory", mandatory)); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/nble", HttpMethod.GET, pathParams, localVarQueryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * + * + *

0 - OK + * @param mandatory The mandatory parameter + * @param optional The optional parameter + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void nbleGet(@Nullable String mandatory, @Nullable String optional) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + nbleGetRequestCreation(mandatory, optional).body(localVarReturnType); + } + + /** + * + * + *

0 - OK + * @param mandatory The mandatory parameter + * @param optional The optional parameter + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity nbleGetWithHttpInfo(@Nullable String mandatory, @Nullable String optional) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return nbleGetRequestCreation(mandatory, optional).toEntity(localVarReturnType); + } + + /** + * + * + *

0 - OK + * @param mandatory The mandatory parameter + * @param optional The optional parameter + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec nbleGetWithResponseSpec(@Nullable String mandatory, @Nullable String optional) throws RestClientResponseException { + return nbleGetRequestCreation(mandatory, optional); + } + + /** + * + * + *

0 - response + * @param requiredAndNullable bodyWithRequiredAndNullableAttributes + * @return RequiredAndNullable + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec nblePostRequestCreation(RequiredAndNullable requiredAndNullable) throws RestClientResponseException { + Object postBody = requiredAndNullable; + // verify the required parameter 'requiredAndNullable' is set + if (requiredAndNullable == null) { + throw new RestClientResponseException("Missing the required parameter 'requiredAndNullable' when calling nblePost", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/nble", HttpMethod.POST, pathParams, localVarQueryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * + * + *

0 - response + * @param requiredAndNullable bodyWithRequiredAndNullableAttributes + * @return RequiredAndNullable + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public RequiredAndNullable nblePost(RequiredAndNullable requiredAndNullable) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return nblePostRequestCreation(requiredAndNullable).body(localVarReturnType); + } + + /** + * + * + *

0 - response + * @param requiredAndNullable bodyWithRequiredAndNullableAttributes + * @return ResponseEntity<RequiredAndNullable> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity nblePostWithHttpInfo(RequiredAndNullable requiredAndNullable) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return nblePostRequestCreation(requiredAndNullable).toEntity(localVarReturnType); + } + + /** + * + * + *

0 - response + * @param requiredAndNullable bodyWithRequiredAndNullableAttributes + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec nblePostWithResponseSpec(RequiredAndNullable requiredAndNullable) throws RestClientResponseException { + return nblePostRequestCreation(requiredAndNullable); + } +} diff --git a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/api/RequiredAndNullableApi.java b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/api/RequiredAndNullableApi.java deleted file mode 100644 index fb14eed980f0..000000000000 --- a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/api/RequiredAndNullableApi.java +++ /dev/null @@ -1,121 +0,0 @@ -package org.openapitools.client.api; - -import org.openapitools.client.ApiClient; - -import org.openapitools.client.model.RequiredAndNullable; - -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Objects; -import java.util.Arrays; -import java.util.stream.Collectors; - -import org.springframework.core.io.FileSystemResource; -import org.springframework.core.ParameterizedTypeReference; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpMethod; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.util.LinkedMultiValueMap; -import org.springframework.util.MultiValueMap; -import org.springframework.web.client.RestClient.ResponseSpec; -import org.springframework.web.client.RestClientResponseException; - -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") -public class RequiredAndNullableApi { - private ApiClient apiClient; - - public RequiredAndNullableApi() { - this(new ApiClient()); - } - - public RequiredAndNullableApi(ApiClient apiClient) { - this.apiClient = apiClient; - } - - public ApiClient getApiClient() { - return apiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * - * - *

0 - response - * @param requiredAndNullable bodyWithRequiredAndNullableAttributes - * @return RequiredAndNullable - * @throws RestClientResponseException if an error occurs while attempting to invoke the API - */ - private ResponseSpec requiredAndNullablePostRequestCreation(RequiredAndNullable requiredAndNullable) throws RestClientResponseException { - Object postBody = requiredAndNullable; - // verify the required parameter 'requiredAndNullable' is set - if (requiredAndNullable == null) { - throw new RestClientResponseException("Missing the required parameter 'requiredAndNullable' when calling requiredAndNullablePost", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); - } - // create path and map variables - final Map pathParams = new HashMap<>(); - - final MultiValueMap localVarQueryParams = new LinkedMultiValueMap<>(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); - final MultiValueMap formParams = new LinkedMultiValueMap<>(); - - final String[] localVarAccepts = { - "application/json" - }; - final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - "application/json" - }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; - return apiClient.invokeAPI("/requiredAndNullable", HttpMethod.POST, pathParams, localVarQueryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } - - /** - * - * - *

0 - response - * @param requiredAndNullable bodyWithRequiredAndNullableAttributes - * @return RequiredAndNullable - * @throws RestClientResponseException if an error occurs while attempting to invoke the API - */ - public RequiredAndNullable requiredAndNullablePost(RequiredAndNullable requiredAndNullable) throws RestClientResponseException { - ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; - return requiredAndNullablePostRequestCreation(requiredAndNullable).body(localVarReturnType); - } - - /** - * - * - *

0 - response - * @param requiredAndNullable bodyWithRequiredAndNullableAttributes - * @return ResponseEntity<RequiredAndNullable> - * @throws RestClientResponseException if an error occurs while attempting to invoke the API - */ - public ResponseEntity requiredAndNullablePostWithHttpInfo(RequiredAndNullable requiredAndNullable) throws RestClientResponseException { - ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; - return requiredAndNullablePostRequestCreation(requiredAndNullable).toEntity(localVarReturnType); - } - - /** - * - * - *

0 - response - * @param requiredAndNullable bodyWithRequiredAndNullableAttributes - * @return ResponseSpec - * @throws RestClientResponseException if an error occurs while attempting to invoke the API - */ - public ResponseSpec requiredAndNullablePostWithResponseSpec(RequiredAndNullable requiredAndNullable) throws RestClientResponseException { - return requiredAndNullablePostRequestCreation(requiredAndNullable); - } -} diff --git a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/api/RequiredAndNullableApiTest.java b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/api/NbleApiTest.java similarity index 63% rename from samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/api/RequiredAndNullableApiTest.java rename to samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/api/NbleApiTest.java index 41e971ae1aa5..3aa85c44cec3 100644 --- a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/api/RequiredAndNullableApiTest.java +++ b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/api/NbleApiTest.java @@ -13,6 +13,7 @@ package org.openapitools.client.api; +import org.jspecify.annotations.Nullable; import org.openapitools.client.model.RequiredAndNullable; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -24,12 +25,12 @@ import java.util.stream.Collectors; /** - * API tests for RequiredAndNullableApi + * API tests for NbleApi */ @Disabled -public class RequiredAndNullableApiTest { +public class NbleApiTest { - private final RequiredAndNullableApi api = new RequiredAndNullableApi(); + private final NbleApi api = new NbleApi(); /** @@ -38,9 +39,22 @@ public class RequiredAndNullableApiTest { * */ @Test - public void requiredAndNullablePostTest() { + public void nbleGetTest() { + String filter = null; + api.nbleGet(filter); + + // TODO: test validations + } + + /** + * + * + * + */ + @Test + public void nblePostTest() { RequiredAndNullable requiredAndNullable = null; - RequiredAndNullable response = api.requiredAndNullablePost(requiredAndNullable); + RequiredAndNullable response = api.nblePost(requiredAndNullable); // TODO: test validations } diff --git a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/.openapi-generator/FILES b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/.openapi-generator/FILES index 61311fa8a555..55c8459480ef 100644 --- a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/.openapi-generator/FILES +++ b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/.openapi-generator/FILES @@ -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 @@ -31,7 +31,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/auth/ApiKeyAuth.java diff --git a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/README.md b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/README.md index 9c14e0b7fca2..89826fad3979 100644 --- a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/README.md +++ b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/README.md @@ -117,7 +117,8 @@ Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *FileApi* | [**fileIdGet**](docs/FileApi.md#fileIdGet) | **GET** /file/{id} | *FooApi* | [**fooDtParamGet**](docs/FooApi.md#fooDtParamGet) | **GET** /foo/{dtParam} | -*RequiredAndNullableApi* | [**requiredAndNullablePost**](docs/RequiredAndNullableApi.md#requiredAndNullablePost) | **POST** /requiredAndNullable | +*NbleApi* | [**nbleGet**](docs/NbleApi.md#nbleGet) | **GET** /nble | +*NbleApi* | [**nblePost**](docs/NbleApi.md#nblePost) | **POST** /nble | *UploadApi* | [**uploadFilesPost**](docs/UploadApi.md#uploadFilesPost) | **POST** /uploadFiles | *UploadApi* | [**uploadPost**](docs/UploadApi.md#uploadPost) | **POST** /upload | diff --git a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/api/openapi.yaml b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/api/openapi.yaml index 15c1f4176a50..9c5f4e7cdb47 100644 --- a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/api/openapi.yaml +++ b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/api/openapi.yaml @@ -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: @@ -78,7 +103,7 @@ paths: $ref: "#/components/schemas/RequiredAndNullable" description: response tags: - - requiredAndNullable + - nble x-content-type: application/json x-accepts: - application/json diff --git a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/docs/NbleApi.md b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/docs/NbleApi.md new file mode 100644 index 000000000000..0ad469cec5e2 --- /dev/null +++ b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/docs/NbleApi.md @@ -0,0 +1,139 @@ +# NbleApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**nbleGet**](NbleApi.md#nbleGet) | **GET** /nble | | +| [**nblePost**](NbleApi.md#nblePost) | **POST** /nble | | + + + +## nbleGet + +> nbleGet(mandatory, optional) + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.NbleApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + NbleApi apiInstance = new NbleApi(defaultClient); + String mandatory = "mandatory_example"; // String | + String optional = "optional_example"; // String | + try { + apiInstance.nbleGet(mandatory, optional); + } catch (ApiException e) { + System.err.println("Exception when calling NbleApi#nbleGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **mandatory** | **String**| | | +| **optional** | **String**| | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | OK | - | + + +## nblePost + +> RequiredAndNullable nblePost(requiredAndNullable) + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.NbleApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + NbleApi apiInstance = new NbleApi(defaultClient); + RequiredAndNullable requiredAndNullable = new RequiredAndNullable(); // RequiredAndNullable | bodyWithRequiredAndNullableAttributes + try { + RequiredAndNullable result = apiInstance.nblePost(requiredAndNullable); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling NbleApi#nblePost"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requiredAndNullable** | [**RequiredAndNullable**](RequiredAndNullable.md)| bodyWithRequiredAndNullableAttributes | | + +### Return type + +[**RequiredAndNullable**](RequiredAndNullable.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | response | - | + diff --git a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/docs/RequiredAndNullableApi.md b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/docs/RequiredAndNullableApi.md deleted file mode 100644 index ada434bf0b9e..000000000000 --- a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/docs/RequiredAndNullableApi.md +++ /dev/null @@ -1,73 +0,0 @@ -# RequiredAndNullableApi - -All URIs are relative to *http://localhost* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**requiredAndNullablePost**](RequiredAndNullableApi.md#requiredAndNullablePost) | **POST** /requiredAndNullable | | - - - -## requiredAndNullablePost - -> RequiredAndNullable requiredAndNullablePost(requiredAndNullable) - - - -### Example - -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; -import org.openapitools.client.api.RequiredAndNullableApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - RequiredAndNullableApi apiInstance = new RequiredAndNullableApi(defaultClient); - RequiredAndNullable requiredAndNullable = new RequiredAndNullable(); // RequiredAndNullable | bodyWithRequiredAndNullableAttributes - try { - RequiredAndNullable result = apiInstance.requiredAndNullablePost(requiredAndNullable); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling RequiredAndNullableApi#requiredAndNullablePost"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **requiredAndNullable** | [**RequiredAndNullable**](RequiredAndNullable.md)| bodyWithRequiredAndNullableAttributes | | - -### Return type - -[**RequiredAndNullable**](RequiredAndNullable.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **0** | response | - | - diff --git a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/api/RequiredAndNullableApi.java b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/api/NbleApi.java similarity index 59% rename from samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/api/RequiredAndNullableApi.java rename to samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/api/NbleApi.java index 150edbb586db..a5d4b4766760 100644 --- a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/api/RequiredAndNullableApi.java +++ b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/api/NbleApi.java @@ -3,6 +3,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.BaseApi; +import org.jspecify.annotations.Nullable; import org.openapitools.client.model.RequiredAndNullable; import java.util.Collections; @@ -27,16 +28,65 @@ import org.springframework.http.ResponseEntity; @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") -public class RequiredAndNullableApi extends BaseApi { +public class NbleApi extends BaseApi { - public RequiredAndNullableApi() { + public NbleApi() { super(new ApiClient()); } - public RequiredAndNullableApi(ApiClient apiClient) { + public NbleApi(ApiClient apiClient) { super(apiClient); } + /** + * + * + *

0 - OK + * @param mandatory (required) + * @param optional (optional) + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public void nbleGet(String mandatory, String optional) throws RestClientException { + nbleGetWithHttpInfo(mandatory, optional); + } + + /** + * + * + *

0 - OK + * @param mandatory (required) + * @param optional (optional) + * @return ResponseEntity<Void> + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public ResponseEntity nbleGetWithHttpInfo(String mandatory, String optional) throws RestClientException { + Object localVarPostBody = null; + + // verify the required parameter 'mandatory' is set + if (mandatory == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'mandatory' when calling nbleGet"); + } + + + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); + + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "optional", optional)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "mandatory", mandatory)); + + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/nble", HttpMethod.GET, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); + } /** * * @@ -45,8 +95,8 @@ public RequiredAndNullableApi(ApiClient apiClient) { * @return RequiredAndNullable * @throws RestClientException if an error occurs while attempting to invoke the API */ - public RequiredAndNullable requiredAndNullablePost(RequiredAndNullable requiredAndNullable) throws RestClientException { - return requiredAndNullablePostWithHttpInfo(requiredAndNullable).getBody(); + public RequiredAndNullable nblePost(RequiredAndNullable requiredAndNullable) throws RestClientException { + return nblePostWithHttpInfo(requiredAndNullable).getBody(); } /** @@ -57,12 +107,12 @@ public RequiredAndNullable requiredAndNullablePost(RequiredAndNullable requiredA * @return ResponseEntity<RequiredAndNullable> * @throws RestClientException if an error occurs while attempting to invoke the API */ - public ResponseEntity requiredAndNullablePostWithHttpInfo(RequiredAndNullable requiredAndNullable) throws RestClientException { + public ResponseEntity nblePostWithHttpInfo(RequiredAndNullable requiredAndNullable) throws RestClientException { Object localVarPostBody = requiredAndNullable; // verify the required parameter 'requiredAndNullable' is set if (requiredAndNullable == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'requiredAndNullable' when calling requiredAndNullablePost"); + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'requiredAndNullable' when calling nblePost"); } @@ -83,7 +133,7 @@ public ResponseEntity requiredAndNullablePostWithHttpInfo(R String[] localVarAuthNames = new String[] { }; ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/requiredAndNullable", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); + return apiClient.invokeAPI("/nble", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } @Override diff --git a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/api/RequiredAndNullableApiTest.java b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/api/NbleApiTest.java similarity index 65% rename from samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/api/RequiredAndNullableApiTest.java rename to samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/api/NbleApiTest.java index e082ae37e368..81b1d1d267c2 100644 --- a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/api/RequiredAndNullableApiTest.java +++ b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/api/NbleApiTest.java @@ -13,6 +13,7 @@ package org.openapitools.client.api; +import org.jspecify.annotations.Nullable; import org.openapitools.client.model.RequiredAndNullable; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -26,12 +27,12 @@ import java.util.Map; /** - * API tests for RequiredAndNullableApi + * API tests for NbleApi */ @Disabled -class RequiredAndNullableApiTest { +class NbleApiTest { - private final RequiredAndNullableApi api = new RequiredAndNullableApi(); + private final NbleApi api = new NbleApi(); /** @@ -43,10 +44,27 @@ class RequiredAndNullableApiTest { * if the Api call fails */ @Test - void requiredAndNullablePostTest() { + void nbleGetTest() { + String filter = null; + + api.nbleGet(filter); + + // TODO: test validations + } + + /** + * + * + * + * + * @throws RestClientException + * if the Api call fails + */ + @Test + void nblePostTest() { RequiredAndNullable requiredAndNullable = null; - RequiredAndNullable response = api.requiredAndNullablePost(requiredAndNullable); + RequiredAndNullable response = api.nblePost(requiredAndNullable); // TODO: test validations } diff --git a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/.openapi-generator/FILES b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/.openapi-generator/FILES index 821db0873c19..064925b4dd06 100644 --- a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/.openapi-generator/FILES +++ b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/.openapi-generator/FILES @@ -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 @@ -32,7 +32,7 @@ src/main/java/org/openapitools/client/ServerVariable.java src/main/java/org/openapitools/client/StringUtil.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/auth/ApiKeyAuth.java diff --git a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/README.md b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/README.md index ca33e3707136..9d61aa0efc87 100644 --- a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/README.md +++ b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/README.md @@ -117,7 +117,8 @@ Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *FileApi* | [**fileIdGet**](docs/FileApi.md#fileIdGet) | **GET** /file/{id} | *FooApi* | [**fooDtParamGet**](docs/FooApi.md#fooDtParamGet) | **GET** /foo/{dtParam} | -*RequiredAndNullableApi* | [**requiredAndNullablePost**](docs/RequiredAndNullableApi.md#requiredAndNullablePost) | **POST** /requiredAndNullable | +*NbleApi* | [**nbleGet**](docs/NbleApi.md#nbleGet) | **GET** /nble | +*NbleApi* | [**nblePost**](docs/NbleApi.md#nblePost) | **POST** /nble | *UploadApi* | [**uploadFilesPost**](docs/UploadApi.md#uploadFilesPost) | **POST** /uploadFiles | *UploadApi* | [**uploadPost**](docs/UploadApi.md#uploadPost) | **POST** /upload | diff --git a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/api/openapi.yaml b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/api/openapi.yaml index 15c1f4176a50..9c5f4e7cdb47 100644 --- a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/api/openapi.yaml +++ b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/api/openapi.yaml @@ -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: @@ -78,7 +103,7 @@ paths: $ref: "#/components/schemas/RequiredAndNullable" description: response tags: - - requiredAndNullable + - nble x-content-type: application/json x-accepts: - application/json diff --git a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/docs/NbleApi.md b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/docs/NbleApi.md new file mode 100644 index 000000000000..0ad469cec5e2 --- /dev/null +++ b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/docs/NbleApi.md @@ -0,0 +1,139 @@ +# NbleApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**nbleGet**](NbleApi.md#nbleGet) | **GET** /nble | | +| [**nblePost**](NbleApi.md#nblePost) | **POST** /nble | | + + + +## nbleGet + +> nbleGet(mandatory, optional) + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.NbleApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + NbleApi apiInstance = new NbleApi(defaultClient); + String mandatory = "mandatory_example"; // String | + String optional = "optional_example"; // String | + try { + apiInstance.nbleGet(mandatory, optional); + } catch (ApiException e) { + System.err.println("Exception when calling NbleApi#nbleGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **mandatory** | **String**| | | +| **optional** | **String**| | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | OK | - | + + +## nblePost + +> RequiredAndNullable nblePost(requiredAndNullable) + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.NbleApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + NbleApi apiInstance = new NbleApi(defaultClient); + RequiredAndNullable requiredAndNullable = new RequiredAndNullable(); // RequiredAndNullable | bodyWithRequiredAndNullableAttributes + try { + RequiredAndNullable result = apiInstance.nblePost(requiredAndNullable); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling NbleApi#nblePost"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requiredAndNullable** | [**RequiredAndNullable**](RequiredAndNullable.md)| bodyWithRequiredAndNullableAttributes | | + +### Return type + +[**RequiredAndNullable**](RequiredAndNullable.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | response | - | + diff --git a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/docs/RequiredAndNullableApi.md b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/docs/RequiredAndNullableApi.md deleted file mode 100644 index ada434bf0b9e..000000000000 --- a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/docs/RequiredAndNullableApi.md +++ /dev/null @@ -1,73 +0,0 @@ -# RequiredAndNullableApi - -All URIs are relative to *http://localhost* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**requiredAndNullablePost**](RequiredAndNullableApi.md#requiredAndNullablePost) | **POST** /requiredAndNullable | | - - - -## requiredAndNullablePost - -> RequiredAndNullable requiredAndNullablePost(requiredAndNullable) - - - -### Example - -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; -import org.openapitools.client.api.RequiredAndNullableApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - RequiredAndNullableApi apiInstance = new RequiredAndNullableApi(defaultClient); - RequiredAndNullable requiredAndNullable = new RequiredAndNullable(); // RequiredAndNullable | bodyWithRequiredAndNullableAttributes - try { - RequiredAndNullable result = apiInstance.requiredAndNullablePost(requiredAndNullable); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling RequiredAndNullableApi#requiredAndNullablePost"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **requiredAndNullable** | [**RequiredAndNullable**](RequiredAndNullable.md)| bodyWithRequiredAndNullableAttributes | | - -### Return type - -[**RequiredAndNullable**](RequiredAndNullable.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **0** | response | - | - diff --git a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/api/NbleApi.java b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/api/NbleApi.java new file mode 100644 index 000000000000..874a34bc970a --- /dev/null +++ b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/api/NbleApi.java @@ -0,0 +1,298 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiClient; + +import org.jspecify.annotations.Nullable; +import org.openapitools.client.model.RequiredAndNullable; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Objects; +import java.util.Arrays; +import java.util.stream.Collectors; + +import org.springframework.core.io.FileSystemResource; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.web.reactive.function.client.WebClient.ResponseSpec; +import org.springframework.web.reactive.function.client.WebClientResponseException; +import reactor.core.publisher.Mono; +import reactor.core.publisher.Flux; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") +public class NbleApi { + private ApiClient apiClient; + + public NbleApi() { + this(new ApiClient()); + } + + public NbleApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public class NbleGetRequest { + private @Nullable String mandatory; + private @Nullable String optional; + + public NbleGetRequest() {} + + public NbleGetRequest(@Nullable String mandatory, @Nullable String optional) { + this.mandatory = mandatory; + this.optional = optional; + } + + public @Nullable String mandatory() { + return this.mandatory; + } + public NbleGetRequest mandatory(@Nullable String mandatory) { + this.mandatory = mandatory; + return this; + } + + public @Nullable String optional() { + return this.optional; + } + public NbleGetRequest optional(@Nullable String optional) { + this.optional = optional; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NbleGetRequest request = (NbleGetRequest) o; + return Objects.equals(this.mandatory, request.mandatory()) && + Objects.equals(this.optional, request.optional()); + } + + @Override + public int hashCode() { + return Objects.hash(mandatory, optional); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NbleGetRequest {\n"); + sb.append(" mandatory: ").append(toIndentedString(mandatory)).append("\n"); + sb.append(" optional: ").append(toIndentedString(optional)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + } + + /** + * + * + *

0 - OK + * @param requestParameters The nbleGet request parameters as object + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono nbleGet(NbleGetRequest requestParameters) throws WebClientResponseException { + return this.nbleGet(requestParameters.mandatory(), requestParameters.optional()); + } + + /** + * + * + *

0 - OK + * @param requestParameters The nbleGet request parameters as object + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> nbleGetWithHttpInfo(NbleGetRequest requestParameters) throws WebClientResponseException { + return this.nbleGetWithHttpInfo(requestParameters.mandatory(), requestParameters.optional()); + } + + /** + * + * + *

0 - OK + * @param requestParameters The nbleGet request parameters as object + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec nbleGetWithResponseSpec(NbleGetRequest requestParameters) throws WebClientResponseException { + return this.nbleGetWithResponseSpec(requestParameters.mandatory(), requestParameters.optional()); + } + + + /** + * + * + *

0 - OK + * @param mandatory The mandatory parameter + * @param optional The optional parameter + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec nbleGetRequestCreation(@Nullable String mandatory, @Nullable String optional) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'mandatory' is set + if (mandatory == null) { + throw new WebClientResponseException("Missing the required parameter 'mandatory' when calling nbleGet", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "optional", optional)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "mandatory", mandatory)); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/nble", HttpMethod.GET, pathParams, localVarQueryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * + * + *

0 - OK + * @param mandatory The mandatory parameter + * @param optional The optional parameter + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono nbleGet(@Nullable String mandatory, @Nullable String optional) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return nbleGetRequestCreation(mandatory, optional).bodyToMono(localVarReturnType); + } + + /** + * + * + *

0 - OK + * @param mandatory The mandatory parameter + * @param optional The optional parameter + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> nbleGetWithHttpInfo(@Nullable String mandatory, @Nullable String optional) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return nbleGetRequestCreation(mandatory, optional).toEntity(localVarReturnType); + } + + /** + * + * + *

0 - OK + * @param mandatory The mandatory parameter + * @param optional The optional parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec nbleGetWithResponseSpec(@Nullable String mandatory, @Nullable String optional) throws WebClientResponseException { + return nbleGetRequestCreation(mandatory, optional); + } + + /** + * + * + *

0 - response + * @param requiredAndNullable bodyWithRequiredAndNullableAttributes + * @return RequiredAndNullable + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec nblePostRequestCreation(RequiredAndNullable requiredAndNullable) throws WebClientResponseException { + Object postBody = requiredAndNullable; + // verify the required parameter 'requiredAndNullable' is set + if (requiredAndNullable == null) { + throw new WebClientResponseException("Missing the required parameter 'requiredAndNullable' when calling nblePost", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/nble", HttpMethod.POST, pathParams, localVarQueryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * + * + *

0 - response + * @param requiredAndNullable bodyWithRequiredAndNullableAttributes + * @return RequiredAndNullable + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono nblePost(RequiredAndNullable requiredAndNullable) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return nblePostRequestCreation(requiredAndNullable).bodyToMono(localVarReturnType); + } + + /** + * + * + *

0 - response + * @param requiredAndNullable bodyWithRequiredAndNullableAttributes + * @return ResponseEntity<RequiredAndNullable> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> nblePostWithHttpInfo(RequiredAndNullable requiredAndNullable) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return nblePostRequestCreation(requiredAndNullable).toEntity(localVarReturnType); + } + + /** + * + * + *

0 - response + * @param requiredAndNullable bodyWithRequiredAndNullableAttributes + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec nblePostWithResponseSpec(RequiredAndNullable requiredAndNullable) throws WebClientResponseException { + return nblePostRequestCreation(requiredAndNullable); + } +} diff --git a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/api/RequiredAndNullableApi.java b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/api/RequiredAndNullableApi.java deleted file mode 100644 index a7cf9f2d8749..000000000000 --- a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/api/RequiredAndNullableApi.java +++ /dev/null @@ -1,123 +0,0 @@ -package org.openapitools.client.api; - -import org.openapitools.client.ApiClient; - -import org.openapitools.client.model.RequiredAndNullable; - -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Objects; -import java.util.Arrays; -import java.util.stream.Collectors; - -import org.springframework.core.io.FileSystemResource; -import org.springframework.core.ParameterizedTypeReference; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpMethod; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.util.LinkedMultiValueMap; -import org.springframework.util.MultiValueMap; -import org.springframework.web.reactive.function.client.WebClient.ResponseSpec; -import org.springframework.web.reactive.function.client.WebClientResponseException; -import reactor.core.publisher.Mono; -import reactor.core.publisher.Flux; - -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") -public class RequiredAndNullableApi { - private ApiClient apiClient; - - public RequiredAndNullableApi() { - this(new ApiClient()); - } - - public RequiredAndNullableApi(ApiClient apiClient) { - this.apiClient = apiClient; - } - - public ApiClient getApiClient() { - return apiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * - * - *

0 - response - * @param requiredAndNullable bodyWithRequiredAndNullableAttributes - * @return RequiredAndNullable - * @throws WebClientResponseException if an error occurs while attempting to invoke the API - */ - private ResponseSpec requiredAndNullablePostRequestCreation(RequiredAndNullable requiredAndNullable) throws WebClientResponseException { - Object postBody = requiredAndNullable; - // verify the required parameter 'requiredAndNullable' is set - if (requiredAndNullable == null) { - throw new WebClientResponseException("Missing the required parameter 'requiredAndNullable' when calling requiredAndNullablePost", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); - } - // create path and map variables - final Map pathParams = new HashMap(); - - final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - "application/json" - }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/requiredAndNullable", HttpMethod.POST, pathParams, localVarQueryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } - - /** - * - * - *

0 - response - * @param requiredAndNullable bodyWithRequiredAndNullableAttributes - * @return RequiredAndNullable - * @throws WebClientResponseException if an error occurs while attempting to invoke the API - */ - public Mono requiredAndNullablePost(RequiredAndNullable requiredAndNullable) throws WebClientResponseException { - ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; - return requiredAndNullablePostRequestCreation(requiredAndNullable).bodyToMono(localVarReturnType); - } - - /** - * - * - *

0 - response - * @param requiredAndNullable bodyWithRequiredAndNullableAttributes - * @return ResponseEntity<RequiredAndNullable> - * @throws WebClientResponseException if an error occurs while attempting to invoke the API - */ - public Mono> requiredAndNullablePostWithHttpInfo(RequiredAndNullable requiredAndNullable) throws WebClientResponseException { - ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; - return requiredAndNullablePostRequestCreation(requiredAndNullable).toEntity(localVarReturnType); - } - - /** - * - * - *

0 - response - * @param requiredAndNullable bodyWithRequiredAndNullableAttributes - * @return ResponseSpec - * @throws WebClientResponseException if an error occurs while attempting to invoke the API - */ - public ResponseSpec requiredAndNullablePostWithResponseSpec(RequiredAndNullable requiredAndNullable) throws WebClientResponseException { - return requiredAndNullablePostRequestCreation(requiredAndNullable); - } -} diff --git a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/api/RequiredAndNullableApiTest.java b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/api/NbleApiTest.java similarity index 62% rename from samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/api/RequiredAndNullableApiTest.java rename to samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/api/NbleApiTest.java index 5adf56d29694..0870a4bbbe86 100644 --- a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/api/RequiredAndNullableApiTest.java +++ b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/api/NbleApiTest.java @@ -13,6 +13,7 @@ package org.openapitools.client.api; +import org.jspecify.annotations.Nullable; import org.openapitools.client.model.RequiredAndNullable; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; @@ -25,12 +26,12 @@ import java.util.stream.Collectors; /** - * API tests for RequiredAndNullableApi + * API tests for NbleApi */ @Disabled -public class RequiredAndNullableApiTest { +public class NbleApiTest { - private final RequiredAndNullableApi api = new RequiredAndNullableApi(); + private final NbleApi api = new NbleApi(); /** @@ -39,10 +40,24 @@ public class RequiredAndNullableApiTest { * */ @Test - public void requiredAndNullablePostTest() { + public void nbleGetTest() { + // uncomment below to test the function + //String filter = null; + //api.nbleGet(filter).block(); + + // TODO: test validations + } + + /** + * + * + * + */ + @Test + public void nblePostTest() { // uncomment below to test the function //RequiredAndNullable requiredAndNullable = null; - //RequiredAndNullable response = api.requiredAndNullablePost(requiredAndNullable).block(); + //RequiredAndNullable response = api.nblePost(requiredAndNullable).block(); // TODO: test validations } diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/FakeApi.java index a089293ed3f8..6331af252c84 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/FakeApi.java @@ -248,9 +248,9 @@ ResponseEntity testEndpointParameters( ) ResponseEntity testEnumParameters( @RequestHeader(value = "enum_header_string_array", required = false) @Nullable List enumHeaderStringArray, - @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, + @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") @Nullable String enumHeaderString, @Valid @RequestParam(value = "enum_query_string_array", required = false) @Nullable List enumQueryStringArray, - @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, + @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") @Nullable String enumQueryString, @Valid @RequestParam(value = "enum_query_integer", required = false) @Nullable Integer enumQueryInteger, @Valid @RequestParam(value = "enum_query_double", required = false) @Nullable Double enumQueryDouble, @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java index debb7ecc8f66..a523dac9265e 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java @@ -255,9 +255,9 @@ void testEndpointParameters( ) void testEnumParameters( @RequestHeader(value = "enum_header_string_array", required = false) @Nullable List enumHeaderStringArray, - @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, + @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") @Nullable String enumHeaderString, @RequestParam(value = "enum_query_string_array", required = false) @Nullable List enumQueryStringArray, - @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, + @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") @Nullable String enumQueryString, @RequestParam(value = "enum_query_integer", required = false) @Nullable Integer enumQueryInteger, @RequestParam(value = "enum_query_double", required = false) @Nullable Double enumQueryDouble, @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/FakeApi.java index 066620ff21e3..e6f9262e2894 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/FakeApi.java @@ -252,9 +252,9 @@ Mono> testEndpointParameters( ) Mono> testEnumParameters( @RequestHeader(value = "enum_header_string_array", required = false) @Nullable List enumHeaderStringArray, - @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, + @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") @Nullable String enumHeaderString, @Valid @RequestParam(value = "enum_query_string_array", required = false) @Nullable List enumQueryStringArray, - @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, + @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") @Nullable String enumQueryString, @Valid @RequestParam(value = "enum_query_integer", required = false) @Nullable Integer enumQueryInteger, @Valid @RequestParam(value = "enum_query_double", required = false) @Nullable Double enumQueryDouble, @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java index d0056903871a..91ec2c7474c3 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java @@ -259,9 +259,9 @@ Mono testEndpointParameters( ) Mono testEnumParameters( @RequestHeader(value = "enum_header_string_array", required = false) @Nullable List enumHeaderStringArray, - @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, + @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") @Nullable String enumHeaderString, @RequestParam(value = "enum_query_string_array", required = false) @Nullable List enumQueryStringArray, - @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, + @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") @Nullable String enumQueryString, @RequestParam(value = "enum_query_integer", required = false) @Nullable Integer enumQueryInteger, @RequestParam(value = "enum_query_double", required = false) @Nullable Double enumQueryDouble, @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeApi.java index af75ee77bd9c..a1f9282a519e 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeApi.java @@ -249,9 +249,9 @@ Mono> testEndpointParameters( ) Mono> testEnumParameters( @RequestHeader(value = "enum_header_string_array", required = false) @Nullable List enumHeaderStringArray, - @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, + @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") @Nullable String enumHeaderString, @RequestParam(value = "enum_query_string_array", required = false) @Nullable List enumQueryStringArray, - @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, + @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") @Nullable String enumQueryString, @RequestParam(value = "enum_query_integer", required = false) @Nullable Integer enumQueryInteger, @RequestParam(value = "enum_query_double", required = false) @Nullable Double enumQueryDouble, @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/FakeApi.java index a089293ed3f8..6331af252c84 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/FakeApi.java @@ -248,9 +248,9 @@ ResponseEntity testEndpointParameters( ) ResponseEntity testEnumParameters( @RequestHeader(value = "enum_header_string_array", required = false) @Nullable List enumHeaderStringArray, - @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, + @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") @Nullable String enumHeaderString, @Valid @RequestParam(value = "enum_query_string_array", required = false) @Nullable List enumQueryStringArray, - @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, + @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") @Nullable String enumQueryString, @Valid @RequestParam(value = "enum_query_integer", required = false) @Nullable Integer enumQueryInteger, @Valid @RequestParam(value = "enum_query_double", required = false) @Nullable Double enumQueryDouble, @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/FakeApi.java index d8898d654c99..47450ef369d3 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/FakeApi.java @@ -248,9 +248,9 @@ ResponseEntity testEndpointParameters( ) ResponseEntity testEnumParameters( @RequestHeader(value = "enum_header_string_array", required = false) @Nullable List enumHeaderStringArray, - @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, + @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") @Nullable String enumHeaderString, @Valid @RequestParam(value = "enum_query_string_array", required = false) @Nullable List enumQueryStringArray, - @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, + @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") @Nullable String enumQueryString, @Valid @RequestParam(value = "enum_query_integer", required = false) @Nullable Integer enumQueryInteger, @Valid @RequestParam(value = "enum_query_double", required = false) @Nullable Double enumQueryDouble, @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeApi.java index a617a642bae4..3b456004385b 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeApi.java @@ -245,9 +245,9 @@ ResponseEntity testEndpointParameters( ) ResponseEntity testEnumParameters( @RequestHeader(value = "enum_header_string_array", required = false) @Nullable List enumHeaderStringArray, - @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, + @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") @Nullable String enumHeaderString, @RequestParam(value = "enum_query_string_array", required = false) @Nullable List enumQueryStringArray, - @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, + @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") @Nullable String enumQueryString, @RequestParam(value = "enum_query_integer", required = false) @Nullable Integer enumQueryInteger, @RequestParam(value = "enum_query_double", required = false) @Nullable Double enumQueryDouble, @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, diff --git a/samples/openapi3/server/petstore/springboot-4-jspecify-openapiNullable/.openapi-generator/FILES b/samples/openapi3/server/petstore/springboot-4-jspecify-openapiNullable/.openapi-generator/FILES index 559ef9c95db3..d816f87fd6ee 100644 --- a/samples/openapi3/server/petstore/springboot-4-jspecify-openapiNullable/.openapi-generator/FILES +++ b/samples/openapi3/server/petstore/springboot-4-jspecify-openapiNullable/.openapi-generator/FILES @@ -3,7 +3,7 @@ pom.xml src/main/java/org/openapitools/api/ApiUtil.java src/main/java/org/openapitools/api/FileApi.java src/main/java/org/openapitools/api/FooApi.java -src/main/java/org/openapitools/api/RequiredAndNullableApi.java +src/main/java/org/openapitools/api/NbleApi.java src/main/java/org/openapitools/api/UploadApi.java src/main/java/org/openapitools/api/UploadFilesApi.java src/main/java/org/openapitools/api/package-info.java diff --git a/samples/openapi3/server/petstore/springboot-4-jspecify-openapiNullable/src/main/java/org/openapitools/Main.java b/samples/openapi3/server/petstore/springboot-4-jspecify-openapiNullable/src/main/java/org/openapitools/Main.java new file mode 100644 index 000000000000..8a997839440e --- /dev/null +++ b/samples/openapi3/server/petstore/springboot-4-jspecify-openapiNullable/src/main/java/org/openapitools/Main.java @@ -0,0 +1,27 @@ +package org.openapitools; + +import org.openapitools.api.RequiredAndNullableApi; +import org.openapitools.model.RequiredAndNullable; +import org.springframework.boot.CommandLineRunner; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.RestController; + +@SpringBootApplication +public class Main { + public static void main(String[] args) { + new RequiredAndNullable()._list(null).addListItem("test"); + //SpringApplication.run(Main.class, args); + } + + + + @RestController + public static class MyRestController implements RequiredAndNullableApi { + @Override + public ResponseEntity requiredAndNullablePost(RequiredAndNullable requiredAndNullable) { + return RequiredAndNullableApi.super.requiredAndNullablePost(requiredAndNullable); + } + } +} diff --git a/samples/openapi3/server/petstore/springboot-4-jspecify-openapiNullable/src/main/java/org/openapitools/api/RequiredAndNullableApi.java b/samples/openapi3/server/petstore/springboot-4-jspecify-openapiNullable/src/main/java/org/openapitools/api/NbleApi.java similarity index 71% rename from samples/openapi3/server/petstore/springboot-4-jspecify-openapiNullable/src/main/java/org/openapitools/api/RequiredAndNullableApi.java rename to samples/openapi3/server/petstore/springboot-4-jspecify-openapiNullable/src/main/java/org/openapitools/api/NbleApi.java index 916596c41adb..35bce9b81b21 100644 --- a/samples/openapi3/server/petstore/springboot-4-jspecify-openapiNullable/src/main/java/org/openapitools/api/RequiredAndNullableApi.java +++ b/samples/openapi3/server/petstore/springboot-4-jspecify-openapiNullable/src/main/java/org/openapitools/api/NbleApi.java @@ -5,6 +5,7 @@ */ package org.openapitools.api; +import org.jspecify.annotations.Nullable; import org.openapitools.model.RequiredAndNullable; import io.swagger.v3.oas.annotations.ExternalDocumentation; import io.swagger.v3.oas.annotations.Operation; @@ -35,23 +36,51 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") @Validated -@Tag(name = "requiredAndNullable", description = "requiredAndNullable") -public interface RequiredAndNullableApi { +@Tag(name = "nble", description = "the nble API") +public interface NbleApi { default Optional getRequest() { return Optional.empty(); } - String PATH_REQUIRED_AND_NULLABLE_POST = "/requiredAndNullable"; + String PATH_NBLE_GET = "/nble"; /** - * POST /requiredAndNullable + * GET /nble + * + * @param mandatory (required) + * @param optional (optional) + * @return OK (status code 200) + */ + @Operation( + operationId = "nbleGet", + tags = { "nble" }, + responses = { + @ApiResponse(responseCode = "default", description = "OK") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = NbleApi.PATH_NBLE_GET + ) + default ResponseEntity nbleGet( + @NotNull @Parameter(name = "mandatory", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "mandatory", required = true) String mandatory, + @Parameter(name = "optional", description = "", in = ParameterIn.QUERY) @Valid @RequestParam(value = "optional", required = false) String optional + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_NBLE_POST = "/nble"; + /** + * POST /nble * * @param requiredAndNullable bodyWithRequiredAndNullableAttributes (required) * @return response (status code 200) */ @Operation( - operationId = "requiredAndNullablePost", - tags = { "requiredAndNullable" }, + operationId = "nblePost", + tags = { "nble" }, responses = { @ApiResponse(responseCode = "default", description = "response", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = RequiredAndNullable.class)) @@ -60,11 +89,11 @@ default Optional getRequest() { ) @RequestMapping( method = RequestMethod.POST, - value = RequiredAndNullableApi.PATH_REQUIRED_AND_NULLABLE_POST, + value = NbleApi.PATH_NBLE_POST, produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity requiredAndNullablePost( + default ResponseEntity nblePost( @Parameter(name = "RequiredAndNullable", description = "bodyWithRequiredAndNullableAttributes", required = true) @Valid @RequestBody RequiredAndNullable requiredAndNullable ) { getRequest().ifPresent(request -> { diff --git a/samples/openapi3/server/petstore/springboot-4-jspecify-useOptional/.openapi-generator/FILES b/samples/openapi3/server/petstore/springboot-4-jspecify-useOptional/.openapi-generator/FILES index 559ef9c95db3..d816f87fd6ee 100644 --- a/samples/openapi3/server/petstore/springboot-4-jspecify-useOptional/.openapi-generator/FILES +++ b/samples/openapi3/server/petstore/springboot-4-jspecify-useOptional/.openapi-generator/FILES @@ -3,7 +3,7 @@ pom.xml src/main/java/org/openapitools/api/ApiUtil.java src/main/java/org/openapitools/api/FileApi.java src/main/java/org/openapitools/api/FooApi.java -src/main/java/org/openapitools/api/RequiredAndNullableApi.java +src/main/java/org/openapitools/api/NbleApi.java src/main/java/org/openapitools/api/UploadApi.java src/main/java/org/openapitools/api/UploadFilesApi.java src/main/java/org/openapitools/api/package-info.java diff --git a/samples/openapi3/server/petstore/springboot-4-jspecify-useOptional/src/main/java/org/openapitools/api/RequiredAndNullableApi.java b/samples/openapi3/server/petstore/springboot-4-jspecify-useOptional/src/main/java/org/openapitools/api/NbleApi.java similarity index 70% rename from samples/openapi3/server/petstore/springboot-4-jspecify-useOptional/src/main/java/org/openapitools/api/RequiredAndNullableApi.java rename to samples/openapi3/server/petstore/springboot-4-jspecify-useOptional/src/main/java/org/openapitools/api/NbleApi.java index 916596c41adb..e53d704b4f65 100644 --- a/samples/openapi3/server/petstore/springboot-4-jspecify-useOptional/src/main/java/org/openapitools/api/RequiredAndNullableApi.java +++ b/samples/openapi3/server/petstore/springboot-4-jspecify-useOptional/src/main/java/org/openapitools/api/NbleApi.java @@ -5,6 +5,7 @@ */ package org.openapitools.api; +import org.jspecify.annotations.Nullable; import org.openapitools.model.RequiredAndNullable; import io.swagger.v3.oas.annotations.ExternalDocumentation; import io.swagger.v3.oas.annotations.Operation; @@ -35,23 +36,51 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") @Validated -@Tag(name = "requiredAndNullable", description = "requiredAndNullable") -public interface RequiredAndNullableApi { +@Tag(name = "nble", description = "the nble API") +public interface NbleApi { default Optional getRequest() { return Optional.empty(); } - String PATH_REQUIRED_AND_NULLABLE_POST = "/requiredAndNullable"; + String PATH_NBLE_GET = "/nble"; /** - * POST /requiredAndNullable + * GET /nble + * + * @param mandatory (required) + * @param optional (optional) + * @return OK (status code 200) + */ + @Operation( + operationId = "nbleGet", + tags = { "nble" }, + responses = { + @ApiResponse(responseCode = "default", description = "OK") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = NbleApi.PATH_NBLE_GET + ) + default ResponseEntity nbleGet( + @NotNull @Parameter(name = "mandatory", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "mandatory", required = true) String mandatory, + @Parameter(name = "optional", description = "", in = ParameterIn.QUERY) @Valid @RequestParam(value = "optional", required = false) Optional optional + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_NBLE_POST = "/nble"; + /** + * POST /nble * * @param requiredAndNullable bodyWithRequiredAndNullableAttributes (required) * @return response (status code 200) */ @Operation( - operationId = "requiredAndNullablePost", - tags = { "requiredAndNullable" }, + operationId = "nblePost", + tags = { "nble" }, responses = { @ApiResponse(responseCode = "default", description = "response", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = RequiredAndNullable.class)) @@ -60,11 +89,11 @@ default Optional getRequest() { ) @RequestMapping( method = RequestMethod.POST, - value = RequiredAndNullableApi.PATH_REQUIRED_AND_NULLABLE_POST, + value = NbleApi.PATH_NBLE_POST, produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity requiredAndNullablePost( + default ResponseEntity nblePost( @Parameter(name = "RequiredAndNullable", description = "bodyWithRequiredAndNullableAttributes", required = true) @Valid @RequestBody RequiredAndNullable requiredAndNullable ) { getRequest().ifPresent(request -> { diff --git a/samples/openapi3/server/petstore/springboot-4-jspecify/.openapi-generator/FILES b/samples/openapi3/server/petstore/springboot-4-jspecify/.openapi-generator/FILES index 559ef9c95db3..d816f87fd6ee 100644 --- a/samples/openapi3/server/petstore/springboot-4-jspecify/.openapi-generator/FILES +++ b/samples/openapi3/server/petstore/springboot-4-jspecify/.openapi-generator/FILES @@ -3,7 +3,7 @@ pom.xml src/main/java/org/openapitools/api/ApiUtil.java src/main/java/org/openapitools/api/FileApi.java src/main/java/org/openapitools/api/FooApi.java -src/main/java/org/openapitools/api/RequiredAndNullableApi.java +src/main/java/org/openapitools/api/NbleApi.java src/main/java/org/openapitools/api/UploadApi.java src/main/java/org/openapitools/api/UploadFilesApi.java src/main/java/org/openapitools/api/package-info.java diff --git a/samples/openapi3/server/petstore/springboot-4-jspecify/src/main/java/org/openapitools/api/RequiredAndNullableApi.java b/samples/openapi3/server/petstore/springboot-4-jspecify/src/main/java/org/openapitools/api/NbleApi.java similarity index 70% rename from samples/openapi3/server/petstore/springboot-4-jspecify/src/main/java/org/openapitools/api/RequiredAndNullableApi.java rename to samples/openapi3/server/petstore/springboot-4-jspecify/src/main/java/org/openapitools/api/NbleApi.java index 916596c41adb..3fc50134050e 100644 --- a/samples/openapi3/server/petstore/springboot-4-jspecify/src/main/java/org/openapitools/api/RequiredAndNullableApi.java +++ b/samples/openapi3/server/petstore/springboot-4-jspecify/src/main/java/org/openapitools/api/NbleApi.java @@ -5,6 +5,7 @@ */ package org.openapitools.api; +import org.jspecify.annotations.Nullable; import org.openapitools.model.RequiredAndNullable; import io.swagger.v3.oas.annotations.ExternalDocumentation; import io.swagger.v3.oas.annotations.Operation; @@ -35,23 +36,51 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") @Validated -@Tag(name = "requiredAndNullable", description = "requiredAndNullable") -public interface RequiredAndNullableApi { +@Tag(name = "nble", description = "the nble API") +public interface NbleApi { default Optional getRequest() { return Optional.empty(); } - String PATH_REQUIRED_AND_NULLABLE_POST = "/requiredAndNullable"; + String PATH_NBLE_GET = "/nble"; /** - * POST /requiredAndNullable + * GET /nble + * + * @param mandatory (required) + * @param optional (optional) + * @return OK (status code 200) + */ + @Operation( + operationId = "nbleGet", + tags = { "nble" }, + responses = { + @ApiResponse(responseCode = "default", description = "OK") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = NbleApi.PATH_NBLE_GET + ) + default ResponseEntity nbleGet( + @NotNull @Parameter(name = "mandatory", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "mandatory", required = true) String mandatory, + @Parameter(name = "optional", description = "", in = ParameterIn.QUERY) @Valid @RequestParam(value = "optional", required = false) @Nullable String optional + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_NBLE_POST = "/nble"; + /** + * POST /nble * * @param requiredAndNullable bodyWithRequiredAndNullableAttributes (required) * @return response (status code 200) */ @Operation( - operationId = "requiredAndNullablePost", - tags = { "requiredAndNullable" }, + operationId = "nblePost", + tags = { "nble" }, responses = { @ApiResponse(responseCode = "default", description = "response", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = RequiredAndNullable.class)) @@ -60,11 +89,11 @@ default Optional getRequest() { ) @RequestMapping( method = RequestMethod.POST, - value = RequiredAndNullableApi.PATH_REQUIRED_AND_NULLABLE_POST, + value = NbleApi.PATH_NBLE_POST, produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity requiredAndNullablePost( + default ResponseEntity nblePost( @Parameter(name = "RequiredAndNullable", description = "bodyWithRequiredAndNullableAttributes", required = true) @Valid @RequestBody RequiredAndNullable requiredAndNullable ) { getRequest().ifPresent(request -> {