mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-06 18:45:23 +00:00
Fix for optional and default types (#1107)
This commit is contained in:
parent
70e6e119d1
commit
5aad02ed90
@ -1 +1 @@
|
||||
{{#isBodyParam}}{{#swaggerAnnotations}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}} {{^isContainer}}{{#allowableValues}}, allowableValues="{{{allowableValues}}}"{{/allowableValues}}{{/isContainer}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}){{/swaggerAnnotations}} {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestBody {{paramName}}: {{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isListContainer}}Mono{{/isListContainer}}{{#isListContainer}}Flux{{/isListContainer}}<{{{baseType}}}>{{/reactive}}{{/isBodyParam}}
|
||||
{{#isBodyParam}}{{#swaggerAnnotations}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}} {{^isContainer}}{{#allowableValues}}, allowableValues="{{{allowableValues}}}"{{/allowableValues}}{{/isContainer}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}){{/swaggerAnnotations}} {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestBody {{paramName}}: {{^reactive}}{{>optionalDataType}}{{/reactive}}{{#reactive}}{{^isListContainer}}Mono{{/isListContainer}}{{#isListContainer}}Flux{{/isListContainer}}<{{{baseType}}}>{{/reactive}}{{/isBodyParam}}
|
@ -1 +1 @@
|
||||
{{#isFormParam}}{{^isFile}}{{#swaggerAnnotations}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}){{/swaggerAnnotations}} @RequestParam(value="{{baseName}}"{{#required}}, required=true{{/required}}{{^required}}, required=false{{/required}}) {{paramName}}: {{{dataType}}} {{/isFile}}{{#isFile}}{{#swaggerAnnotations}}@ApiParam(value = "file detail"){{/swaggerAnnotations}} {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestPart("file") {{baseName}}: MultipartFile{{/isFile}}{{/isFormParam}}
|
||||
{{#isFormParam}}{{^isFile}}{{#swaggerAnnotations}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}){{/swaggerAnnotations}} @RequestParam(value="{{baseName}}"{{#required}}, required=true{{/required}}{{^required}}, required=false{{/required}}) {{paramName}}: {{>optionalDataType}} {{/isFile}}{{#isFile}}{{#swaggerAnnotations}}@ApiParam(value = "file detail"){{/swaggerAnnotations}} {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestPart("file") {{baseName}}: MultipartFile{{/isFile}}{{/isFormParam}}
|
@ -1 +1 @@
|
||||
{{#required}}{{{dataType}}}{{/required}}{{^required}}{{{dataType}}}?{{/required}}
|
||||
{{#required}}{{{dataType}}}{{/required}}{{^required}}{{#defaultValue}}{{{dataType}}}{{/defaultValue}}{{^defaultValue}}{{{dataType}}}?{{/defaultValue}}{{/required}}
|
@ -17,7 +17,7 @@ interface PetApiService {
|
||||
|
||||
fun updatePet(pet: Pet): Unit
|
||||
|
||||
fun updatePetWithForm(petId: Long,name: String?,status: String?): Unit
|
||||
fun updatePetWithForm(petId: Long,name: String,status: String): Unit
|
||||
|
||||
fun uploadFile(petId: Long,additionalMetadata: String?,file: org.springframework.web.multipart.MultipartFile): ModelApiResponse
|
||||
fun uploadFile(petId: Long,additionalMetadata: String,file: org.springframework.web.multipart.MultipartFile): ModelApiResponse
|
||||
}
|
||||
|
@ -31,11 +31,11 @@ class PetApiServiceImpl : PetApiService {
|
||||
TODO("Implement me")
|
||||
}
|
||||
|
||||
override fun updatePetWithForm(petId: Long,name: String?,status: String?): Unit {
|
||||
override fun updatePetWithForm(petId: Long,name: String,status: String): Unit {
|
||||
TODO("Implement me")
|
||||
}
|
||||
|
||||
override fun uploadFile(petId: Long,additionalMetadata: String?,file: org.springframework.web.multipart.MultipartFile): ModelApiResponse {
|
||||
override fun uploadFile(petId: Long,additionalMetadata: String,file: org.springframework.web.multipart.MultipartFile): ModelApiResponse {
|
||||
TODO("Implement me")
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ interface PetApiService {
|
||||
|
||||
fun updatePet(pet: Pet): Unit
|
||||
|
||||
fun updatePetWithForm(petId: Long,name: String?,status: String?): Unit
|
||||
fun updatePetWithForm(petId: Long,name: String,status: String): Unit
|
||||
|
||||
fun uploadFile(petId: Long,additionalMetadata: String?,file: org.springframework.web.multipart.MultipartFile): ModelApiResponse
|
||||
fun uploadFile(petId: Long,additionalMetadata: String,file: org.springframework.web.multipart.MultipartFile): ModelApiResponse
|
||||
}
|
||||
|
@ -31,11 +31,11 @@ class PetApiServiceImpl : PetApiService {
|
||||
TODO("Implement me")
|
||||
}
|
||||
|
||||
override fun updatePetWithForm(petId: Long,name: String?,status: String?): Unit {
|
||||
override fun updatePetWithForm(petId: Long,name: String,status: String): Unit {
|
||||
TODO("Implement me")
|
||||
}
|
||||
|
||||
override fun uploadFile(petId: Long,additionalMetadata: String?,file: org.springframework.web.multipart.MultipartFile): ModelApiResponse {
|
||||
override fun uploadFile(petId: Long,additionalMetadata: String,file: org.springframework.web.multipart.MultipartFile): ModelApiResponse {
|
||||
TODO("Implement me")
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user