forked from loafle/openapi-generator-original
Remove appendRequestToHandler (#19500)
This commit is contained in:
parent
42d98e2526
commit
f54b0e25a4
@ -30,7 +30,6 @@ jobs:
|
||||
# server
|
||||
- samples/server/petstore/kotlin-springboot-3
|
||||
- samples/server/petstore/kotlin-springboot-delegate-nodefaults
|
||||
- samples/server/petstore/kotlin-springboot-request
|
||||
- samples/server/petstore/kotlin-springboot-request-cookie
|
||||
- samples/server/petstore/kotlin-server/javalin
|
||||
- samples/server/petstore/kotlin-server/javalin-6
|
||||
|
@ -1,9 +0,0 @@
|
||||
generatorName: kotlin-spring
|
||||
outputDir: samples/server/petstore/kotlin-springboot-request
|
||||
library: spring-boot
|
||||
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/kotlin-spring
|
||||
additionalProperties:
|
||||
appendRequestToHandler: true
|
||||
interfaceOnly: true
|
||||
useSpringBoot3: true
|
@ -22,7 +22,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|annotationLibrary|Select the complementary documentation annotation library.|<dl><dt>**none**</dt><dd>Do not annotate Model and Api with complementary annotations.</dd><dt>**swagger1**</dt><dd>Annotate Model and Api using the Swagger Annotations 1.x library.</dd><dt>**swagger2**</dt><dd>Annotate Model and Api using the Swagger Annotations 2.x library.</dd></dl>|swagger2|
|
||||
|apiPackage|api package for generated code| |org.openapitools.api|
|
||||
|apiSuffix|suffix for api classes| |Api|
|
||||
|appendRequestToHandler|Append ServerHttpRequest to handler method for getting request stuff| |false|
|
||||
|artifactId|Generated artifact id (name of jar).| |openapi-spring|
|
||||
|artifactVersion|Generated artifact's package version.| |1.0.0|
|
||||
|basePackage|base package (invokerPackage) for generated code| |org.openapitools|
|
||||
|
@ -105,7 +105,6 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen
|
||||
public static final String BEAN_QUALIFIERS = "beanQualifiers";
|
||||
|
||||
public static final String USE_SPRING_BOOT3 = "useSpringBoot3";
|
||||
public static final String APPEND_REQUEST_TO_HANDLER = "appendRequestToHandler";
|
||||
public static final String REQUEST_MAPPING_OPTION = "requestMappingMode";
|
||||
public static final String USE_REQUEST_MAPPING_ON_CONTROLLER = "useRequestMappingOnController";
|
||||
public static final String USE_REQUEST_MAPPING_ON_INTERFACE = "useRequestMappingOnInterface";
|
||||
@ -236,7 +235,6 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen
|
||||
"@RestController annotations. May be used to prevent bean names clash if multiple generated libraries" +
|
||||
" (contexts) added to single project.", beanQualifiers);
|
||||
addSwitch(USE_SPRING_BOOT3, "Generate code and provide dependencies for use with Spring Boot 3.x. (Use jakarta instead of javax in imports). Enabling this option will also enable `useJakartaEe`.", useSpringBoot3);
|
||||
addSwitch(APPEND_REQUEST_TO_HANDLER, "Append ServerHttpRequest to handler method for getting request stuff", false);
|
||||
supportedLibraries.put(SPRING_BOOT, "Spring-boot Server application.");
|
||||
supportedLibraries.put(SPRING_CLOUD_LIBRARY,
|
||||
"Spring-Cloud-Feign client with Spring-Boot auto-configured settings.");
|
||||
@ -356,10 +354,6 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen
|
||||
return this.useBeanValidation;
|
||||
}
|
||||
|
||||
public boolean isAppendRequestToHandler() {
|
||||
return Boolean.parseBoolean(additionalProperties.getOrDefault(APPEND_REQUEST_TO_HANDLER, false).toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUseBeanValidation(boolean useBeanValidation) {
|
||||
this.useBeanValidation = useBeanValidation;
|
||||
@ -889,9 +883,6 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen
|
||||
|
||||
final List<CodegenParameter> allParams = operation.allParams;
|
||||
if (allParams != null) {
|
||||
if (this.isAppendRequestToHandler()) {
|
||||
allParams.add(new RequestCodegenParameter());
|
||||
}
|
||||
allParams.forEach(param ->
|
||||
// This is necessary in case 'modelMutable' is enabled,
|
||||
// to prevent Spring Request handlers from being generated with
|
||||
@ -983,22 +974,6 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen
|
||||
return !type.startsWith("org.springframework.") && super.needToImport(type);
|
||||
}
|
||||
|
||||
@AllArgsConstructor
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
static class RequestCodegenParameter extends CodegenParameter {
|
||||
|
||||
boolean isRequestObject = true;
|
||||
|
||||
public RequestCodegenParameter() {
|
||||
this.isOptional = false;
|
||||
this.required = true;
|
||||
this.paramName = "serverHttpRequest";
|
||||
this.dataType = "ServerHttpRequest";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public RequestMappingMode getRequestMappingMode() {
|
||||
return requestMappingMode;
|
||||
}
|
||||
|
@ -29,9 +29,6 @@ import org.springframework.validation.annotation.Validated
|
||||
import org.springframework.web.context.request.NativeWebRequest
|
||||
import org.springframework.beans.factory.annotation.Autowired
|
||||
|
||||
{{#appendRequestToHandler}}
|
||||
import org.springframework.http.server.reactive.ServerHttpRequest
|
||||
{{/appendRequestToHandler}}
|
||||
{{#useBeanValidation}}
|
||||
import {{javaxPackage}}.validation.Valid
|
||||
import {{javaxPackage}}.validation.constraints.DecimalMax
|
||||
@ -92,7 +89,7 @@ class {{classname}}Controller({{#serviceInterface}}@Autowired(required = true) v
|
||||
produces = [{{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}}]{{/hasProduces}}{{#hasConsumes}},
|
||||
consumes = [{{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}}]{{/hasConsumes}}{{/singleContentTypes}}
|
||||
)
|
||||
{{#reactive}}{{^isArray}}suspend {{/isArray}}{{/reactive}}fun {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>cookieParams}}{{>bodyParams}}{{>formParams}}{{>requesObject}}{{^-last}},{{/-last}}{{/allParams}}): ResponseEntity<{{>returnTypes}}> {
|
||||
{{#reactive}}{{^isArray}}suspend {{/isArray}}{{/reactive}}fun {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>cookieParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}}): ResponseEntity<{{>returnTypes}}> {
|
||||
return {{>returnValue}}
|
||||
}
|
||||
{{/operation}}
|
||||
|
@ -26,9 +26,6 @@ import io.swagger.annotations.AuthorizationScope
|
||||
import org.springframework.http.HttpStatus
|
||||
import org.springframework.http.MediaType
|
||||
import org.springframework.http.ResponseEntity
|
||||
{{#appendRequestToHandler}}
|
||||
import org.springframework.http.server.reactive.ServerHttpRequest
|
||||
{{/appendRequestToHandler}}
|
||||
|
||||
import org.springframework.web.bind.annotation.*
|
||||
{{#useBeanValidation}}
|
||||
@ -103,7 +100,7 @@ interface {{classname}} {
|
||||
produces = [{{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}}]{{/hasProduces}}{{#hasConsumes}},
|
||||
consumes = [{{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}}]{{/hasConsumes}}{{/singleContentTypes}}
|
||||
)
|
||||
{{#reactive}}{{^isArray}}suspend {{/isArray}}{{/reactive}}fun {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>cookieParams}}{{>bodyParams}}{{>formParams}}{{>requesObject}}{{^-last}},{{/-last}}{{/allParams}}): ResponseEntity<{{>returnTypes}}>{{^skipDefaultApiInterface}} {
|
||||
{{#reactive}}{{^isArray}}suspend {{/isArray}}{{/reactive}}fun {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>cookieParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}}): ResponseEntity<{{>returnTypes}}>{{^skipDefaultApiInterface}} {
|
||||
{{^isDelegate}}
|
||||
return {{>returnValue}}
|
||||
{{/isDelegate}}
|
||||
|
@ -1 +0,0 @@
|
||||
{{#isRequestObject}}serverHttpRequest: ServerHttpRequest{{/isRequestObject}}
|
@ -15,7 +15,6 @@ import io.swagger.v3.oas.annotations.security.*
|
||||
import org.springframework.http.HttpStatus
|
||||
import org.springframework.http.MediaType
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.http.server.reactive.ServerHttpRequest
|
||||
|
||||
import org.springframework.web.bind.annotation.*
|
||||
import org.springframework.validation.annotation.Validated
|
||||
@ -58,8 +57,8 @@ interface PetApi {
|
||||
produces = ["application/xml", "application/json"],
|
||||
consumes = ["application/json", "application/xml"]
|
||||
)
|
||||
fun addPet(@Parameter(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody pet: Pet,serverHttpRequest: ServerHttpRequest): ResponseEntity<Pet> {
|
||||
return getDelegate().addPet(pet, serverHttpRequest)
|
||||
fun addPet(@Parameter(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody pet: Pet): ResponseEntity<Pet> {
|
||||
return getDelegate().addPet(pet)
|
||||
}
|
||||
|
||||
@Operation(
|
||||
@ -76,8 +75,8 @@ interface PetApi {
|
||||
method = [RequestMethod.DELETE],
|
||||
value = ["/pet/{petId}"]
|
||||
)
|
||||
fun deletePet(@Parameter(description = "Pet id to delete", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "", `in` = ParameterIn.HEADER) @RequestHeader(value = "api_key", required = false) apiKey: kotlin.String?,serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
return getDelegate().deletePet(petId, apiKey, serverHttpRequest)
|
||||
fun deletePet(@Parameter(description = "Pet id to delete", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "", `in` = ParameterIn.HEADER) @RequestHeader(value = "api_key", required = false) apiKey: kotlin.String?): ResponseEntity<Unit> {
|
||||
return getDelegate().deletePet(petId, apiKey)
|
||||
}
|
||||
|
||||
@Operation(
|
||||
@ -96,8 +95,8 @@ interface PetApi {
|
||||
value = ["/pet/findByStatus"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun findPetsByStatus(@NotNull @Parameter(description = "Status values that need to be considered for filter", required = true, schema = Schema(allowableValues = ["available", "pending", "sold"])) @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>,serverHttpRequest: ServerHttpRequest): ResponseEntity<List<Pet>> {
|
||||
return getDelegate().findPetsByStatus(status, serverHttpRequest)
|
||||
fun findPetsByStatus(@NotNull @Parameter(description = "Status values that need to be considered for filter", required = true, schema = Schema(allowableValues = ["available", "pending", "sold"])) @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
return getDelegate().findPetsByStatus(status)
|
||||
}
|
||||
|
||||
@Operation(
|
||||
@ -116,8 +115,8 @@ interface PetApi {
|
||||
value = ["/pet/findByTags"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun findPetsByTags(@NotNull @Parameter(description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>,serverHttpRequest: ServerHttpRequest): ResponseEntity<List<Pet>> {
|
||||
return getDelegate().findPetsByTags(tags, serverHttpRequest)
|
||||
fun findPetsByTags(@NotNull @Parameter(description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
return getDelegate().findPetsByTags(tags)
|
||||
}
|
||||
|
||||
@Operation(
|
||||
@ -137,8 +136,8 @@ interface PetApi {
|
||||
value = ["/pet/{petId}"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun getPetById(@Parameter(description = "ID of pet to return", required = true) @PathVariable("petId") petId: kotlin.Long,serverHttpRequest: ServerHttpRequest): ResponseEntity<Pet> {
|
||||
return getDelegate().getPetById(petId, serverHttpRequest)
|
||||
fun getPetById(@Parameter(description = "ID of pet to return", required = true) @PathVariable("petId") petId: kotlin.Long): ResponseEntity<Pet> {
|
||||
return getDelegate().getPetById(petId)
|
||||
}
|
||||
|
||||
@Operation(
|
||||
@ -160,8 +159,8 @@ interface PetApi {
|
||||
produces = ["application/xml", "application/json"],
|
||||
consumes = ["application/json", "application/xml"]
|
||||
)
|
||||
fun updatePet(@Parameter(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody pet: Pet,serverHttpRequest: ServerHttpRequest): ResponseEntity<Pet> {
|
||||
return getDelegate().updatePet(pet, serverHttpRequest)
|
||||
fun updatePet(@Parameter(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody pet: Pet): ResponseEntity<Pet> {
|
||||
return getDelegate().updatePet(pet)
|
||||
}
|
||||
|
||||
@Operation(
|
||||
@ -179,8 +178,8 @@ interface PetApi {
|
||||
value = ["/pet/{petId}"],
|
||||
consumes = ["application/x-www-form-urlencoded"]
|
||||
)
|
||||
fun updatePetWithForm(@Parameter(description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Updated name of the pet") @RequestParam(value = "name", required = false) name: kotlin.String? ,@Parameter(description = "Updated status of the pet") @RequestParam(value = "status", required = false) status: kotlin.String? ,serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
return getDelegate().updatePetWithForm(petId, name, status, serverHttpRequest)
|
||||
fun updatePetWithForm(@Parameter(description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Updated name of the pet") @RequestParam(value = "name", required = false) name: kotlin.String? ,@Parameter(description = "Updated status of the pet") @RequestParam(value = "status", required = false) status: kotlin.String? ): ResponseEntity<Unit> {
|
||||
return getDelegate().updatePetWithForm(petId, name, status)
|
||||
}
|
||||
|
||||
@Operation(
|
||||
@ -199,7 +198,7 @@ interface PetApi {
|
||||
produces = ["application/json"],
|
||||
consumes = ["multipart/form-data"]
|
||||
)
|
||||
fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?,serverHttpRequest: ServerHttpRequest): ResponseEntity<ModelApiResponse> {
|
||||
return getDelegate().uploadFile(petId, additionalMetadata, file, serverHttpRequest)
|
||||
fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity<ModelApiResponse> {
|
||||
return getDelegate().uploadFile(petId, additionalMetadata, file)
|
||||
}
|
||||
}
|
||||
|
@ -23,8 +23,7 @@ interface PetApiDelegate {
|
||||
/**
|
||||
* @see PetApi#addPet
|
||||
*/
|
||||
fun addPet(pet: Pet,
|
||||
serverHttpRequest: ServerHttpRequest): ResponseEntity<Pet> {
|
||||
fun addPet(pet: Pet): ResponseEntity<Pet> {
|
||||
getRequest().ifPresent { request ->
|
||||
for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
||||
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
||||
@ -46,8 +45,7 @@ interface PetApiDelegate {
|
||||
* @see PetApi#deletePet
|
||||
*/
|
||||
fun deletePet(petId: kotlin.Long,
|
||||
apiKey: kotlin.String?,
|
||||
serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
apiKey: kotlin.String?): ResponseEntity<Unit> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
|
||||
}
|
||||
@ -56,8 +54,7 @@ interface PetApiDelegate {
|
||||
/**
|
||||
* @see PetApi#findPetsByStatus
|
||||
*/
|
||||
fun findPetsByStatus(status: kotlin.collections.List<kotlin.String>,
|
||||
serverHttpRequest: ServerHttpRequest): ResponseEntity<List<Pet>> {
|
||||
fun findPetsByStatus(status: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
getRequest().ifPresent { request ->
|
||||
for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
||||
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
||||
@ -78,8 +75,7 @@ interface PetApiDelegate {
|
||||
/**
|
||||
* @see PetApi#findPetsByTags
|
||||
*/
|
||||
fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>,
|
||||
serverHttpRequest: ServerHttpRequest): ResponseEntity<List<Pet>> {
|
||||
fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
getRequest().ifPresent { request ->
|
||||
for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
||||
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
||||
@ -100,8 +96,7 @@ interface PetApiDelegate {
|
||||
/**
|
||||
* @see PetApi#getPetById
|
||||
*/
|
||||
fun getPetById(petId: kotlin.Long,
|
||||
serverHttpRequest: ServerHttpRequest): ResponseEntity<Pet> {
|
||||
fun getPetById(petId: kotlin.Long): ResponseEntity<Pet> {
|
||||
getRequest().ifPresent { request ->
|
||||
for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
||||
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
||||
@ -122,8 +117,7 @@ interface PetApiDelegate {
|
||||
/**
|
||||
* @see PetApi#updatePet
|
||||
*/
|
||||
fun updatePet(pet: Pet,
|
||||
serverHttpRequest: ServerHttpRequest): ResponseEntity<Pet> {
|
||||
fun updatePet(pet: Pet): ResponseEntity<Pet> {
|
||||
getRequest().ifPresent { request ->
|
||||
for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
||||
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
||||
@ -146,8 +140,7 @@ interface PetApiDelegate {
|
||||
*/
|
||||
fun updatePetWithForm(petId: kotlin.Long,
|
||||
name: kotlin.String?,
|
||||
status: kotlin.String?,
|
||||
serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
status: kotlin.String?): ResponseEntity<Unit> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
|
||||
}
|
||||
@ -158,8 +151,7 @@ interface PetApiDelegate {
|
||||
*/
|
||||
fun uploadFile(petId: kotlin.Long,
|
||||
additionalMetadata: kotlin.String?,
|
||||
file: Resource?,
|
||||
serverHttpRequest: ServerHttpRequest): ResponseEntity<ModelApiResponse> {
|
||||
file: Resource?): ResponseEntity<ModelApiResponse> {
|
||||
getRequest().ifPresent { request ->
|
||||
for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
||||
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
||||
|
@ -14,7 +14,6 @@ import io.swagger.v3.oas.annotations.security.*
|
||||
import org.springframework.http.HttpStatus
|
||||
import org.springframework.http.MediaType
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.http.server.reactive.ServerHttpRequest
|
||||
|
||||
import org.springframework.web.bind.annotation.*
|
||||
import org.springframework.validation.annotation.Validated
|
||||
@ -54,8 +53,8 @@ interface StoreApi {
|
||||
method = [RequestMethod.DELETE],
|
||||
value = ["/store/order/{orderId}"]
|
||||
)
|
||||
fun deleteOrder(@Parameter(description = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") orderId: kotlin.String,serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
return getDelegate().deleteOrder(orderId, serverHttpRequest)
|
||||
fun deleteOrder(@Parameter(description = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") orderId: kotlin.String): ResponseEntity<Unit> {
|
||||
return getDelegate().deleteOrder(orderId)
|
||||
}
|
||||
|
||||
@Operation(
|
||||
@ -73,8 +72,8 @@ interface StoreApi {
|
||||
value = ["/store/inventory"],
|
||||
produces = ["application/json"]
|
||||
)
|
||||
fun getInventory(serverHttpRequest: ServerHttpRequest): ResponseEntity<Map<String, kotlin.Int>> {
|
||||
return getDelegate().getInventory(serverHttpRequest)
|
||||
fun getInventory(): ResponseEntity<Map<String, kotlin.Int>> {
|
||||
return getDelegate().getInventory()
|
||||
}
|
||||
|
||||
@Operation(
|
||||
@ -93,8 +92,8 @@ interface StoreApi {
|
||||
value = ["/store/order/{orderId}"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun getOrderById(@Min(1L) @Max(5L) @Parameter(description = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") orderId: kotlin.Long,serverHttpRequest: ServerHttpRequest): ResponseEntity<Order> {
|
||||
return getDelegate().getOrderById(orderId, serverHttpRequest)
|
||||
fun getOrderById(@Min(1L) @Max(5L) @Parameter(description = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") orderId: kotlin.Long): ResponseEntity<Order> {
|
||||
return getDelegate().getOrderById(orderId)
|
||||
}
|
||||
|
||||
@Operation(
|
||||
@ -113,7 +112,7 @@ interface StoreApi {
|
||||
produces = ["application/xml", "application/json"],
|
||||
consumes = ["application/json"]
|
||||
)
|
||||
fun placeOrder(@Parameter(description = "order placed for purchasing the pet", required = true) @Valid @RequestBody order: Order,serverHttpRequest: ServerHttpRequest): ResponseEntity<Order> {
|
||||
return getDelegate().placeOrder(order, serverHttpRequest)
|
||||
fun placeOrder(@Parameter(description = "order placed for purchasing the pet", required = true) @Valid @RequestBody order: Order): ResponseEntity<Order> {
|
||||
return getDelegate().placeOrder(order)
|
||||
}
|
||||
}
|
||||
|
@ -22,8 +22,7 @@ interface StoreApiDelegate {
|
||||
/**
|
||||
* @see StoreApi#deleteOrder
|
||||
*/
|
||||
fun deleteOrder(orderId: kotlin.String,
|
||||
serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
fun deleteOrder(orderId: kotlin.String): ResponseEntity<Unit> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
|
||||
}
|
||||
@ -32,7 +31,7 @@ interface StoreApiDelegate {
|
||||
/**
|
||||
* @see StoreApi#getInventory
|
||||
*/
|
||||
fun getInventory(serverHttpRequest: ServerHttpRequest): ResponseEntity<Map<String, kotlin.Int>> {
|
||||
fun getInventory(): ResponseEntity<Map<String, kotlin.Int>> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
|
||||
}
|
||||
@ -41,8 +40,7 @@ interface StoreApiDelegate {
|
||||
/**
|
||||
* @see StoreApi#getOrderById
|
||||
*/
|
||||
fun getOrderById(orderId: kotlin.Long,
|
||||
serverHttpRequest: ServerHttpRequest): ResponseEntity<Order> {
|
||||
fun getOrderById(orderId: kotlin.Long): ResponseEntity<Order> {
|
||||
getRequest().ifPresent { request ->
|
||||
for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
||||
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
||||
@ -63,8 +61,7 @@ interface StoreApiDelegate {
|
||||
/**
|
||||
* @see StoreApi#placeOrder
|
||||
*/
|
||||
fun placeOrder(order: Order,
|
||||
serverHttpRequest: ServerHttpRequest): ResponseEntity<Order> {
|
||||
fun placeOrder(order: Order): ResponseEntity<Order> {
|
||||
getRequest().ifPresent { request ->
|
||||
for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
||||
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
||||
|
@ -14,7 +14,6 @@ import io.swagger.v3.oas.annotations.security.*
|
||||
import org.springframework.http.HttpStatus
|
||||
import org.springframework.http.MediaType
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.http.server.reactive.ServerHttpRequest
|
||||
|
||||
import org.springframework.web.bind.annotation.*
|
||||
import org.springframework.validation.annotation.Validated
|
||||
@ -55,8 +54,8 @@ interface UserApi {
|
||||
value = ["/user"],
|
||||
consumes = ["application/json"]
|
||||
)
|
||||
fun createUser(@Parameter(description = "Created user object", required = true) @Valid @RequestBody user: User,serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
return getDelegate().createUser(user, serverHttpRequest)
|
||||
fun createUser(@Parameter(description = "Created user object", required = true) @Valid @RequestBody user: User): ResponseEntity<Unit> {
|
||||
return getDelegate().createUser(user)
|
||||
}
|
||||
|
||||
@Operation(
|
||||
@ -74,8 +73,8 @@ interface UserApi {
|
||||
value = ["/user/createWithArray"],
|
||||
consumes = ["application/json"]
|
||||
)
|
||||
fun createUsersWithArrayInput(@Parameter(description = "List of user object", required = true) @Valid @RequestBody user: kotlin.collections.List<User>,serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
return getDelegate().createUsersWithArrayInput(user, serverHttpRequest)
|
||||
fun createUsersWithArrayInput(@Parameter(description = "List of user object", required = true) @Valid @RequestBody user: kotlin.collections.List<User>): ResponseEntity<Unit> {
|
||||
return getDelegate().createUsersWithArrayInput(user)
|
||||
}
|
||||
|
||||
@Operation(
|
||||
@ -93,8 +92,8 @@ interface UserApi {
|
||||
value = ["/user/createWithList"],
|
||||
consumes = ["application/json"]
|
||||
)
|
||||
fun createUsersWithListInput(@Parameter(description = "List of user object", required = true) @Valid @RequestBody user: kotlin.collections.List<User>,serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
return getDelegate().createUsersWithListInput(user, serverHttpRequest)
|
||||
fun createUsersWithListInput(@Parameter(description = "List of user object", required = true) @Valid @RequestBody user: kotlin.collections.List<User>): ResponseEntity<Unit> {
|
||||
return getDelegate().createUsersWithListInput(user)
|
||||
}
|
||||
|
||||
@Operation(
|
||||
@ -112,8 +111,8 @@ interface UserApi {
|
||||
method = [RequestMethod.DELETE],
|
||||
value = ["/user/{username}"]
|
||||
)
|
||||
fun deleteUser(@Parameter(description = "The name that needs to be deleted", required = true) @PathVariable("username") username: kotlin.String,serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
return getDelegate().deleteUser(username, serverHttpRequest)
|
||||
fun deleteUser(@Parameter(description = "The name that needs to be deleted", required = true) @PathVariable("username") username: kotlin.String): ResponseEntity<Unit> {
|
||||
return getDelegate().deleteUser(username)
|
||||
}
|
||||
|
||||
@Operation(
|
||||
@ -132,8 +131,8 @@ interface UserApi {
|
||||
value = ["/user/{username}"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun getUserByName(@Parameter(description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") username: kotlin.String,serverHttpRequest: ServerHttpRequest): ResponseEntity<User> {
|
||||
return getDelegate().getUserByName(username, serverHttpRequest)
|
||||
fun getUserByName(@Parameter(description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") username: kotlin.String): ResponseEntity<User> {
|
||||
return getDelegate().getUserByName(username)
|
||||
}
|
||||
|
||||
@Operation(
|
||||
@ -151,8 +150,8 @@ interface UserApi {
|
||||
value = ["/user/login"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun loginUser(@NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: kotlin.String,@NotNull @Parameter(description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: kotlin.String,serverHttpRequest: ServerHttpRequest): ResponseEntity<kotlin.String> {
|
||||
return getDelegate().loginUser(username, password, serverHttpRequest)
|
||||
fun loginUser(@NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: kotlin.String,@NotNull @Parameter(description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity<kotlin.String> {
|
||||
return getDelegate().loginUser(username, password)
|
||||
}
|
||||
|
||||
@Operation(
|
||||
@ -169,8 +168,8 @@ interface UserApi {
|
||||
method = [RequestMethod.GET],
|
||||
value = ["/user/logout"]
|
||||
)
|
||||
fun logoutUser(serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
return getDelegate().logoutUser(serverHttpRequest)
|
||||
fun logoutUser(): ResponseEntity<Unit> {
|
||||
return getDelegate().logoutUser()
|
||||
}
|
||||
|
||||
@Operation(
|
||||
@ -189,7 +188,7 @@ interface UserApi {
|
||||
value = ["/user/{username}"],
|
||||
consumes = ["application/json"]
|
||||
)
|
||||
fun updateUser(@Parameter(description = "name that need to be deleted", required = true) @PathVariable("username") username: kotlin.String,@Parameter(description = "Updated user object", required = true) @Valid @RequestBody user: User,serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
return getDelegate().updateUser(username, user, serverHttpRequest)
|
||||
fun updateUser(@Parameter(description = "name that need to be deleted", required = true) @PathVariable("username") username: kotlin.String,@Parameter(description = "Updated user object", required = true) @Valid @RequestBody user: User): ResponseEntity<Unit> {
|
||||
return getDelegate().updateUser(username, user)
|
||||
}
|
||||
}
|
||||
|
@ -22,8 +22,7 @@ interface UserApiDelegate {
|
||||
/**
|
||||
* @see UserApi#createUser
|
||||
*/
|
||||
fun createUser(user: User,
|
||||
serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
fun createUser(user: User): ResponseEntity<Unit> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
|
||||
}
|
||||
@ -32,8 +31,7 @@ interface UserApiDelegate {
|
||||
/**
|
||||
* @see UserApi#createUsersWithArrayInput
|
||||
*/
|
||||
fun createUsersWithArrayInput(user: kotlin.collections.List<User>,
|
||||
serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
fun createUsersWithArrayInput(user: kotlin.collections.List<User>): ResponseEntity<Unit> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
|
||||
}
|
||||
@ -42,8 +40,7 @@ interface UserApiDelegate {
|
||||
/**
|
||||
* @see UserApi#createUsersWithListInput
|
||||
*/
|
||||
fun createUsersWithListInput(user: kotlin.collections.List<User>,
|
||||
serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
fun createUsersWithListInput(user: kotlin.collections.List<User>): ResponseEntity<Unit> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
|
||||
}
|
||||
@ -52,8 +49,7 @@ interface UserApiDelegate {
|
||||
/**
|
||||
* @see UserApi#deleteUser
|
||||
*/
|
||||
fun deleteUser(username: kotlin.String,
|
||||
serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
fun deleteUser(username: kotlin.String): ResponseEntity<Unit> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
|
||||
}
|
||||
@ -62,8 +58,7 @@ interface UserApiDelegate {
|
||||
/**
|
||||
* @see UserApi#getUserByName
|
||||
*/
|
||||
fun getUserByName(username: kotlin.String,
|
||||
serverHttpRequest: ServerHttpRequest): ResponseEntity<User> {
|
||||
fun getUserByName(username: kotlin.String): ResponseEntity<User> {
|
||||
getRequest().ifPresent { request ->
|
||||
for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
||||
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
||||
@ -85,8 +80,7 @@ interface UserApiDelegate {
|
||||
* @see UserApi#loginUser
|
||||
*/
|
||||
fun loginUser(username: kotlin.String,
|
||||
password: kotlin.String,
|
||||
serverHttpRequest: ServerHttpRequest): ResponseEntity<kotlin.String> {
|
||||
password: kotlin.String): ResponseEntity<kotlin.String> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
|
||||
}
|
||||
@ -95,7 +89,7 @@ interface UserApiDelegate {
|
||||
/**
|
||||
* @see UserApi#logoutUser
|
||||
*/
|
||||
fun logoutUser(serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
fun logoutUser(): ResponseEntity<Unit> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
|
||||
}
|
||||
@ -105,8 +99,7 @@ interface UserApiDelegate {
|
||||
* @see UserApi#updateUser
|
||||
*/
|
||||
fun updateUser(username: kotlin.String,
|
||||
user: User,
|
||||
serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
user: User): ResponseEntity<Unit> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
|
||||
}
|
||||
|
@ -14,7 +14,6 @@ import io.swagger.v3.oas.annotations.security.*
|
||||
import org.springframework.http.HttpStatus
|
||||
import org.springframework.http.MediaType
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.http.server.reactive.ServerHttpRequest
|
||||
|
||||
import org.springframework.web.bind.annotation.*
|
||||
import org.springframework.validation.annotation.Validated
|
||||
@ -52,7 +51,7 @@ interface FakeApi {
|
||||
value = ["/fake/cookie-suggestion"],
|
||||
produces = ["application/json"]
|
||||
)
|
||||
fun fakeCookieSuggestion(@NotNull @CookieValue(name = "category.history") categoryHistory: kotlin.String,serverHttpRequest: ServerHttpRequest): ResponseEntity<List<Pet>> {
|
||||
fun fakeCookieSuggestion(@NotNull @CookieValue(name = "category.history") categoryHistory: kotlin.String): ResponseEntity<List<Pet>> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,6 @@ import io.swagger.v3.oas.annotations.security.*
|
||||
import org.springframework.http.HttpStatus
|
||||
import org.springframework.http.MediaType
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.http.server.reactive.ServerHttpRequest
|
||||
|
||||
import org.springframework.web.bind.annotation.*
|
||||
import org.springframework.validation.annotation.Validated
|
||||
@ -54,7 +53,7 @@ interface FakeClassnameTestApi {
|
||||
produces = ["application/json"],
|
||||
consumes = ["application/json"]
|
||||
)
|
||||
fun testClassname(@Parameter(description = "client model", required = true) @Valid @RequestBody client: Client,serverHttpRequest: ServerHttpRequest): ResponseEntity<Client> {
|
||||
fun testClassname(@Parameter(description = "client model", required = true) @Valid @RequestBody client: Client): ResponseEntity<Client> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,6 @@ import io.swagger.v3.oas.annotations.security.*
|
||||
import org.springframework.http.HttpStatus
|
||||
import org.springframework.http.MediaType
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.http.server.reactive.ServerHttpRequest
|
||||
|
||||
import org.springframework.web.bind.annotation.*
|
||||
import org.springframework.validation.annotation.Validated
|
||||
@ -52,7 +51,7 @@ interface FooApi {
|
||||
value = ["/foo"],
|
||||
produces = ["application/json"]
|
||||
)
|
||||
fun fooGet(serverHttpRequest: ServerHttpRequest): ResponseEntity<FooGetDefaultResponse> {
|
||||
fun fooGet(): ResponseEntity<FooGetDefaultResponse> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,6 @@ import io.swagger.v3.oas.annotations.security.*
|
||||
import org.springframework.http.HttpStatus
|
||||
import org.springframework.http.MediaType
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.http.server.reactive.ServerHttpRequest
|
||||
|
||||
import org.springframework.web.bind.annotation.*
|
||||
import org.springframework.validation.annotation.Validated
|
||||
@ -55,7 +54,7 @@ interface PetApi {
|
||||
value = ["/pet"],
|
||||
consumes = ["application/json", "application/xml"]
|
||||
)
|
||||
fun addPet(@Parameter(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody pet: Pet,serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
fun addPet(@Parameter(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody pet: Pet): ResponseEntity<Unit> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@ -74,7 +73,7 @@ interface PetApi {
|
||||
method = [RequestMethod.DELETE],
|
||||
value = ["/pet/{petId}"]
|
||||
)
|
||||
fun deletePet(@Parameter(description = "Pet id to delete", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "", `in` = ParameterIn.HEADER) @RequestHeader(value = "api_key", required = false) apiKey: kotlin.String?,serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
fun deletePet(@Parameter(description = "Pet id to delete", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "", `in` = ParameterIn.HEADER) @RequestHeader(value = "api_key", required = false) apiKey: kotlin.String?): ResponseEntity<Unit> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@ -94,7 +93,7 @@ interface PetApi {
|
||||
value = ["/pet/findByStatus"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun findPetsByStatus(@NotNull @Parameter(description = "Status values that need to be considered for filter", required = true, schema = Schema(allowableValues = ["available", "pending", "sold"])) @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>,serverHttpRequest: ServerHttpRequest): ResponseEntity<List<Pet>> {
|
||||
fun findPetsByStatus(@NotNull @Parameter(description = "Status values that need to be considered for filter", required = true, schema = Schema(allowableValues = ["available", "pending", "sold"])) @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@ -114,7 +113,7 @@ interface PetApi {
|
||||
value = ["/pet/findByTags"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun findPetsByTags(@NotNull @Parameter(description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>,serverHttpRequest: ServerHttpRequest): ResponseEntity<List<Pet>> {
|
||||
fun findPetsByTags(@NotNull @Parameter(description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@ -135,7 +134,7 @@ interface PetApi {
|
||||
value = ["/pet/{petId}"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun getPetById(@Parameter(description = "ID of pet to return", required = true) @PathVariable("petId") petId: kotlin.Long,serverHttpRequest: ServerHttpRequest): ResponseEntity<Pet> {
|
||||
fun getPetById(@Parameter(description = "ID of pet to return", required = true) @PathVariable("petId") petId: kotlin.Long): ResponseEntity<Pet> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@ -157,7 +156,7 @@ interface PetApi {
|
||||
value = ["/pet"],
|
||||
consumes = ["application/json", "application/xml"]
|
||||
)
|
||||
fun updatePet(@Parameter(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody pet: Pet,serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
fun updatePet(@Parameter(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody pet: Pet): ResponseEntity<Unit> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@ -177,7 +176,7 @@ interface PetApi {
|
||||
value = ["/pet/{petId}"],
|
||||
consumes = ["application/x-www-form-urlencoded"]
|
||||
)
|
||||
fun updatePetWithForm(@Parameter(description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Updated name of the pet") @RequestParam(value = "name", required = false) name: kotlin.String? ,@Parameter(description = "Updated status of the pet") @RequestParam(value = "status", required = false) status: kotlin.String? ,serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
fun updatePetWithForm(@Parameter(description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Updated name of the pet") @RequestParam(value = "name", required = false) name: kotlin.String? ,@Parameter(description = "Updated status of the pet") @RequestParam(value = "status", required = false) status: kotlin.String? ): ResponseEntity<Unit> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@ -197,7 +196,7 @@ interface PetApi {
|
||||
produces = ["application/json"],
|
||||
consumes = ["multipart/form-data"]
|
||||
)
|
||||
fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?,serverHttpRequest: ServerHttpRequest): ResponseEntity<ModelApiResponse> {
|
||||
fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity<ModelApiResponse> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,6 @@ import io.swagger.v3.oas.annotations.security.*
|
||||
import org.springframework.http.HttpStatus
|
||||
import org.springframework.http.MediaType
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.http.server.reactive.ServerHttpRequest
|
||||
|
||||
import org.springframework.web.bind.annotation.*
|
||||
import org.springframework.validation.annotation.Validated
|
||||
@ -52,7 +51,7 @@ interface StoreApi {
|
||||
method = [RequestMethod.DELETE],
|
||||
value = ["/store/order/{order_id}"]
|
||||
)
|
||||
fun deleteOrder(@Parameter(description = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") orderId: kotlin.String,serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
fun deleteOrder(@Parameter(description = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") orderId: kotlin.String): ResponseEntity<Unit> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@ -71,7 +70,7 @@ interface StoreApi {
|
||||
value = ["/store/inventory"],
|
||||
produces = ["application/json"]
|
||||
)
|
||||
fun getInventory(serverHttpRequest: ServerHttpRequest): ResponseEntity<Map<String, kotlin.Int>> {
|
||||
fun getInventory(): ResponseEntity<Map<String, kotlin.Int>> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@ -91,7 +90,7 @@ interface StoreApi {
|
||||
value = ["/store/order/{order_id}"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun getOrderById(@Min(1L) @Max(5L) @Parameter(description = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") orderId: kotlin.Long,serverHttpRequest: ServerHttpRequest): ResponseEntity<Order> {
|
||||
fun getOrderById(@Min(1L) @Max(5L) @Parameter(description = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") orderId: kotlin.Long): ResponseEntity<Order> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@ -111,7 +110,7 @@ interface StoreApi {
|
||||
produces = ["application/xml", "application/json"],
|
||||
consumes = ["application/json"]
|
||||
)
|
||||
fun placeOrder(@Parameter(description = "order placed for purchasing the pet", required = true) @Valid @RequestBody order: Order,serverHttpRequest: ServerHttpRequest): ResponseEntity<Order> {
|
||||
fun placeOrder(@Parameter(description = "order placed for purchasing the pet", required = true) @Valid @RequestBody order: Order): ResponseEntity<Order> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,6 @@ import io.swagger.v3.oas.annotations.security.*
|
||||
import org.springframework.http.HttpStatus
|
||||
import org.springframework.http.MediaType
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.http.server.reactive.ServerHttpRequest
|
||||
|
||||
import org.springframework.web.bind.annotation.*
|
||||
import org.springframework.validation.annotation.Validated
|
||||
@ -52,7 +51,7 @@ interface UserApi {
|
||||
value = ["/user"],
|
||||
consumes = ["application/json"]
|
||||
)
|
||||
fun createUser(@Parameter(description = "Created user object", required = true) @Valid @RequestBody user: User,serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
fun createUser(@Parameter(description = "Created user object", required = true) @Valid @RequestBody user: User): ResponseEntity<Unit> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@ -70,7 +69,7 @@ interface UserApi {
|
||||
value = ["/user/createWithArray"],
|
||||
consumes = ["application/json"]
|
||||
)
|
||||
fun createUsersWithArrayInput(@Parameter(description = "List of user object", required = true) @Valid @RequestBody user: kotlin.collections.List<User>,serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
fun createUsersWithArrayInput(@Parameter(description = "List of user object", required = true) @Valid @RequestBody user: kotlin.collections.List<User>): ResponseEntity<Unit> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@ -88,7 +87,7 @@ interface UserApi {
|
||||
value = ["/user/createWithList"],
|
||||
consumes = ["application/json"]
|
||||
)
|
||||
fun createUsersWithListInput(@Parameter(description = "List of user object", required = true) @Valid @RequestBody user: kotlin.collections.List<User>,serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
fun createUsersWithListInput(@Parameter(description = "List of user object", required = true) @Valid @RequestBody user: kotlin.collections.List<User>): ResponseEntity<Unit> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@ -106,7 +105,7 @@ interface UserApi {
|
||||
method = [RequestMethod.DELETE],
|
||||
value = ["/user/{username}"]
|
||||
)
|
||||
fun deleteUser(@Parameter(description = "The name that needs to be deleted", required = true) @PathVariable("username") username: kotlin.String,serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
fun deleteUser(@Parameter(description = "The name that needs to be deleted", required = true) @PathVariable("username") username: kotlin.String): ResponseEntity<Unit> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@ -126,7 +125,7 @@ interface UserApi {
|
||||
value = ["/user/{username}"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun getUserByName(@Parameter(description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") username: kotlin.String,serverHttpRequest: ServerHttpRequest): ResponseEntity<User> {
|
||||
fun getUserByName(@Parameter(description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") username: kotlin.String): ResponseEntity<User> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@ -145,7 +144,7 @@ interface UserApi {
|
||||
value = ["/user/login"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun loginUser(@NotNull @Parameter(description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: kotlin.String,@NotNull @Parameter(description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: kotlin.String,serverHttpRequest: ServerHttpRequest): ResponseEntity<kotlin.String> {
|
||||
fun loginUser(@NotNull @Parameter(description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: kotlin.String,@NotNull @Parameter(description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity<kotlin.String> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@ -162,7 +161,7 @@ interface UserApi {
|
||||
method = [RequestMethod.GET],
|
||||
value = ["/user/logout"]
|
||||
)
|
||||
fun logoutUser(serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
fun logoutUser(): ResponseEntity<Unit> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@ -181,7 +180,7 @@ interface UserApi {
|
||||
value = ["/user/{username}"],
|
||||
consumes = ["application/json"]
|
||||
)
|
||||
fun updateUser(@Parameter(description = "name that need to be deleted", required = true) @PathVariable("username") username: kotlin.String,@Parameter(description = "Updated user object", required = true) @Valid @RequestBody user: User,serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
fun updateUser(@Parameter(description = "name that need to be deleted", required = true) @PathVariable("username") username: kotlin.String,@Parameter(description = "Updated user object", required = true) @Valid @RequestBody user: User): ResponseEntity<Unit> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
}
|
||||
|
@ -1,23 +0,0 @@
|
||||
# OpenAPI Generator Ignore
|
||||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
||||
|
||||
# Use this file to prevent files from being overwritten by the generator.
|
||||
# The patterns follow closely to .gitignore or .dockerignore.
|
||||
|
||||
# As an example, the C# client generator defines ApiClient.cs.
|
||||
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
||||
#ApiClient.cs
|
||||
|
||||
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
||||
#foo/*/qux
|
||||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
||||
|
||||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
||||
#foo/**/qux
|
||||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
||||
|
||||
# You can also negate patterns with an exclamation (!).
|
||||
# For example, you can ignore all files in a docs folder with the file extension .md:
|
||||
#docs/*.md
|
||||
# Then explicitly reverse the ignore rule for a single file:
|
||||
#!docs/README.md
|
@ -1,16 +0,0 @@
|
||||
README.md
|
||||
build.gradle.kts
|
||||
pom.xml
|
||||
settings.gradle
|
||||
src/main/kotlin/org/openapitools/SpringDocConfiguration.kt
|
||||
src/main/kotlin/org/openapitools/api/ApiUtil.kt
|
||||
src/main/kotlin/org/openapitools/api/Exceptions.kt
|
||||
src/main/kotlin/org/openapitools/api/PetApi.kt
|
||||
src/main/kotlin/org/openapitools/api/StoreApi.kt
|
||||
src/main/kotlin/org/openapitools/api/UserApi.kt
|
||||
src/main/kotlin/org/openapitools/model/Category.kt
|
||||
src/main/kotlin/org/openapitools/model/ModelApiResponse.kt
|
||||
src/main/kotlin/org/openapitools/model/Order.kt
|
||||
src/main/kotlin/org/openapitools/model/Pet.kt
|
||||
src/main/kotlin/org/openapitools/model/Tag.kt
|
||||
src/main/kotlin/org/openapitools/model/User.kt
|
@ -1 +0,0 @@
|
||||
7.9.0-SNAPSHOT
|
@ -1,21 +0,0 @@
|
||||
# openAPIPetstore
|
||||
|
||||
This Kotlin based [Spring Boot](https://spring.io/projects/spring-boot) application has been generated using the [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator).
|
||||
|
||||
## Getting Started
|
||||
|
||||
This document assumes you have either maven or gradle available, either via the wrapper or otherwise. This does not come with a gradle / maven wrapper checked in.
|
||||
|
||||
By default a [`pom.xml`](pom.xml) file will be generated. If you specified `gradleBuildFile=true` when generating this project, a `build.gradle.kts` will also be generated. Note this uses [Gradle Kotlin DSL](https://github.com/gradle/kotlin-dsl).
|
||||
|
||||
To build the project using maven, run:
|
||||
```bash
|
||||
mvn package && java -jar target/openapi-spring-1.0.0.jar
|
||||
```
|
||||
|
||||
To build the project using gradle, run:
|
||||
```bash
|
||||
gradle build && java -jar build/libs/openapi-spring-1.0.0.jar
|
||||
```
|
||||
|
||||
If all builds successfully, the server should run on [http://localhost:8080/](http://localhost:8080/)
|
@ -1,47 +0,0 @@
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
group = "org.openapitools"
|
||||
version = "1.0.0"
|
||||
java.sourceCompatibility = JavaVersion.VERSION_17
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven { url = uri("https://repo.spring.io/milestone") }
|
||||
}
|
||||
|
||||
tasks.withType<KotlinCompile> {
|
||||
kotlinOptions.jvmTarget = "17"
|
||||
}
|
||||
|
||||
tasks.bootJar {
|
||||
enabled = false
|
||||
}
|
||||
|
||||
plugins {
|
||||
val kotlinVersion = "1.7.10"
|
||||
id("org.jetbrains.kotlin.jvm") version kotlinVersion
|
||||
id("org.jetbrains.kotlin.plugin.jpa") version kotlinVersion
|
||||
id("org.jetbrains.kotlin.plugin.spring") version kotlinVersion
|
||||
id("org.springframework.boot") version "3.0.2"
|
||||
id("io.spring.dependency-management") version "1.0.14.RELEASE"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
|
||||
implementation("org.jetbrains.kotlin:kotlin-reflect")
|
||||
implementation("org.springframework.boot:spring-boot-starter-web")
|
||||
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0")
|
||||
|
||||
implementation("com.google.code.findbugs:jsr305:3.0.2")
|
||||
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml")
|
||||
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-xml")
|
||||
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310")
|
||||
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
|
||||
implementation("jakarta.validation:jakarta.validation-api")
|
||||
implementation("jakarta.annotation:jakarta.annotation-api:2.1.0")
|
||||
|
||||
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
|
||||
testImplementation("org.springframework.boot:spring-boot-starter-test") {
|
||||
exclude(module = "junit")
|
||||
}
|
||||
}
|
@ -1,138 +0,0 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-spring</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>openapi-spring</name>
|
||||
<version>1.0.0</version>
|
||||
<properties>
|
||||
<springdoc-openapi.version>2.2.0</springdoc-openapi.version>
|
||||
<findbugs-jsr305.version>3.0.2</findbugs-jsr305.version>
|
||||
<jakarta-annotation.version>2.1.0</jakarta-annotation.version>
|
||||
<kotlin-test-junit5.version>1.7.10</kotlin-test-junit5.version>
|
||||
|
||||
<kotlin.version>1.7.10</kotlin.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.1.3</version>
|
||||
</parent>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>repository.spring.milestone</id>
|
||||
<name>Spring Milestone Repository</name>
|
||||
<url>https://repo.spring.io/milestone</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>spring-milestones</id>
|
||||
<url>https://repo.spring.io/milestone</url>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
<build>
|
||||
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
|
||||
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>kotlin-maven-plugin</artifactId>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<version>${kotlin.version}</version>
|
||||
<configuration>
|
||||
<compilerPlugins>
|
||||
<plugin>spring</plugin>
|
||||
</compilerPlugins>
|
||||
<jvmTarget>17</jvmTarget>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>compile</id>
|
||||
<phase>compile</phase>
|
||||
<goals>
|
||||
<goal>compile</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>test-compile</id>
|
||||
<phase>test-compile</phase>
|
||||
<goals>
|
||||
<goal>test-compile</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-maven-allopen</artifactId>
|
||||
<version>${kotlin.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-stdlib-jdk8</artifactId>
|
||||
<version>${kotlin.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-reflect</artifactId>
|
||||
<version>${kotlin.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--SpringDoc dependencies -->
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
||||
<version>${springdoc-openapi.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- @Nullable annotation -->
|
||||
<dependency>
|
||||
<groupId>com.google.code.findbugs</groupId>
|
||||
<artifactId>jsr305</artifactId>
|
||||
<version>${findbugs-jsr305.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.dataformat</groupId>
|
||||
<artifactId>jackson-dataformat-yaml</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.dataformat</groupId>
|
||||
<artifactId>jackson-dataformat-xml</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.module</groupId>
|
||||
<artifactId>jackson-module-kotlin</artifactId>
|
||||
</dependency>
|
||||
<!-- Bean Validation API support -->
|
||||
<dependency>
|
||||
<groupId>jakarta.validation</groupId>
|
||||
<artifactId>jakarta.validation-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.annotation</groupId>
|
||||
<artifactId>jakarta.annotation-api</artifactId>
|
||||
<version>${jakarta-annotation.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-test-junit5</artifactId>
|
||||
<version>${kotlin-test-junit5.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@ -1,15 +0,0 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
maven { url = uri("https://repo.spring.io/snapshot") }
|
||||
maven { url = uri("https://repo.spring.io/milestone") }
|
||||
gradlePluginPortal()
|
||||
}
|
||||
resolutionStrategy {
|
||||
eachPlugin {
|
||||
if (requested.id.id == "org.springframework.boot") {
|
||||
useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
rootProject.name = "openapi-spring"
|
@ -1,42 +0,0 @@
|
||||
package org.openapitools
|
||||
|
||||
import org.springframework.context.annotation.Bean
|
||||
import org.springframework.context.annotation.Configuration
|
||||
|
||||
import io.swagger.v3.oas.models.OpenAPI
|
||||
import io.swagger.v3.oas.models.info.Info
|
||||
import io.swagger.v3.oas.models.info.Contact
|
||||
import io.swagger.v3.oas.models.info.License
|
||||
import io.swagger.v3.oas.models.Components
|
||||
import io.swagger.v3.oas.models.security.SecurityScheme
|
||||
|
||||
@Configuration
|
||||
class SpringDocConfiguration {
|
||||
|
||||
@Bean
|
||||
fun apiInfo(): OpenAPI {
|
||||
return OpenAPI()
|
||||
.info(
|
||||
Info()
|
||||
.title("OpenAPI Petstore")
|
||||
.description("This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.")
|
||||
.license(
|
||||
License()
|
||||
.name("Apache-2.0")
|
||||
.url("https://www.apache.org/licenses/LICENSE-2.0.html")
|
||||
)
|
||||
.version("1.0.0")
|
||||
)
|
||||
.components(
|
||||
Components()
|
||||
.addSecuritySchemes("petstore_auth", SecurityScheme()
|
||||
.type(SecurityScheme.Type.OAUTH2)
|
||||
)
|
||||
.addSecuritySchemes("api_key", SecurityScheme()
|
||||
.type(SecurityScheme.Type.APIKEY)
|
||||
.`in`(SecurityScheme.In.HEADER)
|
||||
.name("api_key")
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
package org.openapitools.api
|
||||
|
||||
import org.springframework.web.context.request.NativeWebRequest
|
||||
|
||||
import jakarta.servlet.http.HttpServletResponse
|
||||
import java.io.IOException
|
||||
|
||||
object ApiUtil {
|
||||
fun setExampleResponse(req: NativeWebRequest, contentType: String, example: String) {
|
||||
try {
|
||||
val res = req.getNativeResponse(HttpServletResponse::class.java)
|
||||
res?.characterEncoding = "UTF-8"
|
||||
res?.addHeader("Content-Type", contentType)
|
||||
res?.writer?.print(example)
|
||||
} catch (e: IOException) {
|
||||
throw RuntimeException(e)
|
||||
}
|
||||
}
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
package org.openapitools.api
|
||||
|
||||
import org.springframework.http.HttpStatus
|
||||
import org.springframework.web.bind.annotation.ControllerAdvice
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler
|
||||
import jakarta.servlet.http.HttpServletResponse
|
||||
import jakarta.validation.ConstraintViolationException
|
||||
|
||||
// TODO Extend ApiException for custom exception handling, e.g. the below NotFound exception
|
||||
sealed class ApiException(msg: String, val code: Int) : Exception(msg)
|
||||
|
||||
class NotFoundException(msg: String, code: Int = HttpStatus.NOT_FOUND.value()) : ApiException(msg, code)
|
||||
|
||||
|
||||
@ControllerAdvice
|
||||
class DefaultExceptionHandler {
|
||||
|
||||
@ExceptionHandler(value = [ApiException::class])
|
||||
fun onApiException(ex: ApiException, response: HttpServletResponse): Unit =
|
||||
response.sendError(ex.code, ex.message)
|
||||
|
||||
@ExceptionHandler(value = [NotImplementedError::class])
|
||||
fun onNotImplemented(ex: NotImplementedError, response: HttpServletResponse): Unit =
|
||||
response.sendError(HttpStatus.NOT_IMPLEMENTED.value())
|
||||
|
||||
@ExceptionHandler(value = [ConstraintViolationException::class])
|
||||
fun onConstraintViolation(ex: ConstraintViolationException, response: HttpServletResponse): Unit =
|
||||
response.sendError(HttpStatus.BAD_REQUEST.value(), ex.constraintViolations.joinToString(", ") { it.message })
|
||||
}
|
@ -1,199 +0,0 @@
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.9.0-SNAPSHOT).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.api
|
||||
|
||||
import org.openapitools.model.ModelApiResponse
|
||||
import org.openapitools.model.Pet
|
||||
import io.swagger.v3.oas.annotations.*
|
||||
import io.swagger.v3.oas.annotations.enums.*
|
||||
import io.swagger.v3.oas.annotations.media.*
|
||||
import io.swagger.v3.oas.annotations.responses.*
|
||||
import io.swagger.v3.oas.annotations.security.*
|
||||
import org.springframework.http.HttpStatus
|
||||
import org.springframework.http.MediaType
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.http.server.reactive.ServerHttpRequest
|
||||
|
||||
import org.springframework.web.bind.annotation.*
|
||||
import org.springframework.validation.annotation.Validated
|
||||
import org.springframework.web.context.request.NativeWebRequest
|
||||
import org.springframework.beans.factory.annotation.Autowired
|
||||
|
||||
import jakarta.validation.constraints.DecimalMax
|
||||
import jakarta.validation.constraints.DecimalMin
|
||||
import jakarta.validation.constraints.Email
|
||||
import jakarta.validation.constraints.Max
|
||||
import jakarta.validation.constraints.Min
|
||||
import jakarta.validation.constraints.NotNull
|
||||
import jakarta.validation.constraints.Pattern
|
||||
import jakarta.validation.constraints.Size
|
||||
import jakarta.validation.Valid
|
||||
|
||||
import kotlin.collections.List
|
||||
import kotlin.collections.Map
|
||||
|
||||
@RestController
|
||||
@Validated
|
||||
interface PetApi {
|
||||
|
||||
@Operation(
|
||||
tags = ["pet",],
|
||||
summary = "Add a new pet to the store",
|
||||
operationId = "addPet",
|
||||
description = """""",
|
||||
responses = [
|
||||
ApiResponse(responseCode = "405", description = "Invalid input")
|
||||
],
|
||||
security = [ SecurityRequirement(name = "petstore_auth", scopes = [ "write:pets", "read:pets" ]) ]
|
||||
)
|
||||
@RequestMapping(
|
||||
method = [RequestMethod.POST],
|
||||
value = ["/pet"],
|
||||
consumes = ["application/json", "application/xml"]
|
||||
)
|
||||
fun addPet(@Parameter(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody body: Pet,serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@Operation(
|
||||
tags = ["pet",],
|
||||
summary = "Deletes a pet",
|
||||
operationId = "deletePet",
|
||||
description = """""",
|
||||
responses = [
|
||||
ApiResponse(responseCode = "400", description = "Invalid pet value")
|
||||
],
|
||||
security = [ SecurityRequirement(name = "petstore_auth", scopes = [ "write:pets", "read:pets" ]) ]
|
||||
)
|
||||
@RequestMapping(
|
||||
method = [RequestMethod.DELETE],
|
||||
value = ["/pet/{petId}"]
|
||||
)
|
||||
fun deletePet(@Parameter(description = "Pet id to delete", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "", `in` = ParameterIn.HEADER) @RequestHeader(value = "api_key", required = false) apiKey: kotlin.String?,serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@Operation(
|
||||
tags = ["pet",],
|
||||
summary = "Finds Pets by status",
|
||||
operationId = "findPetsByStatus",
|
||||
description = """Multiple status values can be provided with comma separated strings""",
|
||||
responses = [
|
||||
ApiResponse(responseCode = "200", description = "successful operation", content = [Content(array = ArraySchema(schema = Schema(implementation = Pet::class)))]),
|
||||
ApiResponse(responseCode = "400", description = "Invalid status value")
|
||||
],
|
||||
security = [ SecurityRequirement(name = "petstore_auth", scopes = [ "write:pets", "read:pets" ]) ]
|
||||
)
|
||||
@RequestMapping(
|
||||
method = [RequestMethod.GET],
|
||||
value = ["/pet/findByStatus"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun findPetsByStatus(@NotNull @Parameter(description = "Status values that need to be considered for filter", required = true, schema = Schema(allowableValues = ["available", "pending", "sold"])) @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>,serverHttpRequest: ServerHttpRequest): ResponseEntity<List<Pet>> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@Operation(
|
||||
tags = ["pet",],
|
||||
summary = "Finds Pets by tags",
|
||||
operationId = "findPetsByTags",
|
||||
description = """Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.""",
|
||||
responses = [
|
||||
ApiResponse(responseCode = "200", description = "successful operation", content = [Content(array = ArraySchema(schema = Schema(implementation = Pet::class)))]),
|
||||
ApiResponse(responseCode = "400", description = "Invalid tag value")
|
||||
],
|
||||
security = [ SecurityRequirement(name = "petstore_auth", scopes = [ "write:pets", "read:pets" ]) ]
|
||||
)
|
||||
@RequestMapping(
|
||||
method = [RequestMethod.GET],
|
||||
value = ["/pet/findByTags"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun findPetsByTags(@NotNull @Parameter(description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>,serverHttpRequest: ServerHttpRequest): ResponseEntity<List<Pet>> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@Operation(
|
||||
tags = ["pet",],
|
||||
summary = "Find pet by ID",
|
||||
operationId = "getPetById",
|
||||
description = """Returns a single pet""",
|
||||
responses = [
|
||||
ApiResponse(responseCode = "200", description = "successful operation", content = [Content(schema = Schema(implementation = Pet::class))]),
|
||||
ApiResponse(responseCode = "400", description = "Invalid ID supplied"),
|
||||
ApiResponse(responseCode = "404", description = "Pet not found")
|
||||
],
|
||||
security = [ SecurityRequirement(name = "api_key") ]
|
||||
)
|
||||
@RequestMapping(
|
||||
method = [RequestMethod.GET],
|
||||
value = ["/pet/{petId}"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun getPetById(@Parameter(description = "ID of pet to return", required = true) @PathVariable("petId") petId: kotlin.Long,serverHttpRequest: ServerHttpRequest): ResponseEntity<Pet> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@Operation(
|
||||
tags = ["pet",],
|
||||
summary = "Update an existing pet",
|
||||
operationId = "updatePet",
|
||||
description = """""",
|
||||
responses = [
|
||||
ApiResponse(responseCode = "400", description = "Invalid ID supplied"),
|
||||
ApiResponse(responseCode = "404", description = "Pet not found"),
|
||||
ApiResponse(responseCode = "405", description = "Validation exception")
|
||||
],
|
||||
security = [ SecurityRequirement(name = "petstore_auth", scopes = [ "write:pets", "read:pets" ]) ]
|
||||
)
|
||||
@RequestMapping(
|
||||
method = [RequestMethod.PUT],
|
||||
value = ["/pet"],
|
||||
consumes = ["application/json", "application/xml"]
|
||||
)
|
||||
fun updatePet(@Parameter(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody body: Pet,serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@Operation(
|
||||
tags = ["pet",],
|
||||
summary = "Updates a pet in the store with form data",
|
||||
operationId = "updatePetWithForm",
|
||||
description = """""",
|
||||
responses = [
|
||||
ApiResponse(responseCode = "405", description = "Invalid input")
|
||||
],
|
||||
security = [ SecurityRequirement(name = "petstore_auth", scopes = [ "write:pets", "read:pets" ]) ]
|
||||
)
|
||||
@RequestMapping(
|
||||
method = [RequestMethod.POST],
|
||||
value = ["/pet/{petId}"],
|
||||
consumes = ["application/x-www-form-urlencoded"]
|
||||
)
|
||||
fun updatePetWithForm(@Parameter(description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Updated name of the pet") @RequestParam(value = "name", required = false) name: kotlin.String? ,@Parameter(description = "Updated status of the pet") @RequestParam(value = "status", required = false) status: kotlin.String? ,serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@Operation(
|
||||
tags = ["pet",],
|
||||
summary = "uploads an image",
|
||||
operationId = "uploadFile",
|
||||
description = """""",
|
||||
responses = [
|
||||
ApiResponse(responseCode = "200", description = "successful operation", content = [Content(schema = Schema(implementation = ModelApiResponse::class))])
|
||||
],
|
||||
security = [ SecurityRequirement(name = "petstore_auth", scopes = [ "write:pets", "read:pets" ]) ]
|
||||
)
|
||||
@RequestMapping(
|
||||
method = [RequestMethod.POST],
|
||||
value = ["/pet/{petId}/uploadImage"],
|
||||
produces = ["application/json"],
|
||||
consumes = ["multipart/form-data"]
|
||||
)
|
||||
fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?,serverHttpRequest: ServerHttpRequest): ResponseEntity<ModelApiResponse> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
}
|
@ -1,116 +0,0 @@
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.9.0-SNAPSHOT).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.api
|
||||
|
||||
import org.openapitools.model.Order
|
||||
import io.swagger.v3.oas.annotations.*
|
||||
import io.swagger.v3.oas.annotations.enums.*
|
||||
import io.swagger.v3.oas.annotations.media.*
|
||||
import io.swagger.v3.oas.annotations.responses.*
|
||||
import io.swagger.v3.oas.annotations.security.*
|
||||
import org.springframework.http.HttpStatus
|
||||
import org.springframework.http.MediaType
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.http.server.reactive.ServerHttpRequest
|
||||
|
||||
import org.springframework.web.bind.annotation.*
|
||||
import org.springframework.validation.annotation.Validated
|
||||
import org.springframework.web.context.request.NativeWebRequest
|
||||
import org.springframework.beans.factory.annotation.Autowired
|
||||
|
||||
import jakarta.validation.constraints.DecimalMax
|
||||
import jakarta.validation.constraints.DecimalMin
|
||||
import jakarta.validation.constraints.Email
|
||||
import jakarta.validation.constraints.Max
|
||||
import jakarta.validation.constraints.Min
|
||||
import jakarta.validation.constraints.NotNull
|
||||
import jakarta.validation.constraints.Pattern
|
||||
import jakarta.validation.constraints.Size
|
||||
import jakarta.validation.Valid
|
||||
|
||||
import kotlin.collections.List
|
||||
import kotlin.collections.Map
|
||||
|
||||
@RestController
|
||||
@Validated
|
||||
interface StoreApi {
|
||||
|
||||
@Operation(
|
||||
tags = ["store",],
|
||||
summary = "Delete purchase order by ID",
|
||||
operationId = "deleteOrder",
|
||||
description = """For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors""",
|
||||
responses = [
|
||||
ApiResponse(responseCode = "400", description = "Invalid ID supplied"),
|
||||
ApiResponse(responseCode = "404", description = "Order not found")
|
||||
]
|
||||
)
|
||||
@RequestMapping(
|
||||
method = [RequestMethod.DELETE],
|
||||
value = ["/store/order/{orderId}"]
|
||||
)
|
||||
fun deleteOrder(@Parameter(description = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") orderId: kotlin.String,serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@Operation(
|
||||
tags = ["store",],
|
||||
summary = "Returns pet inventories by status",
|
||||
operationId = "getInventory",
|
||||
description = """Returns a map of status codes to quantities""",
|
||||
responses = [
|
||||
ApiResponse(responseCode = "200", description = "successful operation", content = [Content(schema = Schema(implementation = kotlin.collections.Map::class))])
|
||||
],
|
||||
security = [ SecurityRequirement(name = "api_key") ]
|
||||
)
|
||||
@RequestMapping(
|
||||
method = [RequestMethod.GET],
|
||||
value = ["/store/inventory"],
|
||||
produces = ["application/json"]
|
||||
)
|
||||
fun getInventory(serverHttpRequest: ServerHttpRequest): ResponseEntity<Map<String, kotlin.Int>> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@Operation(
|
||||
tags = ["store",],
|
||||
summary = "Find purchase order by ID",
|
||||
operationId = "getOrderById",
|
||||
description = """For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions""",
|
||||
responses = [
|
||||
ApiResponse(responseCode = "200", description = "successful operation", content = [Content(schema = Schema(implementation = Order::class))]),
|
||||
ApiResponse(responseCode = "400", description = "Invalid ID supplied"),
|
||||
ApiResponse(responseCode = "404", description = "Order not found")
|
||||
]
|
||||
)
|
||||
@RequestMapping(
|
||||
method = [RequestMethod.GET],
|
||||
value = ["/store/order/{orderId}"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun getOrderById(@Min(1L) @Max(5L) @Parameter(description = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") orderId: kotlin.Long,serverHttpRequest: ServerHttpRequest): ResponseEntity<Order> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@Operation(
|
||||
tags = ["store",],
|
||||
summary = "Place an order for a pet",
|
||||
operationId = "placeOrder",
|
||||
description = """""",
|
||||
responses = [
|
||||
ApiResponse(responseCode = "200", description = "successful operation", content = [Content(schema = Schema(implementation = Order::class))]),
|
||||
ApiResponse(responseCode = "400", description = "Invalid Order")
|
||||
]
|
||||
)
|
||||
@RequestMapping(
|
||||
method = [RequestMethod.POST],
|
||||
value = ["/store/order"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun placeOrder(@Parameter(description = "order placed for purchasing the pet", required = true) @Valid @RequestBody body: Order,serverHttpRequest: ServerHttpRequest): ResponseEntity<Order> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
}
|
@ -1,183 +0,0 @@
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.9.0-SNAPSHOT).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.api
|
||||
|
||||
import org.openapitools.model.User
|
||||
import io.swagger.v3.oas.annotations.*
|
||||
import io.swagger.v3.oas.annotations.enums.*
|
||||
import io.swagger.v3.oas.annotations.media.*
|
||||
import io.swagger.v3.oas.annotations.responses.*
|
||||
import io.swagger.v3.oas.annotations.security.*
|
||||
import org.springframework.http.HttpStatus
|
||||
import org.springframework.http.MediaType
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.http.server.reactive.ServerHttpRequest
|
||||
|
||||
import org.springframework.web.bind.annotation.*
|
||||
import org.springframework.validation.annotation.Validated
|
||||
import org.springframework.web.context.request.NativeWebRequest
|
||||
import org.springframework.beans.factory.annotation.Autowired
|
||||
|
||||
import jakarta.validation.constraints.DecimalMax
|
||||
import jakarta.validation.constraints.DecimalMin
|
||||
import jakarta.validation.constraints.Email
|
||||
import jakarta.validation.constraints.Max
|
||||
import jakarta.validation.constraints.Min
|
||||
import jakarta.validation.constraints.NotNull
|
||||
import jakarta.validation.constraints.Pattern
|
||||
import jakarta.validation.constraints.Size
|
||||
import jakarta.validation.Valid
|
||||
|
||||
import kotlin.collections.List
|
||||
import kotlin.collections.Map
|
||||
|
||||
@RestController
|
||||
@Validated
|
||||
interface UserApi {
|
||||
|
||||
@Operation(
|
||||
tags = ["user",],
|
||||
summary = "Create user",
|
||||
operationId = "createUser",
|
||||
description = """This can only be done by the logged in user.""",
|
||||
responses = [
|
||||
ApiResponse(responseCode = "200", description = "successful operation")
|
||||
]
|
||||
)
|
||||
@RequestMapping(
|
||||
method = [RequestMethod.POST],
|
||||
value = ["/user"]
|
||||
)
|
||||
fun createUser(@Parameter(description = "Created user object", required = true) @Valid @RequestBody body: User,serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@Operation(
|
||||
tags = ["user",],
|
||||
summary = "Creates list of users with given input array",
|
||||
operationId = "createUsersWithArrayInput",
|
||||
description = """""",
|
||||
responses = [
|
||||
ApiResponse(responseCode = "200", description = "successful operation")
|
||||
]
|
||||
)
|
||||
@RequestMapping(
|
||||
method = [RequestMethod.POST],
|
||||
value = ["/user/createWithArray"]
|
||||
)
|
||||
fun createUsersWithArrayInput(@Parameter(description = "List of user object", required = true) @Valid @RequestBody body: kotlin.collections.List<User>,serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@Operation(
|
||||
tags = ["user",],
|
||||
summary = "Creates list of users with given input array",
|
||||
operationId = "createUsersWithListInput",
|
||||
description = """""",
|
||||
responses = [
|
||||
ApiResponse(responseCode = "200", description = "successful operation")
|
||||
]
|
||||
)
|
||||
@RequestMapping(
|
||||
method = [RequestMethod.POST],
|
||||
value = ["/user/createWithList"]
|
||||
)
|
||||
fun createUsersWithListInput(@Parameter(description = "List of user object", required = true) @Valid @RequestBody body: kotlin.collections.List<User>,serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@Operation(
|
||||
tags = ["user",],
|
||||
summary = "Delete user",
|
||||
operationId = "deleteUser",
|
||||
description = """This can only be done by the logged in user.""",
|
||||
responses = [
|
||||
ApiResponse(responseCode = "400", description = "Invalid username supplied"),
|
||||
ApiResponse(responseCode = "404", description = "User not found")
|
||||
]
|
||||
)
|
||||
@RequestMapping(
|
||||
method = [RequestMethod.DELETE],
|
||||
value = ["/user/{username}"]
|
||||
)
|
||||
fun deleteUser(@Parameter(description = "The name that needs to be deleted", required = true) @PathVariable("username") username: kotlin.String,serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@Operation(
|
||||
tags = ["user",],
|
||||
summary = "Get user by user name",
|
||||
operationId = "getUserByName",
|
||||
description = """""",
|
||||
responses = [
|
||||
ApiResponse(responseCode = "200", description = "successful operation", content = [Content(schema = Schema(implementation = User::class))]),
|
||||
ApiResponse(responseCode = "400", description = "Invalid username supplied"),
|
||||
ApiResponse(responseCode = "404", description = "User not found")
|
||||
]
|
||||
)
|
||||
@RequestMapping(
|
||||
method = [RequestMethod.GET],
|
||||
value = ["/user/{username}"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun getUserByName(@Parameter(description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") username: kotlin.String,serverHttpRequest: ServerHttpRequest): ResponseEntity<User> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@Operation(
|
||||
tags = ["user",],
|
||||
summary = "Logs user into the system",
|
||||
operationId = "loginUser",
|
||||
description = """""",
|
||||
responses = [
|
||||
ApiResponse(responseCode = "200", description = "successful operation", content = [Content(schema = Schema(implementation = kotlin.String::class))]),
|
||||
ApiResponse(responseCode = "400", description = "Invalid username/password supplied")
|
||||
]
|
||||
)
|
||||
@RequestMapping(
|
||||
method = [RequestMethod.GET],
|
||||
value = ["/user/login"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun loginUser(@NotNull @Parameter(description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: kotlin.String,@NotNull @Parameter(description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: kotlin.String,serverHttpRequest: ServerHttpRequest): ResponseEntity<kotlin.String> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@Operation(
|
||||
tags = ["user",],
|
||||
summary = "Logs out current logged in user session",
|
||||
operationId = "logoutUser",
|
||||
description = """""",
|
||||
responses = [
|
||||
ApiResponse(responseCode = "200", description = "successful operation")
|
||||
]
|
||||
)
|
||||
@RequestMapping(
|
||||
method = [RequestMethod.GET],
|
||||
value = ["/user/logout"]
|
||||
)
|
||||
fun logoutUser(serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@Operation(
|
||||
tags = ["user",],
|
||||
summary = "Updated user",
|
||||
operationId = "updateUser",
|
||||
description = """This can only be done by the logged in user.""",
|
||||
responses = [
|
||||
ApiResponse(responseCode = "400", description = "Invalid user supplied"),
|
||||
ApiResponse(responseCode = "404", description = "User not found")
|
||||
]
|
||||
)
|
||||
@RequestMapping(
|
||||
method = [RequestMethod.PUT],
|
||||
value = ["/user/{username}"]
|
||||
)
|
||||
fun updateUser(@Parameter(description = "name that need to be deleted", required = true) @PathVariable("username") username: kotlin.String,@Parameter(description = "Updated user object", required = true) @Valid @RequestBody body: User,serverHttpRequest: ServerHttpRequest): ResponseEntity<Unit> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
package org.openapitools.model
|
||||
|
||||
import java.util.Objects
|
||||
import com.fasterxml.jackson.annotation.JsonProperty
|
||||
import jakarta.validation.constraints.DecimalMax
|
||||
import jakarta.validation.constraints.DecimalMin
|
||||
import jakarta.validation.constraints.Email
|
||||
import jakarta.validation.constraints.Max
|
||||
import jakarta.validation.constraints.Min
|
||||
import jakarta.validation.constraints.NotNull
|
||||
import jakarta.validation.constraints.Pattern
|
||||
import jakarta.validation.constraints.Size
|
||||
import jakarta.validation.Valid
|
||||
import io.swagger.v3.oas.annotations.media.Schema
|
||||
|
||||
/**
|
||||
* A category for a pet
|
||||
* @param id
|
||||
* @param name
|
||||
*/
|
||||
data class Category(
|
||||
|
||||
@Schema(example = "null", description = "")
|
||||
@get:JsonProperty("id") val id: kotlin.Long? = null,
|
||||
|
||||
@Schema(example = "null", description = "")
|
||||
@get:JsonProperty("name") val name: kotlin.String? = null
|
||||
) {
|
||||
|
||||
}
|
||||
|
@ -1,35 +0,0 @@
|
||||
package org.openapitools.model
|
||||
|
||||
import java.util.Objects
|
||||
import com.fasterxml.jackson.annotation.JsonProperty
|
||||
import jakarta.validation.constraints.DecimalMax
|
||||
import jakarta.validation.constraints.DecimalMin
|
||||
import jakarta.validation.constraints.Email
|
||||
import jakarta.validation.constraints.Max
|
||||
import jakarta.validation.constraints.Min
|
||||
import jakarta.validation.constraints.NotNull
|
||||
import jakarta.validation.constraints.Pattern
|
||||
import jakarta.validation.constraints.Size
|
||||
import jakarta.validation.Valid
|
||||
import io.swagger.v3.oas.annotations.media.Schema
|
||||
|
||||
/**
|
||||
* Describes the result of uploading an image resource
|
||||
* @param code
|
||||
* @param type
|
||||
* @param message
|
||||
*/
|
||||
data class ModelApiResponse(
|
||||
|
||||
@Schema(example = "null", description = "")
|
||||
@get:JsonProperty("code") val code: kotlin.Int? = null,
|
||||
|
||||
@Schema(example = "null", description = "")
|
||||
@get:JsonProperty("type") val type: kotlin.String? = null,
|
||||
|
||||
@Schema(example = "null", description = "")
|
||||
@get:JsonProperty("message") val message: kotlin.String? = null
|
||||
) {
|
||||
|
||||
}
|
||||
|
@ -1,68 +0,0 @@
|
||||
package org.openapitools.model
|
||||
|
||||
import java.util.Objects
|
||||
import com.fasterxml.jackson.annotation.JsonCreator
|
||||
import com.fasterxml.jackson.annotation.JsonProperty
|
||||
import com.fasterxml.jackson.annotation.JsonValue
|
||||
import jakarta.validation.constraints.DecimalMax
|
||||
import jakarta.validation.constraints.DecimalMin
|
||||
import jakarta.validation.constraints.Email
|
||||
import jakarta.validation.constraints.Max
|
||||
import jakarta.validation.constraints.Min
|
||||
import jakarta.validation.constraints.NotNull
|
||||
import jakarta.validation.constraints.Pattern
|
||||
import jakarta.validation.constraints.Size
|
||||
import jakarta.validation.Valid
|
||||
import io.swagger.v3.oas.annotations.media.Schema
|
||||
|
||||
/**
|
||||
* An order for a pets from the pet store
|
||||
* @param id
|
||||
* @param petId
|
||||
* @param quantity
|
||||
* @param shipDate
|
||||
* @param status Order Status
|
||||
* @param complete
|
||||
*/
|
||||
data class Order(
|
||||
|
||||
@Schema(example = "null", description = "")
|
||||
@get:JsonProperty("id") val id: kotlin.Long? = null,
|
||||
|
||||
@Schema(example = "null", description = "")
|
||||
@get:JsonProperty("petId") val petId: kotlin.Long? = null,
|
||||
|
||||
@Schema(example = "null", description = "")
|
||||
@get:JsonProperty("quantity") val quantity: kotlin.Int? = null,
|
||||
|
||||
@Schema(example = "null", description = "")
|
||||
@get:JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null,
|
||||
|
||||
@Schema(example = "null", description = "Order Status")
|
||||
@get:JsonProperty("status") val status: Order.Status? = null,
|
||||
|
||||
@Schema(example = "null", description = "")
|
||||
@get:JsonProperty("complete") val complete: kotlin.Boolean? = false
|
||||
) {
|
||||
|
||||
/**
|
||||
* Order Status
|
||||
* Values: placed,approved,delivered
|
||||
*/
|
||||
enum class Status(@get:JsonValue val value: kotlin.String) {
|
||||
|
||||
placed("placed"),
|
||||
approved("approved"),
|
||||
delivered("delivered");
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
@JsonCreator
|
||||
fun forValue(value: kotlin.String): Status {
|
||||
return values().first{it -> it.value == value}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,72 +0,0 @@
|
||||
package org.openapitools.model
|
||||
|
||||
import java.util.Objects
|
||||
import com.fasterxml.jackson.annotation.JsonCreator
|
||||
import com.fasterxml.jackson.annotation.JsonProperty
|
||||
import com.fasterxml.jackson.annotation.JsonValue
|
||||
import org.openapitools.model.Category
|
||||
import org.openapitools.model.Tag
|
||||
import jakarta.validation.constraints.DecimalMax
|
||||
import jakarta.validation.constraints.DecimalMin
|
||||
import jakarta.validation.constraints.Email
|
||||
import jakarta.validation.constraints.Max
|
||||
import jakarta.validation.constraints.Min
|
||||
import jakarta.validation.constraints.NotNull
|
||||
import jakarta.validation.constraints.Pattern
|
||||
import jakarta.validation.constraints.Size
|
||||
import jakarta.validation.Valid
|
||||
import io.swagger.v3.oas.annotations.media.Schema
|
||||
|
||||
/**
|
||||
* A pet for sale in the pet store
|
||||
* @param name
|
||||
* @param photoUrls
|
||||
* @param id
|
||||
* @param category
|
||||
* @param tags
|
||||
* @param status pet status in the store
|
||||
*/
|
||||
data class Pet(
|
||||
|
||||
@Schema(example = "doggie", required = true, description = "")
|
||||
@get:JsonProperty("name", required = true) val name: kotlin.String,
|
||||
|
||||
@Schema(example = "null", required = true, description = "")
|
||||
@get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List<kotlin.String>,
|
||||
|
||||
@Schema(example = "null", description = "")
|
||||
@get:JsonProperty("id") val id: kotlin.Long? = null,
|
||||
|
||||
@field:Valid
|
||||
@Schema(example = "null", description = "")
|
||||
@get:JsonProperty("category") val category: Category? = null,
|
||||
|
||||
@field:Valid
|
||||
@Schema(example = "null", description = "")
|
||||
@get:JsonProperty("tags") val tags: kotlin.collections.List<Tag>? = null,
|
||||
|
||||
@Schema(example = "null", description = "pet status in the store")
|
||||
@get:JsonProperty("status") val status: Pet.Status? = null
|
||||
) {
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
* Values: available,pending,sold
|
||||
*/
|
||||
enum class Status(@get:JsonValue val value: kotlin.String) {
|
||||
|
||||
available("available"),
|
||||
pending("pending"),
|
||||
sold("sold");
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
@JsonCreator
|
||||
fun forValue(value: kotlin.String): Status {
|
||||
return values().first{it -> it.value == value}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,31 +0,0 @@
|
||||
package org.openapitools.model
|
||||
|
||||
import java.util.Objects
|
||||
import com.fasterxml.jackson.annotation.JsonProperty
|
||||
import jakarta.validation.constraints.DecimalMax
|
||||
import jakarta.validation.constraints.DecimalMin
|
||||
import jakarta.validation.constraints.Email
|
||||
import jakarta.validation.constraints.Max
|
||||
import jakarta.validation.constraints.Min
|
||||
import jakarta.validation.constraints.NotNull
|
||||
import jakarta.validation.constraints.Pattern
|
||||
import jakarta.validation.constraints.Size
|
||||
import jakarta.validation.Valid
|
||||
import io.swagger.v3.oas.annotations.media.Schema
|
||||
|
||||
/**
|
||||
* A tag for a pet
|
||||
* @param id
|
||||
* @param name
|
||||
*/
|
||||
data class Tag(
|
||||
|
||||
@Schema(example = "null", description = "")
|
||||
@get:JsonProperty("id") val id: kotlin.Long? = null,
|
||||
|
||||
@Schema(example = "null", description = "")
|
||||
@get:JsonProperty("name") val name: kotlin.String? = null
|
||||
) {
|
||||
|
||||
}
|
||||
|
@ -1,55 +0,0 @@
|
||||
package org.openapitools.model
|
||||
|
||||
import java.util.Objects
|
||||
import com.fasterxml.jackson.annotation.JsonProperty
|
||||
import jakarta.validation.constraints.DecimalMax
|
||||
import jakarta.validation.constraints.DecimalMin
|
||||
import jakarta.validation.constraints.Email
|
||||
import jakarta.validation.constraints.Max
|
||||
import jakarta.validation.constraints.Min
|
||||
import jakarta.validation.constraints.NotNull
|
||||
import jakarta.validation.constraints.Pattern
|
||||
import jakarta.validation.constraints.Size
|
||||
import jakarta.validation.Valid
|
||||
import io.swagger.v3.oas.annotations.media.Schema
|
||||
|
||||
/**
|
||||
* A User who is purchasing from the pet store
|
||||
* @param id
|
||||
* @param username
|
||||
* @param firstName
|
||||
* @param lastName
|
||||
* @param email
|
||||
* @param password
|
||||
* @param phone
|
||||
* @param userStatus User Status
|
||||
*/
|
||||
data class User(
|
||||
|
||||
@Schema(example = "null", description = "")
|
||||
@get:JsonProperty("id") val id: kotlin.Long? = null,
|
||||
|
||||
@Schema(example = "null", description = "")
|
||||
@get:JsonProperty("username") val username: kotlin.String? = null,
|
||||
|
||||
@Schema(example = "null", description = "")
|
||||
@get:JsonProperty("firstName") val firstName: kotlin.String? = null,
|
||||
|
||||
@Schema(example = "null", description = "")
|
||||
@get:JsonProperty("lastName") val lastName: kotlin.String? = null,
|
||||
|
||||
@Schema(example = "null", description = "")
|
||||
@get:JsonProperty("email") val email: kotlin.String? = null,
|
||||
|
||||
@Schema(example = "null", description = "")
|
||||
@get:JsonProperty("password") val password: kotlin.String? = null,
|
||||
|
||||
@Schema(example = "null", description = "")
|
||||
@get:JsonProperty("phone") val phone: kotlin.String? = null,
|
||||
|
||||
@Schema(example = "null", description = "User Status")
|
||||
@get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null
|
||||
) {
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user