Skip to content

Commit b9cb91e

Browse files
committed
fix samples
1 parent 6771de2 commit b9cb91e

4 files changed

Lines changed: 605 additions & 0 deletions

File tree

  • samples
    • client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api
    • server/petstore
      • springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api
      • springboot-spring-pageable/src/main/java/org/openapitools/api
      • springboot-useoptional/src/main/java/org/openapitools/configuration
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
/*
2+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.20.0-SNAPSHOT).
3+
* https://openapi-generator.tech
4+
* Do not edit the class manually.
5+
*/
6+
package org.openapitools.api;
7+
8+
import java.time.OffsetDateTime;
9+
import org.openapitools.model.UserDto;
10+
import org.springframework.http.HttpStatus;
11+
import org.springframework.web.bind.annotation.*;
12+
import org.springframework.web.service.annotation.*;
13+
import org.springframework.web.multipart.MultipartFile;
14+
15+
import java.util.List;
16+
import java.util.Map;
17+
import java.util.Optional;
18+
import jakarta.annotation.Generated;
19+
20+
21+
22+
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
23+
public interface UserApi {
24+
25+
/**
26+
* POST /user : Create user
27+
* This can only be done by the logged in user.
28+
*
29+
* @param userDto Created user object (required)
30+
* @return successful operation (status code 200)
31+
*/
32+
@ResponseStatus(HttpStatus.OK)
33+
@HttpExchange(
34+
method = "POST",
35+
value = "/user",
36+
accept = { "application/json" },
37+
contentType = "application/json"
38+
)
39+
void createUser(
40+
@RequestBody UserDto userDto
41+
);
42+
43+
44+
/**
45+
* POST /user/createWithArray : Creates list of users with given input array
46+
*
47+
*
48+
* @param userDto List of user object (required)
49+
* @return successful operation (status code 200)
50+
*/
51+
@ResponseStatus(HttpStatus.OK)
52+
@HttpExchange(
53+
method = "POST",
54+
value = "/user/createWithArray",
55+
accept = { "application/json" },
56+
contentType = "application/json"
57+
)
58+
void createUsersWithArrayInput(
59+
@RequestBody List<UserDto> userDto
60+
);
61+
62+
63+
/**
64+
* POST /user/createWithList : Creates list of users with given input array
65+
*
66+
*
67+
* @param userDto List of user object (required)
68+
* @return successful operation (status code 200)
69+
*/
70+
@ResponseStatus(HttpStatus.OK)
71+
@HttpExchange(
72+
method = "POST",
73+
value = "/user/createWithList",
74+
accept = { "application/json" },
75+
contentType = "application/json"
76+
)
77+
void createUsersWithListInput(
78+
@RequestBody List<UserDto> userDto
79+
);
80+
81+
82+
/**
83+
* DELETE /user/{username} : Delete user
84+
* This can only be done by the logged in user.
85+
*
86+
* @param username The name that needs to be deleted (required)
87+
* @return Invalid username supplied (status code 400)
88+
* or User not found (status code 404)
89+
*/
90+
@ResponseStatus(HttpStatus.BAD_REQUEST)
91+
@HttpExchange(
92+
method = "DELETE",
93+
value = "/user/{username}",
94+
accept = { "application/json" }
95+
)
96+
void deleteUser(
97+
@PathVariable("username") String username
98+
);
99+
100+
101+
/**
102+
* GET /user/{username} : Get user by user name
103+
*
104+
*
105+
* @param username The name that needs to be fetched. Use user1 for testing. (required)
106+
* @return successful operation (status code 200)
107+
* or Invalid username supplied (status code 400)
108+
* or User not found (status code 404)
109+
*/
110+
@ResponseStatus(HttpStatus.OK)
111+
@HttpExchange(
112+
method = "GET",
113+
value = "/user/{username}",
114+
accept = { "application/json", "application/xml" }
115+
)
116+
UserDto getUserByName(
117+
@PathVariable("username") String username
118+
);
119+
120+
121+
/**
122+
* GET /user/login : Logs user into the system
123+
*
124+
*
125+
* @param username The user name for login (required)
126+
* @param password The password for login in clear text (required)
127+
* @return successful operation (status code 200)
128+
* or Invalid username/password supplied (status code 400)
129+
*/
130+
@ResponseStatus(HttpStatus.OK)
131+
@HttpExchange(
132+
method = "GET",
133+
value = "/user/login",
134+
accept = { "application/json", "application/xml" }
135+
)
136+
String loginUser(
137+
@RequestParam(value = "username", required = true) String username,
138+
@RequestParam(value = "password", required = true) String password
139+
);
140+
141+
142+
/**
143+
* GET /user/logout : Logs out current logged in user session
144+
*
145+
*
146+
* @return successful operation (status code 200)
147+
*/
148+
@ResponseStatus(HttpStatus.OK)
149+
@HttpExchange(
150+
method = "GET",
151+
value = "/user/logout",
152+
accept = { "application/json" }
153+
)
154+
void logoutUser(
155+
156+
);
157+
158+
159+
/**
160+
* PUT /user/{username} : Updated user
161+
* This can only be done by the logged in user.
162+
*
163+
* @param username name that need to be deleted (required)
164+
* @param userDto Updated user object (required)
165+
* @return Invalid user supplied (status code 400)
166+
* or User not found (status code 404)
167+
*/
168+
@ResponseStatus(HttpStatus.BAD_REQUEST)
169+
@HttpExchange(
170+
method = "PUT",
171+
value = "/user/{username}",
172+
accept = { "application/json" },
173+
contentType = "application/json"
174+
)
175+
void updateUser(
176+
@PathVariable("username") String username,
177+
@RequestBody UserDto userDto
178+
);
179+
180+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
/*
2+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.20.0-SNAPSHOT).
3+
* https://openapi-generator.tech
4+
* Do not edit the class manually.
5+
*/
6+
package org.openapitools.api;
7+
8+
import java.util.Map;
9+
import org.openapitools.model.Order;
10+
import io.swagger.annotations.*;
11+
import org.springframework.http.ResponseEntity;
12+
import org.springframework.validation.annotation.Validated;
13+
import org.springframework.web.bind.annotation.*;
14+
import org.springframework.web.multipart.MultipartFile;
15+
16+
import javax.validation.Valid;
17+
import javax.validation.constraints.*;
18+
import java.util.List;
19+
import java.util.Map;
20+
import javax.annotation.Generated;
21+
22+
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
23+
@Validated
24+
@Api(value = "store", description = "Access to Petstore orders")
25+
public interface StoreApi {
26+
27+
default StoreApiDelegate getDelegate() {
28+
return new StoreApiDelegate() {};
29+
}
30+
31+
String PATH_DELETE_ORDER = "/store/order/{order_id}";
32+
/**
33+
* DELETE /store/order/{order_id} : Delete purchase order by ID
34+
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
35+
*
36+
* @param orderId ID of the order that needs to be deleted (required)
37+
* @return Invalid ID supplied (status code 400)
38+
* or Order not found (status code 404)
39+
*/
40+
@ApiOperation(
41+
tags = { "store" },
42+
value = "Delete purchase order by ID",
43+
nickname = "deleteOrder",
44+
notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors"
45+
)
46+
@ApiResponses({
47+
@ApiResponse(code = 400, message = "Invalid ID supplied"),
48+
@ApiResponse(code = 404, message = "Order not found")
49+
})
50+
@RequestMapping(
51+
method = RequestMethod.DELETE,
52+
value = StoreApi.PATH_DELETE_ORDER
53+
)
54+
default ResponseEntity<Void> deleteOrder(
55+
@NotNull @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId
56+
) {
57+
return getDelegate().deleteOrder(orderId);
58+
}
59+
60+
61+
String PATH_GET_INVENTORY = "/store/inventory";
62+
/**
63+
* GET /store/inventory : Returns pet inventories by status
64+
* Returns a map of status codes to quantities
65+
*
66+
* @return successful operation (status code 200)
67+
*/
68+
@ApiOperation(
69+
tags = { "store" },
70+
value = "Returns pet inventories by status",
71+
nickname = "getInventory",
72+
notes = "Returns a map of status codes to quantities",
73+
response = Integer.class,
74+
responseContainer = "Map",
75+
authorizations = {
76+
@Authorization(value = "api_key")
77+
}
78+
)
79+
@ApiResponses({
80+
@ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map")
81+
})
82+
@RequestMapping(
83+
method = RequestMethod.GET,
84+
value = StoreApi.PATH_GET_INVENTORY,
85+
produces = { "application/json" }
86+
)
87+
default ResponseEntity<Map<String, Integer>> getInventory(
88+
89+
) {
90+
return getDelegate().getInventory();
91+
}
92+
93+
94+
String PATH_GET_ORDER_BY_ID = "/store/order/{order_id}";
95+
/**
96+
* GET /store/order/{order_id} : Find purchase order by ID
97+
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generate exceptions
98+
*
99+
* @param orderId ID of pet that needs to be fetched (required)
100+
* @return successful operation (status code 200)
101+
* or Invalid ID supplied (status code 400)
102+
* or Order not found (status code 404)
103+
*/
104+
@ApiOperation(
105+
tags = { "store" },
106+
value = "Find purchase order by ID",
107+
nickname = "getOrderById",
108+
notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions",
109+
response = Order.class
110+
)
111+
@ApiResponses({
112+
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
113+
@ApiResponse(code = 400, message = "Invalid ID supplied"),
114+
@ApiResponse(code = 404, message = "Order not found")
115+
})
116+
@RequestMapping(
117+
method = RequestMethod.GET,
118+
value = StoreApi.PATH_GET_ORDER_BY_ID,
119+
produces = { "application/xml", "application/json" }
120+
)
121+
default ResponseEntity<Order> getOrderById(
122+
@NotNull @Min(value = 1L) @Max(value = 5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId
123+
) {
124+
return getDelegate().getOrderById(orderId);
125+
}
126+
127+
128+
String PATH_PLACE_ORDER = "/store/order";
129+
/**
130+
* POST /store/order : Place an order for a pet
131+
*
132+
* @param body order placed for purchasing the pet (required)
133+
* @return successful operation (status code 200)
134+
* or Invalid Order (status code 400)
135+
*/
136+
@ApiOperation(
137+
tags = { "store" },
138+
value = "Place an order for a pet",
139+
nickname = "placeOrder",
140+
notes = "",
141+
response = Order.class
142+
)
143+
@ApiResponses({
144+
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
145+
@ApiResponse(code = 400, message = "Invalid Order")
146+
})
147+
@RequestMapping(
148+
method = RequestMethod.POST,
149+
value = StoreApi.PATH_PLACE_ORDER,
150+
produces = { "application/xml", "application/json" }
151+
)
152+
default ResponseEntity<Order> placeOrder(
153+
@ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body
154+
) {
155+
return getDelegate().placeOrder(body);
156+
}
157+
158+
}

0 commit comments

Comments
 (0)