forked from loafle/openapi-generator-original
Remove JDK7 support from Java Spring generators (#11561)
* remove jdk8 support from spring generators * update tests, remove commented code in AbstractJavaCodegen * add back implementation * add back import * generate code for non reactive
This commit is contained in:
@@ -1,8 +1,28 @@
|
||||
package org.openapitools.api;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.openapitools.model.Client;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.CookieValue;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import javax.annotation.Generated;
|
||||
|
||||
@@ -22,4 +42,18 @@ public class AnotherFakeApiController implements AnotherFakeApi {
|
||||
return delegate;
|
||||
}
|
||||
|
||||
/**
|
||||
* PATCH /another-fake/dummy : To test special tags
|
||||
* To test special tags and operation ID starting with number
|
||||
*
|
||||
* @param body client model (required)
|
||||
* @return successful operation (status code 200)
|
||||
* @see AnotherFakeApi#call123testSpecialTags
|
||||
*/
|
||||
public ResponseEntity<Client> call123testSpecialTags(
|
||||
@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body
|
||||
) {
|
||||
return delegate.call123testSpecialTags(body);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,38 @@
|
||||
package org.openapitools.api;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import java.math.BigDecimal;
|
||||
import org.openapitools.model.Client;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.openapitools.model.FileSchemaTestClass;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Map;
|
||||
import org.openapitools.model.ModelApiResponse;
|
||||
import java.time.OffsetDateTime;
|
||||
import org.openapitools.model.OuterComposite;
|
||||
import org.openapitools.model.User;
|
||||
import org.openapitools.model.XmlItem;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.CookieValue;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import javax.annotation.Generated;
|
||||
|
||||
@@ -22,4 +52,278 @@ public class FakeApiController implements FakeApi {
|
||||
return delegate;
|
||||
}
|
||||
|
||||
/**
|
||||
* POST /fake/create_xml_item : creates an XmlItem
|
||||
* this route creates an XmlItem
|
||||
*
|
||||
* @param xmlItem XmlItem Body (required)
|
||||
* @return successful operation (status code 200)
|
||||
* @see FakeApi#createXmlItem
|
||||
*/
|
||||
public ResponseEntity<Void> createXmlItem(
|
||||
@ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem
|
||||
) {
|
||||
return delegate.createXmlItem(xmlItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* POST /fake/outer/boolean
|
||||
* Test serialization of outer boolean types
|
||||
*
|
||||
* @param body Input boolean as post body (optional)
|
||||
* @return Output boolean (status code 200)
|
||||
* @see FakeApi#fakeOuterBooleanSerialize
|
||||
*/
|
||||
public ResponseEntity<Boolean> fakeOuterBooleanSerialize(
|
||||
@ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body
|
||||
) {
|
||||
return delegate.fakeOuterBooleanSerialize(body);
|
||||
}
|
||||
|
||||
/**
|
||||
* POST /fake/outer/composite
|
||||
* Test serialization of object with outer number type
|
||||
*
|
||||
* @param body Input composite as post body (optional)
|
||||
* @return Output composite (status code 200)
|
||||
* @see FakeApi#fakeOuterCompositeSerialize
|
||||
*/
|
||||
public ResponseEntity<OuterComposite> fakeOuterCompositeSerialize(
|
||||
@ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body
|
||||
) {
|
||||
return delegate.fakeOuterCompositeSerialize(body);
|
||||
}
|
||||
|
||||
/**
|
||||
* POST /fake/outer/number
|
||||
* Test serialization of outer number types
|
||||
*
|
||||
* @param body Input number as post body (optional)
|
||||
* @return Output number (status code 200)
|
||||
* @see FakeApi#fakeOuterNumberSerialize
|
||||
*/
|
||||
public ResponseEntity<BigDecimal> fakeOuterNumberSerialize(
|
||||
@ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body
|
||||
) {
|
||||
return delegate.fakeOuterNumberSerialize(body);
|
||||
}
|
||||
|
||||
/**
|
||||
* POST /fake/outer/string
|
||||
* Test serialization of outer string types
|
||||
*
|
||||
* @param body Input string as post body (optional)
|
||||
* @return Output string (status code 200)
|
||||
* @see FakeApi#fakeOuterStringSerialize
|
||||
*/
|
||||
public ResponseEntity<String> fakeOuterStringSerialize(
|
||||
@ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body
|
||||
) {
|
||||
return delegate.fakeOuterStringSerialize(body);
|
||||
}
|
||||
|
||||
/**
|
||||
* PUT /fake/body-with-file-schema
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
*
|
||||
* @param body (required)
|
||||
* @return Success (status code 200)
|
||||
* @see FakeApi#testBodyWithFileSchema
|
||||
*/
|
||||
public ResponseEntity<Void> testBodyWithFileSchema(
|
||||
@ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body
|
||||
) {
|
||||
return delegate.testBodyWithFileSchema(body);
|
||||
}
|
||||
|
||||
/**
|
||||
* PUT /fake/body-with-query-params
|
||||
*
|
||||
* @param query (required)
|
||||
* @param body (required)
|
||||
* @return Success (status code 200)
|
||||
* @see FakeApi#testBodyWithQueryParams
|
||||
*/
|
||||
public ResponseEntity<Void> testBodyWithQueryParams(
|
||||
@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,
|
||||
@ApiParam(value = "", required = true) @Valid @RequestBody User body
|
||||
) {
|
||||
return delegate.testBodyWithQueryParams(query, body);
|
||||
}
|
||||
|
||||
/**
|
||||
* PATCH /fake : To test \"client\" model
|
||||
* To test \"client\" model
|
||||
*
|
||||
* @param body client model (required)
|
||||
* @return successful operation (status code 200)
|
||||
* @see FakeApi#testClientModel
|
||||
*/
|
||||
public ResponseEntity<Client> testClientModel(
|
||||
@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body
|
||||
) {
|
||||
return delegate.testClientModel(body);
|
||||
}
|
||||
|
||||
/**
|
||||
* POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
*
|
||||
* @param number None (required)
|
||||
* @param _double None (required)
|
||||
* @param patternWithoutDelimiter None (required)
|
||||
* @param _byte None (required)
|
||||
* @param integer None (optional)
|
||||
* @param int32 None (optional)
|
||||
* @param int64 None (optional)
|
||||
* @param _float None (optional)
|
||||
* @param string None (optional)
|
||||
* @param binary None (optional)
|
||||
* @param date None (optional)
|
||||
* @param dateTime None (optional)
|
||||
* @param password None (optional)
|
||||
* @param paramCallback None (optional)
|
||||
* @return Invalid username supplied (status code 400)
|
||||
* or User not found (status code 404)
|
||||
* @see FakeApi#testEndpointParameters
|
||||
*/
|
||||
public ResponseEntity<Void> testEndpointParameters(
|
||||
@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number,
|
||||
@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double,
|
||||
@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter,
|
||||
@ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte,
|
||||
@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer,
|
||||
@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32,
|
||||
@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64,
|
||||
@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float,
|
||||
@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string,
|
||||
@ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary,
|
||||
@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date,
|
||||
@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime,
|
||||
@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password,
|
||||
@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback
|
||||
) {
|
||||
return delegate.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback);
|
||||
}
|
||||
|
||||
/**
|
||||
* GET /fake : To test enum parameters
|
||||
* To test enum parameters
|
||||
*
|
||||
* @param enumHeaderStringArray Header parameter enum test (string array) (optional)
|
||||
* @param enumHeaderString Header parameter enum test (string) (optional, default to -efg)
|
||||
* @param enumQueryStringArray Query parameter enum test (string array) (optional)
|
||||
* @param enumQueryString Query parameter enum test (string) (optional, default to -efg)
|
||||
* @param enumQueryInteger Query parameter enum test (double) (optional)
|
||||
* @param enumQueryDouble Query parameter enum test (double) (optional)
|
||||
* @param enumFormStringArray Form parameter enum test (string array) (optional, default to $)
|
||||
* @param enumFormString Form parameter enum test (string) (optional, default to -efg)
|
||||
* @return Invalid request (status code 400)
|
||||
* or Not found (status code 404)
|
||||
* @see FakeApi#testEnumParameters
|
||||
*/
|
||||
public ResponseEntity<Void> testEnumParameters(
|
||||
@ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List<String> enumHeaderStringArray,
|
||||
@ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString,
|
||||
@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List<String> enumQueryStringArray,
|
||||
@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString,
|
||||
@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,
|
||||
@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,
|
||||
@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List<String> enumFormStringArray,
|
||||
@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString
|
||||
) {
|
||||
return delegate.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString);
|
||||
}
|
||||
|
||||
/**
|
||||
* DELETE /fake : Fake endpoint to test group parameters (optional)
|
||||
* Fake endpoint to test group parameters (optional)
|
||||
*
|
||||
* @param requiredStringGroup Required String in group parameters (required)
|
||||
* @param requiredBooleanGroup Required Boolean in group parameters (required)
|
||||
* @param requiredInt64Group Required Integer in group parameters (required)
|
||||
* @param stringGroup String in group parameters (optional)
|
||||
* @param booleanGroup Boolean in group parameters (optional)
|
||||
* @param int64Group Integer in group parameters (optional)
|
||||
* @return Someting wrong (status code 400)
|
||||
* @see FakeApi#testGroupParameters
|
||||
*/
|
||||
public ResponseEntity<Void> testGroupParameters(
|
||||
@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,
|
||||
@ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup,
|
||||
@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,
|
||||
@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,
|
||||
@ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup,
|
||||
@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group
|
||||
) {
|
||||
return delegate.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group);
|
||||
}
|
||||
|
||||
/**
|
||||
* POST /fake/inline-additionalProperties : test inline additionalProperties
|
||||
*
|
||||
* @param param request body (required)
|
||||
* @return successful operation (status code 200)
|
||||
* @see FakeApi#testInlineAdditionalProperties
|
||||
*/
|
||||
public ResponseEntity<Void> testInlineAdditionalProperties(
|
||||
@ApiParam(value = "request body", required = true) @Valid @RequestBody Map<String, String> param
|
||||
) {
|
||||
return delegate.testInlineAdditionalProperties(param);
|
||||
}
|
||||
|
||||
/**
|
||||
* GET /fake/jsonFormData : test json serialization of form data
|
||||
*
|
||||
* @param param field1 (required)
|
||||
* @param param2 field2 (required)
|
||||
* @return successful operation (status code 200)
|
||||
* @see FakeApi#testJsonFormData
|
||||
*/
|
||||
public ResponseEntity<Void> testJsonFormData(
|
||||
@ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param,
|
||||
@ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2
|
||||
) {
|
||||
return delegate.testJsonFormData(param, param2);
|
||||
}
|
||||
|
||||
/**
|
||||
* PUT /fake/test-query-parameters
|
||||
* To test the collection format in query parameters
|
||||
*
|
||||
* @param pipe (required)
|
||||
* @param ioutil (required)
|
||||
* @param http (required)
|
||||
* @param url (required)
|
||||
* @param context (required)
|
||||
* @return Success (status code 200)
|
||||
* @see FakeApi#testQueryParameterCollectionFormat
|
||||
*/
|
||||
public ResponseEntity<Void> testQueryParameterCollectionFormat(
|
||||
@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List<String> pipe,
|
||||
@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List<String> ioutil,
|
||||
@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List<String> http,
|
||||
@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List<String> url,
|
||||
@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List<String> context
|
||||
) {
|
||||
return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context);
|
||||
}
|
||||
|
||||
/**
|
||||
* POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required)
|
||||
*
|
||||
* @param petId ID of pet to update (required)
|
||||
* @param requiredFile file to upload (required)
|
||||
* @param additionalMetadata Additional data to pass to server (optional)
|
||||
* @return successful operation (status code 200)
|
||||
* @see FakeApi#uploadFileWithRequiredFile
|
||||
*/
|
||||
public ResponseEntity<ModelApiResponse> uploadFileWithRequiredFile(
|
||||
@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,
|
||||
@ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile,
|
||||
@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata
|
||||
) {
|
||||
return delegate.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,28 @@
|
||||
package org.openapitools.api;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.openapitools.model.Client;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.CookieValue;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import javax.annotation.Generated;
|
||||
|
||||
@@ -22,4 +42,18 @@ public class FakeClassnameTestApiController implements FakeClassnameTestApi {
|
||||
return delegate;
|
||||
}
|
||||
|
||||
/**
|
||||
* PATCH /fake_classname_test : To test class name in snake case
|
||||
* To test class name in snake case
|
||||
*
|
||||
* @param body client model (required)
|
||||
* @return successful operation (status code 200)
|
||||
* @see FakeClassnameTestApi#testClassname
|
||||
*/
|
||||
public ResponseEntity<Client> testClassname(
|
||||
@ApiParam(value = "client model", required = true) @Valid @RequestBody Client body
|
||||
) {
|
||||
return delegate.testClassname(body);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,31 @@
|
||||
package org.openapitools.api;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
import org.openapitools.model.ModelApiResponse;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.openapitools.model.Pet;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.CookieValue;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import javax.annotation.Generated;
|
||||
|
||||
@@ -22,4 +45,133 @@ public class PetApiController implements PetApi {
|
||||
return delegate;
|
||||
}
|
||||
|
||||
/**
|
||||
* POST /pet : Add a new pet to the store
|
||||
*
|
||||
* @param body Pet object that needs to be added to the store (required)
|
||||
* @return successful operation (status code 200)
|
||||
* or Invalid input (status code 405)
|
||||
* @see PetApi#addPet
|
||||
*/
|
||||
public ResponseEntity<Void> addPet(
|
||||
@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body
|
||||
) {
|
||||
return delegate.addPet(body);
|
||||
}
|
||||
|
||||
/**
|
||||
* DELETE /pet/{petId} : Deletes a pet
|
||||
*
|
||||
* @param petId Pet id to delete (required)
|
||||
* @param apiKey (optional)
|
||||
* @return successful operation (status code 200)
|
||||
* or Invalid pet value (status code 400)
|
||||
* @see PetApi#deletePet
|
||||
*/
|
||||
public ResponseEntity<Void> deletePet(
|
||||
@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,
|
||||
@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey
|
||||
) {
|
||||
return delegate.deletePet(petId, apiKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* GET /pet/findByStatus : Finds Pets by status
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
*
|
||||
* @param status Status values that need to be considered for filter (required)
|
||||
* @return successful operation (status code 200)
|
||||
* or Invalid status value (status code 400)
|
||||
* @see PetApi#findPetsByStatus
|
||||
*/
|
||||
public ResponseEntity<List<Pet>> findPetsByStatus(
|
||||
@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List<String> status,
|
||||
@ApiIgnore final Pageable pageable
|
||||
) {
|
||||
return delegate.findPetsByStatus(status, pageable);
|
||||
}
|
||||
|
||||
/**
|
||||
* GET /pet/findByTags : Finds Pets by tags
|
||||
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
*
|
||||
* @param tags Tags to filter by (required)
|
||||
* @return successful operation (status code 200)
|
||||
* or Invalid tag value (status code 400)
|
||||
* @deprecated
|
||||
* @see PetApi#findPetsByTags
|
||||
*/
|
||||
public ResponseEntity<List<Pet>> findPetsByTags(
|
||||
@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List<String> tags,
|
||||
@ApiIgnore final Pageable pageable
|
||||
) {
|
||||
return delegate.findPetsByTags(tags, pageable);
|
||||
}
|
||||
|
||||
/**
|
||||
* GET /pet/{petId} : Find pet by ID
|
||||
* Returns a single pet
|
||||
*
|
||||
* @param petId ID of pet to return (required)
|
||||
* @return successful operation (status code 200)
|
||||
* or Invalid ID supplied (status code 400)
|
||||
* or Pet not found (status code 404)
|
||||
* @see PetApi#getPetById
|
||||
*/
|
||||
public ResponseEntity<Pet> getPetById(
|
||||
@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId
|
||||
) {
|
||||
return delegate.getPetById(petId);
|
||||
}
|
||||
|
||||
/**
|
||||
* PUT /pet : Update an existing pet
|
||||
*
|
||||
* @param body Pet object that needs to be added to the store (required)
|
||||
* @return successful operation (status code 200)
|
||||
* or Invalid ID supplied (status code 400)
|
||||
* or Pet not found (status code 404)
|
||||
* or Validation exception (status code 405)
|
||||
* @see PetApi#updatePet
|
||||
*/
|
||||
public ResponseEntity<Void> updatePet(
|
||||
@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body
|
||||
) {
|
||||
return delegate.updatePet(body);
|
||||
}
|
||||
|
||||
/**
|
||||
* POST /pet/{petId} : Updates a pet in the store with form data
|
||||
*
|
||||
* @param petId ID of pet that needs to be updated (required)
|
||||
* @param name Updated name of the pet (optional)
|
||||
* @param status Updated status of the pet (optional)
|
||||
* @return Invalid input (status code 405)
|
||||
* @see PetApi#updatePetWithForm
|
||||
*/
|
||||
public ResponseEntity<Void> updatePetWithForm(
|
||||
@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,
|
||||
@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name,
|
||||
@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status
|
||||
) {
|
||||
return delegate.updatePetWithForm(petId, name, status);
|
||||
}
|
||||
|
||||
/**
|
||||
* POST /pet/{petId}/uploadImage : uploads an image
|
||||
*
|
||||
* @param petId ID of pet to update (required)
|
||||
* @param additionalMetadata Additional data to pass to server (optional)
|
||||
* @param file file to upload (optional)
|
||||
* @return successful operation (status code 200)
|
||||
* @see PetApi#uploadFile
|
||||
*/
|
||||
public ResponseEntity<ModelApiResponse> uploadFile(
|
||||
@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,
|
||||
@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata,
|
||||
@ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file
|
||||
) {
|
||||
return delegate.uploadFile(petId, additionalMetadata, file);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,29 @@
|
||||
package org.openapitools.api;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import java.util.Map;
|
||||
import org.openapitools.model.Order;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.CookieValue;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import javax.annotation.Generated;
|
||||
|
||||
@@ -22,4 +43,62 @@ public class StoreApiController implements StoreApi {
|
||||
return delegate;
|
||||
}
|
||||
|
||||
/**
|
||||
* DELETE /store/order/{order_id} : Delete purchase order by ID
|
||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
*
|
||||
* @param orderId ID of the order that needs to be deleted (required)
|
||||
* @return Invalid ID supplied (status code 400)
|
||||
* or Order not found (status code 404)
|
||||
* @see StoreApi#deleteOrder
|
||||
*/
|
||||
public ResponseEntity<Void> deleteOrder(
|
||||
@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId
|
||||
) {
|
||||
return delegate.deleteOrder(orderId);
|
||||
}
|
||||
|
||||
/**
|
||||
* GET /store/inventory : Returns pet inventories by status
|
||||
* Returns a map of status codes to quantities
|
||||
*
|
||||
* @return successful operation (status code 200)
|
||||
* @see StoreApi#getInventory
|
||||
*/
|
||||
public ResponseEntity<Map<String, Integer>> getInventory(
|
||||
|
||||
) {
|
||||
return delegate.getInventory();
|
||||
}
|
||||
|
||||
/**
|
||||
* GET /store/order/{order_id} : Find purchase order by ID
|
||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
*
|
||||
* @param orderId ID of pet that needs to be fetched (required)
|
||||
* @return successful operation (status code 200)
|
||||
* or Invalid ID supplied (status code 400)
|
||||
* or Order not found (status code 404)
|
||||
* @see StoreApi#getOrderById
|
||||
*/
|
||||
public ResponseEntity<Order> getOrderById(
|
||||
@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId
|
||||
) {
|
||||
return delegate.getOrderById(orderId);
|
||||
}
|
||||
|
||||
/**
|
||||
* POST /store/order : Place an order for a pet
|
||||
*
|
||||
* @param body order placed for purchasing the pet (required)
|
||||
* @return successful operation (status code 200)
|
||||
* or Invalid Order (status code 400)
|
||||
* @see StoreApi#placeOrder
|
||||
*/
|
||||
public ResponseEntity<Order> placeOrder(
|
||||
@ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body
|
||||
) {
|
||||
return delegate.placeOrder(body);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,30 @@
|
||||
package org.openapitools.api;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import java.util.List;
|
||||
import java.time.OffsetDateTime;
|
||||
import org.openapitools.model.User;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.CookieValue;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import javax.annotation.Generated;
|
||||
|
||||
@@ -22,4 +44,119 @@ public class UserApiController implements UserApi {
|
||||
return delegate;
|
||||
}
|
||||
|
||||
/**
|
||||
* POST /user : Create user
|
||||
* This can only be done by the logged in user.
|
||||
*
|
||||
* @param body Created user object (required)
|
||||
* @return successful operation (status code 200)
|
||||
* @see UserApi#createUser
|
||||
*/
|
||||
public ResponseEntity<Void> createUser(
|
||||
@ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body
|
||||
) {
|
||||
return delegate.createUser(body);
|
||||
}
|
||||
|
||||
/**
|
||||
* POST /user/createWithArray : Creates list of users with given input array
|
||||
*
|
||||
* @param body List of user object (required)
|
||||
* @return successful operation (status code 200)
|
||||
* @see UserApi#createUsersWithArrayInput
|
||||
*/
|
||||
public ResponseEntity<Void> createUsersWithArrayInput(
|
||||
@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List<User> body
|
||||
) {
|
||||
return delegate.createUsersWithArrayInput(body);
|
||||
}
|
||||
|
||||
/**
|
||||
* POST /user/createWithList : Creates list of users with given input array
|
||||
*
|
||||
* @param body List of user object (required)
|
||||
* @return successful operation (status code 200)
|
||||
* @see UserApi#createUsersWithListInput
|
||||
*/
|
||||
public ResponseEntity<Void> createUsersWithListInput(
|
||||
@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List<User> body
|
||||
) {
|
||||
return delegate.createUsersWithListInput(body);
|
||||
}
|
||||
|
||||
/**
|
||||
* DELETE /user/{username} : Delete user
|
||||
* This can only be done by the logged in user.
|
||||
*
|
||||
* @param username The name that needs to be deleted (required)
|
||||
* @return Invalid username supplied (status code 400)
|
||||
* or User not found (status code 404)
|
||||
* @see UserApi#deleteUser
|
||||
*/
|
||||
public ResponseEntity<Void> deleteUser(
|
||||
@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username
|
||||
) {
|
||||
return delegate.deleteUser(username);
|
||||
}
|
||||
|
||||
/**
|
||||
* GET /user/{username} : Get user by user name
|
||||
*
|
||||
* @param username The name that needs to be fetched. Use user1 for testing. (required)
|
||||
* @return successful operation (status code 200)
|
||||
* or Invalid username supplied (status code 400)
|
||||
* or User not found (status code 404)
|
||||
* @see UserApi#getUserByName
|
||||
*/
|
||||
public ResponseEntity<User> getUserByName(
|
||||
@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username
|
||||
) {
|
||||
return delegate.getUserByName(username);
|
||||
}
|
||||
|
||||
/**
|
||||
* GET /user/login : Logs user into the system
|
||||
*
|
||||
* @param username The user name for login (required)
|
||||
* @param password The password for login in clear text (required)
|
||||
* @return successful operation (status code 200)
|
||||
* or Invalid username/password supplied (status code 400)
|
||||
* @see UserApi#loginUser
|
||||
*/
|
||||
public ResponseEntity<String> loginUser(
|
||||
@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,
|
||||
@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password
|
||||
) {
|
||||
return delegate.loginUser(username, password);
|
||||
}
|
||||
|
||||
/**
|
||||
* GET /user/logout : Logs out current logged in user session
|
||||
*
|
||||
* @return successful operation (status code 200)
|
||||
* @see UserApi#logoutUser
|
||||
*/
|
||||
public ResponseEntity<Void> logoutUser(
|
||||
|
||||
) {
|
||||
return delegate.logoutUser();
|
||||
}
|
||||
|
||||
/**
|
||||
* PUT /user/{username} : Updated user
|
||||
* This can only be done by the logged in user.
|
||||
*
|
||||
* @param username name that need to be deleted (required)
|
||||
* @param body Updated user object (required)
|
||||
* @return Invalid user supplied (status code 400)
|
||||
* or User not found (status code 404)
|
||||
* @see UserApi#updateUser
|
||||
*/
|
||||
public ResponseEntity<Void> updateUser(
|
||||
@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,
|
||||
@ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body
|
||||
) {
|
||||
return delegate.updateUser(username, body);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user