Skip to content

Commit 56bd8d1

Browse files
committed
Merge remote-tracking branch 'upstream/master' into kotlin-multiplatform-descriminator
2 parents 2bb2dfe + 9c1b680 commit 56bd8d1

373 files changed

Lines changed: 651 additions & 840 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -708,9 +708,9 @@ public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List<Mo
708708
}
709709
}
710710

711-
// If we use a file parameter, we need to include the imports and crates for it
711+
// If we use a file body parameter, we need to include the imports and crates for it
712712
// But they should be added only once per file
713-
for (var param: operation.allParams) {
713+
for (var param: operation.bodyParams) {
714714
if (param.isFile && supportAsync && !useAsyncFileStream) {
715715
useAsyncFileStream = true;
716716
additionalProperties.put("useAsyncFileStream", Boolean.TRUE);

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,6 +1039,12 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation
10391039
codegenOperation.imports.addAll(provideArgsClassSet);
10401040
}
10411041

1042+
// to prevent inheritors (JavaCamelServerCodegen etc.) mistakenly use it
1043+
if (getName().contains("spring")) {
1044+
codegenOperation.allParams.stream().filter(CodegenParameter::notRequiredOrIsNullable).findAny()
1045+
.ifPresent(p -> codegenOperation.imports.add("Nullable"));
1046+
}
1047+
10421048
if (reactive) {
10431049
if (DocumentationProvider.SPRINGFOX.equals(getDocumentationProvider())) {
10441050
codegenOperation.imports.add("ApiIgnore");

modules/openapi-generator/src/main/resources/JavaSpring/api.mustache

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import io.virtualan.annotation.VirtualService;
3232
import org.springframework.http.HttpStatus;
3333
import org.springframework.http.MediaType;
3434
{{/jdk8-no-delegate}}
35-
import org.springframework.lang.Nullable;
3635
{{^useResponseEntity}}
3736
import org.springframework.http.HttpStatus;
3837
{{/useResponseEntity}}

modules/openapi-generator/src/main/resources/JavaSpring/apiController.mustache

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import io.swagger.annotations.*;
2121
import org.springframework.beans.factory.annotation.Autowired;
2222
import org.springframework.http.HttpStatus;
2323
import org.springframework.http.MediaType;
24-
import org.springframework.lang.Nullable;
2524
{{#useResponseEntity}}
2625
import org.springframework.http.ResponseEntity;
2726
import org.springframework.stereotype.Controller;

modules/openapi-generator/src/main/resources/JavaSpring/apiDelegate.mustache

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import org.springframework.http.MediaType;
77
{{#useResponseEntity}}
88
import org.springframework.http.ResponseEntity;
99
{{/useResponseEntity}}
10-
import org.springframework.lang.Nullable;
1110
import org.springframework.web.context.request.NativeWebRequest;
1211
import org.springframework.web.multipart.MultipartFile;
1312
{{#reactive}}

modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/api.mustache

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import org.springframework.http.HttpStatus;
1313
{{#useResponseEntity}}
1414
import org.springframework.http.ResponseEntity;
1515
{{/useResponseEntity}}
16-
import org.springframework.lang.Nullable;
1716
import org.springframework.web.bind.annotation.*;
1817
import org.springframework.web.service.annotation.*;
1918
import org.springframework.web.multipart.MultipartFile;

modules/openapi-generator/src/main/resources/php/model_generic.mustache

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -476,24 +476,24 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par
476476
/**
477477
* Returns true if offset exists. False otherwise.
478478
*
479-
* @param integer $offset Offset
479+
* @param integer|string $offset Offset
480480
*
481481
* @return boolean
482482
*/
483-
public function offsetExists($offset): bool
483+
public function offsetExists(mixed $offset): bool
484484
{
485485
return isset($this->container[$offset]);
486486
}
487487

488488
/**
489489
* Gets offset.
490490
*
491-
* @param integer $offset Offset
491+
* @param integer|string $offset Offset
492492
*
493493
* @return mixed|null
494494
*/
495495
#[\ReturnTypeWillChange]
496-
public function offsetGet($offset)
496+
public function offsetGet(mixed $offset)
497497
{
498498
return $this->container[$offset] ?? null;
499499
}
@@ -518,11 +518,11 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par
518518
/**
519519
* Unsets offset.
520520
*
521-
* @param integer $offset Offset
521+
* @param integer|string $offset Offset
522522
*
523523
* @return void
524524
*/
525-
public function offsetUnset($offset): void
525+
public function offsetUnset(mixed $offset): void
526526
{
527527
unset($this->container[$offset]);
528528
}

modules/openapi-generator/src/main/resources/scala-http4s/baseClient.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ abstract class BaseClient[F[*]: Concurrent](
6666
request.putHeaders(Header.Raw(CIString(name), value))
6767
}
6868
val formBody = formParameters.map { x =>
69-
UrlForm(x.groupBy(_._1).map{case (k, v) => (k, v.mkString(","))}.toSeq*)
69+
UrlForm(x.groupBy(_._1).map { case (k, v) => (k, v.map(_._2).mkString(",")) }.toSeq*)
7070
}
7171

7272
import JsonSupports.*

samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -352,24 +352,24 @@ public function setMapOfMapProperty($map_of_map_property)
352352
/**
353353
* Returns true if offset exists. False otherwise.
354354
*
355-
* @param integer $offset Offset
355+
* @param integer|string $offset Offset
356356
*
357357
* @return boolean
358358
*/
359-
public function offsetExists($offset): bool
359+
public function offsetExists(mixed $offset): bool
360360
{
361361
return isset($this->container[$offset]);
362362
}
363363

364364
/**
365365
* Gets offset.
366366
*
367-
* @param integer $offset Offset
367+
* @param integer|string $offset Offset
368368
*
369369
* @return mixed|null
370370
*/
371371
#[\ReturnTypeWillChange]
372-
public function offsetGet($offset)
372+
public function offsetGet(mixed $offset)
373373
{
374374
return $this->container[$offset] ?? null;
375375
}
@@ -394,11 +394,11 @@ public function offsetSet($offset, $value): void
394394
/**
395395
* Unsets offset.
396396
*
397-
* @param integer $offset Offset
397+
* @param integer|string $offset Offset
398398
*
399399
* @return void
400400
*/
401-
public function offsetUnset($offset): void
401+
public function offsetUnset(mixed $offset): void
402402
{
403403
unset($this->container[$offset]);
404404
}

samples/client/petstore/php/OpenAPIClient-php/lib/Model/AllOfWithSingleRef.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -352,24 +352,24 @@ public function setSingleRefType($single_ref_type)
352352
/**
353353
* Returns true if offset exists. False otherwise.
354354
*
355-
* @param integer $offset Offset
355+
* @param integer|string $offset Offset
356356
*
357357
* @return boolean
358358
*/
359-
public function offsetExists($offset): bool
359+
public function offsetExists(mixed $offset): bool
360360
{
361361
return isset($this->container[$offset]);
362362
}
363363

364364
/**
365365
* Gets offset.
366366
*
367-
* @param integer $offset Offset
367+
* @param integer|string $offset Offset
368368
*
369369
* @return mixed|null
370370
*/
371371
#[\ReturnTypeWillChange]
372-
public function offsetGet($offset)
372+
public function offsetGet(mixed $offset)
373373
{
374374
return $this->container[$offset] ?? null;
375375
}
@@ -394,11 +394,11 @@ public function offsetSet($offset, $value): void
394394
/**
395395
* Unsets offset.
396396
*
397-
* @param integer $offset Offset
397+
* @param integer|string $offset Offset
398398
*
399399
* @return void
400400
*/
401-
public function offsetUnset($offset): void
401+
public function offsetUnset(mixed $offset): void
402402
{
403403
unset($this->container[$offset]);
404404
}

0 commit comments

Comments
 (0)