Skip to content

Commit 6dc9f91

Browse files
committed
jaxrs-cxf-annotated-base-path sample updated
1 parent 40b0680 commit 6dc9f91

File tree

12 files changed

+73
-67
lines changed

12 files changed

+73
-67
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0.5-SNAPSHOT
1+
3.0.6-SNAPSHOT
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0.1-SNAPSHOT
1+
3.0.6-SNAPSHOT

samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/PetApi.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public interface PetApi {
3838
@POST
3939
@Path("/pet")
4040
@Consumes({ "application/json", "application/xml" })
41-
@Operation(summary = "Add a new pet to the store", tags={ "pet" })
41+
@Operation(summary = "Add a new pet to the store", tags={ })
4242
@ApiResponses(value = {
4343
@ApiResponse(responseCode = "405", description = "Invalid input") })
4444
public void addPet(@Valid Pet body);
@@ -49,7 +49,7 @@ public interface PetApi {
4949
*/
5050
@DELETE
5151
@Path("/pet/{petId}")
52-
@Operation(summary = "Deletes a pet", tags={ "pet" })
52+
@Operation(summary = "Deletes a pet", tags={ })
5353
@ApiResponses(value = {
5454
@ApiResponse(responseCode = "400", description = "Invalid pet value") })
5555
public void deletePet(@PathParam("petId") Integer petId, @HeaderParam("api_key") String apiKey);
@@ -63,7 +63,7 @@ public interface PetApi {
6363
@GET
6464
@Path("/pet/findByStatus")
6565
@Produces({ "application/xml", "application/json" })
66-
@Operation(summary = "Finds Pets by status", tags={ "pet" })
66+
@Operation(summary = "Finds Pets by status", tags={ })
6767
@ApiResponses(value = {
6868
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Pet.class)))),
6969
@ApiResponse(responseCode = "400", description = "Invalid status value") })
@@ -78,7 +78,7 @@ public interface PetApi {
7878
@GET
7979
@Path("/pet/findByTags")
8080
@Produces({ "application/xml", "application/json" })
81-
@Operation(summary = "Finds Pets by tags", tags={ "pet" })
81+
@Operation(summary = "Finds Pets by tags", tags={ })
8282
@ApiResponses(value = {
8383
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Pet.class)))),
8484
@ApiResponse(responseCode = "400", description = "Invalid tag value") })
@@ -93,7 +93,7 @@ public interface PetApi {
9393
@GET
9494
@Path("/pet/{petId}")
9595
@Produces({ "application/xml", "application/json" })
96-
@Operation(summary = "Find pet by ID", tags={ "pet" })
96+
@Operation(summary = "Find pet by ID", tags={ })
9797
@ApiResponses(value = {
9898
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Pet.class))),
9999
@ApiResponse(responseCode = "400", description = "Invalid ID supplied"),
@@ -107,7 +107,7 @@ public interface PetApi {
107107
@PUT
108108
@Path("/pet")
109109
@Consumes({ "application/json", "application/xml" })
110-
@Operation(summary = "Update an existing pet", tags={ "pet" })
110+
@Operation(summary = "Update an existing pet", tags={ })
111111
@ApiResponses(value = {
112112
@ApiResponse(responseCode = "400", description = "Invalid ID supplied"),
113113
@ApiResponse(responseCode = "404", description = "Pet not found"),
@@ -121,7 +121,7 @@ public interface PetApi {
121121
@POST
122122
@Path("/pet/{petId}")
123123
@Consumes({ "application/x-www-form-urlencoded" })
124-
@Operation(summary = "Updates a pet in the store with form data", tags={ "pet" })
124+
@Operation(summary = "Updates a pet in the store with form data", tags={ })
125125
@ApiResponses(value = {
126126
@ApiResponse(responseCode = "405", description = "Invalid input") })
127127
public void updatePetWithForm(@PathParam("petId") Integer petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status);
@@ -134,7 +134,7 @@ public interface PetApi {
134134
@Path("/pet/{petId}/uploadImage")
135135
@Consumes({ "multipart/form-data" })
136136
@Produces({ "application/json" })
137-
@Operation(summary = "uploads an image", tags={ "pet" })
137+
@Operation(summary = "uploads an image", tags={ })
138138
@ApiResponses(value = {
139139
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = ModelApiResponse.class))) })
140140
public ModelApiResponse uploadFile(@PathParam("petId") Integer petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file" , required = false) Attachment fileDetail);

samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/StoreApi.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public interface StoreApi {
3838
*/
3939
@DELETE
4040
@Path("/store/order/{orderId}")
41-
@Operation(summary = "Delete purchase order by ID", tags={ "store" })
41+
@Operation(summary = "Delete purchase order by ID", tags={ })
4242
@ApiResponses(value = {
4343
@ApiResponse(responseCode = "400", description = "Invalid ID supplied"),
4444
@ApiResponse(responseCode = "404", description = "Order not found") })
@@ -53,7 +53,7 @@ public interface StoreApi {
5353
@GET
5454
@Path("/store/inventory")
5555
@Produces({ "application/json" })
56-
@Operation(summary = "Returns pet inventories by status", tags={ "store" })
56+
@Operation(summary = "Returns pet inventories by status", tags={ })
5757
@ApiResponses(value = {
5858
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Map.class)))) })
5959
public Map<String, Integer> getInventory();
@@ -67,7 +67,7 @@ public interface StoreApi {
6767
@GET
6868
@Path("/store/order/{orderId}")
6969
@Produces({ "application/xml", "application/json" })
70-
@Operation(summary = "Find purchase order by ID", tags={ "store" })
70+
@Operation(summary = "Find purchase order by ID", tags={ })
7171
@ApiResponses(value = {
7272
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Order.class))),
7373
@ApiResponse(responseCode = "400", description = "Invalid ID supplied"),
@@ -82,7 +82,7 @@ public interface StoreApi {
8282
@Path("/store/order")
8383
@Consumes({ "*/*" })
8484
@Produces({ "application/xml", "application/json" })
85-
@Operation(summary = "Place an order for a pet", tags={ "store" })
85+
@Operation(summary = "Place an order for a pet", tags={ })
8686
@ApiResponses(value = {
8787
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Order.class))),
8888
@ApiResponse(responseCode = "400", description = "Invalid Order") })

samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/UserApi.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public interface UserApi {
3838
@POST
3939
@Path("/user")
4040
@Consumes({ "*/*" })
41-
@Operation(summary = "Create user", tags={ "user" })
41+
@Operation(summary = "Create user", tags={ })
4242
@ApiResponses(value = {
4343
@ApiResponse(responseCode = "200", description = "successful operation") })
4444
public void createUser(@Valid User body);
@@ -50,7 +50,7 @@ public interface UserApi {
5050
@POST
5151
@Path("/user/createWithArray")
5252
@Consumes({ "*/*" })
53-
@Operation(summary = "Creates list of users with given input array", tags={ "user" })
53+
@Operation(summary = "Creates list of users with given input array", tags={ })
5454
@ApiResponses(value = {
5555
@ApiResponse(responseCode = "200", description = "successful operation") })
5656
public void createUsersWithArrayInput(@Valid List<User> body);
@@ -62,7 +62,7 @@ public interface UserApi {
6262
@POST
6363
@Path("/user/createWithList")
6464
@Consumes({ "*/*" })
65-
@Operation(summary = "Creates list of users with given input array", tags={ "user" })
65+
@Operation(summary = "Creates list of users with given input array", tags={ })
6666
@ApiResponses(value = {
6767
@ApiResponse(responseCode = "200", description = "successful operation") })
6868
public void createUsersWithListInput(@Valid List<User> body);
@@ -75,7 +75,7 @@ public interface UserApi {
7575
*/
7676
@DELETE
7777
@Path("/user/{username}")
78-
@Operation(summary = "Delete user", tags={ "user" })
78+
@Operation(summary = "Delete user", tags={ })
7979
@ApiResponses(value = {
8080
@ApiResponse(responseCode = "400", description = "Invalid username supplied"),
8181
@ApiResponse(responseCode = "404", description = "User not found") })
@@ -88,7 +88,7 @@ public interface UserApi {
8888
@GET
8989
@Path("/user/{username}")
9090
@Produces({ "application/xml", "application/json" })
91-
@Operation(summary = "Get user by user name", tags={ "user" })
91+
@Operation(summary = "Get user by user name", tags={ })
9292
@ApiResponses(value = {
9393
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = User.class))),
9494
@ApiResponse(responseCode = "400", description = "Invalid username supplied"),
@@ -102,7 +102,7 @@ public interface UserApi {
102102
@GET
103103
@Path("/user/login")
104104
@Produces({ "application/xml", "application/json" })
105-
@Operation(summary = "Logs user into the system", tags={ "user" })
105+
@Operation(summary = "Logs user into the system", tags={ })
106106
@ApiResponses(value = {
107107
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = String.class))),
108108
@ApiResponse(responseCode = "400", description = "Invalid username/password supplied") })
@@ -114,7 +114,7 @@ public interface UserApi {
114114
*/
115115
@GET
116116
@Path("/user/logout")
117-
@Operation(summary = "Logs out current logged in user session", tags={ "user" })
117+
@Operation(summary = "Logs out current logged in user session", tags={ })
118118
@ApiResponses(value = {
119119
@ApiResponse(responseCode = "200", description = "successful operation") })
120120
public void logoutUser();
@@ -128,7 +128,7 @@ public interface UserApi {
128128
@PUT
129129
@Path("/user/{username}")
130130
@Consumes({ "*/*" })
131-
@Operation(summary = "Updated user", tags={ "user" })
131+
@Operation(summary = "Updated user", tags={ })
132132
@ApiResponses(value = {
133133
@ApiResponse(responseCode = "400", description = "Invalid user supplied"),
134134
@ApiResponse(responseCode = "404", description = "User not found") })

samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Category.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
import javax.xml.bind.annotation.XmlEnum;
1313
import javax.xml.bind.annotation.XmlEnumValue;
1414
import com.fasterxml.jackson.annotation.JsonProperty;
15+
import com.fasterxml.jackson.annotation.JsonValue;
16+
import com.fasterxml.jackson.annotation.JsonCreator;
1517

1618
/**
1719
* A category for a pet

samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/ModelApiResponse.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
import javax.xml.bind.annotation.XmlEnum;
1313
import javax.xml.bind.annotation.XmlEnumValue;
1414
import com.fasterxml.jackson.annotation.JsonProperty;
15+
import com.fasterxml.jackson.annotation.JsonValue;
16+
import com.fasterxml.jackson.annotation.JsonCreator;
1517

1618
/**
1719
* Describes the result of uploading an image resource

samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Order.java

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
import javax.xml.bind.annotation.XmlEnum;
1414
import javax.xml.bind.annotation.XmlEnumValue;
1515
import com.fasterxml.jackson.annotation.JsonProperty;
16+
import com.fasterxml.jackson.annotation.JsonValue;
17+
import com.fasterxml.jackson.annotation.JsonCreator;
1618

1719
/**
1820
* An order for a pets from the pet store
@@ -31,38 +33,35 @@ public class Order {
3133

3234
@Schema(description = "")
3335
private Date shipDate = null;
34-
@XmlType(name="StatusEnum")
35-
@XmlEnum(String.class)
36-
public enum StatusEnum {
37-
38-
@XmlEnumValue("placed") PLACED(String.valueOf("placed")), @XmlEnumValue("approved") APPROVED(String.valueOf("approved")), @XmlEnumValue("delivered") DELIVERED(String.valueOf("delivered"));
39-
36+
public enum StatusEnum {
37+
PLACED("placed"),
38+
APPROVED("approved"),
39+
DELIVERED("delivered");
4040

4141
private String value;
4242

43-
StatusEnum (String v) {
44-
value = v;
43+
StatusEnum(String value) {
44+
this.value = value;
4545
}
46-
47-
public String value() {
48-
return value;
46+
@JsonValue
47+
public String getValue() {
48+
return value;
4949
}
5050

5151
@Override
5252
public String toString() {
53-
return String.valueOf(value);
53+
return String.valueOf(value);
5454
}
55-
56-
public static StatusEnum fromValue(String v) {
57-
for (StatusEnum b : StatusEnum.values()) {
58-
if (String.valueOf(b.value).equals(v)) {
59-
return b;
60-
}
55+
@JsonCreator
56+
public static StatusEnum fromValue(String text) {
57+
for (StatusEnum b : StatusEnum.values()) {
58+
if (String.valueOf(b.value).equals(text)) {
59+
return b;
6160
}
62-
return null;
61+
}
62+
return null;
6363
}
64-
}
65-
64+
}
6665
@Schema(description = "Order Status")
6766
/**
6867
* Order Status
@@ -152,7 +151,7 @@ public String getStatus() {
152151
if (status == null) {
153152
return null;
154153
}
155-
return status.value();
154+
return status.getValue();
156155
}
157156

158157
public void setStatus(StatusEnum status) {

samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Pet.java

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
import javax.xml.bind.annotation.XmlEnum;
1717
import javax.xml.bind.annotation.XmlEnumValue;
1818
import com.fasterxml.jackson.annotation.JsonProperty;
19+
import com.fasterxml.jackson.annotation.JsonValue;
20+
import com.fasterxml.jackson.annotation.JsonCreator;
1921

2022
/**
2123
* A pet for sale in the pet store
@@ -37,38 +39,35 @@ public class Pet {
3739

3840
@Schema(description = "")
3941
private List<Tag> tags = null;
40-
@XmlType(name="StatusEnum")
41-
@XmlEnum(String.class)
42-
public enum StatusEnum {
43-
44-
@XmlEnumValue("available") AVAILABLE(String.valueOf("available")), @XmlEnumValue("pending") PENDING(String.valueOf("pending")), @XmlEnumValue("sold") SOLD(String.valueOf("sold"));
45-
42+
public enum StatusEnum {
43+
AVAILABLE("available"),
44+
PENDING("pending"),
45+
SOLD("sold");
4646

4747
private String value;
4848

49-
StatusEnum (String v) {
50-
value = v;
49+
StatusEnum(String value) {
50+
this.value = value;
5151
}
52-
53-
public String value() {
54-
return value;
52+
@JsonValue
53+
public String getValue() {
54+
return value;
5555
}
5656

5757
@Override
5858
public String toString() {
59-
return String.valueOf(value);
59+
return String.valueOf(value);
6060
}
61-
62-
public static StatusEnum fromValue(String v) {
63-
for (StatusEnum b : StatusEnum.values()) {
64-
if (String.valueOf(b.value).equals(v)) {
65-
return b;
66-
}
61+
@JsonCreator
62+
public static StatusEnum fromValue(String text) {
63+
for (StatusEnum b : StatusEnum.values()) {
64+
if (String.valueOf(b.value).equals(text)) {
65+
return b;
6766
}
68-
return null;
67+
}
68+
return null;
6969
}
70-
}
71-
70+
}
7271
@Schema(description = "pet status in the store")
7372
/**
7473
* pet status in the store
@@ -185,7 +184,7 @@ public String getStatus() {
185184
if (status == null) {
186185
return null;
187186
}
188-
return status.value();
187+
return status.getValue();
189188
}
190189

191190
public void setStatus(StatusEnum status) {

samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Tag.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
import javax.xml.bind.annotation.XmlEnum;
1313
import javax.xml.bind.annotation.XmlEnumValue;
1414
import com.fasterxml.jackson.annotation.JsonProperty;
15+
import com.fasterxml.jackson.annotation.JsonValue;
16+
import com.fasterxml.jackson.annotation.JsonCreator;
1517

1618
/**
1719
* A tag for a pet

0 commit comments

Comments
 (0)