forked from loafle/openapi-generator-original
* Fix issue #6100. Tested with all the samples. * Fix multiple issue with the examples. Removing all of this. Adding fake endpoint .sh but it is not compiling right now.
This commit is contained in:
committed by
wing328
parent
5c384d0f15
commit
1e991be5f3
@@ -157,7 +157,7 @@ public class Order {
|
||||
* Get complete
|
||||
* @return complete
|
||||
**/
|
||||
public Boolean getComplete() {
|
||||
public Boolean isComplete() {
|
||||
return complete;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,88 +11,52 @@ import java.util.HashMap;
|
||||
import java.io.FileInputStream;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
public class PetApiControllerImp implements PetApiControllerImpInterface {
|
||||
|
||||
private final ObjectMapper mapper;
|
||||
|
||||
@Inject
|
||||
private PetApiControllerImp() {
|
||||
mapper = new ObjectMapper();
|
||||
}
|
||||
|
||||
@Override
|
||||
public class PetApiControllerImp {
|
||||
|
||||
public void addPet(Pet body) throws Exception {
|
||||
//Do your magic!!!
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public void deletePet(Long petId, String apiKey) throws Exception {
|
||||
//Do your magic!!!
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public List<Pet> findPetsByStatus( @NotNull List<String> status) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", List.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", List.class);
|
||||
}
|
||||
return new ArrayList<Pet>();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public List<Pet> findPetsByTags( @NotNull List<String> tags) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", List.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", List.class);
|
||||
}
|
||||
return new ArrayList<Pet>();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public Pet getPetById(Long petId) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", Pet.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", Pet.class);
|
||||
}
|
||||
return new Pet();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public void updatePet(Pet body) throws Exception {
|
||||
//Do your magic!!!
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public void updatePetWithForm(Long petId, String name, String status) throws Exception {
|
||||
//Do your magic!!!
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public ModelApiResponse uploadFile(Long petId, String additionalMetadata, Http.MultipartFormData.FilePart file) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", ModelApiResponse.class);
|
||||
}
|
||||
return new ModelApiResponse();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
package controllers;
|
||||
|
||||
import java.io.InputStream;
|
||||
import apimodels.ModelApiResponse;
|
||||
import apimodels.Pet;
|
||||
|
||||
import play.mvc.Http;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
public interface PetApiControllerImpInterface {
|
||||
void addPet(Pet body) throws Exception;
|
||||
|
||||
void deletePet(Long petId, String apiKey) throws Exception;
|
||||
|
||||
List<Pet> findPetsByStatus( @NotNull List<String> status) throws Exception;
|
||||
|
||||
List<Pet> findPetsByTags( @NotNull List<String> tags) throws Exception;
|
||||
|
||||
Pet getPetById(Long petId) throws Exception;
|
||||
|
||||
void updatePet(Pet body) throws Exception;
|
||||
|
||||
void updatePetWithForm(Long petId, String name, String status) throws Exception;
|
||||
|
||||
ModelApiResponse uploadFile(Long petId, String additionalMetadata, Http.MultipartFormData.FilePart file) throws Exception;
|
||||
|
||||
}
|
||||
@@ -10,56 +10,28 @@ import java.util.HashMap;
|
||||
import java.io.FileInputStream;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
public class StoreApiControllerImp implements StoreApiControllerImpInterface {
|
||||
|
||||
private final ObjectMapper mapper;
|
||||
|
||||
@Inject
|
||||
private StoreApiControllerImp() {
|
||||
mapper = new ObjectMapper();
|
||||
}
|
||||
|
||||
@Override
|
||||
public class StoreApiControllerImp {
|
||||
|
||||
public void deleteOrder(String orderId) throws Exception {
|
||||
//Do your magic!!!
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public Map<String, Integer> getInventory() throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", Map.class);
|
||||
}
|
||||
return new HashMap<String, Integer>();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", Order.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", Order.class);
|
||||
}
|
||||
return new Order();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public Order placeOrder(Order body) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", Order.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", Order.class);
|
||||
}
|
||||
return new Order();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
package controllers;
|
||||
|
||||
import java.util.Map;
|
||||
import apimodels.Order;
|
||||
|
||||
import play.mvc.Http;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
public interface StoreApiControllerImpInterface {
|
||||
void deleteOrder(String orderId) throws Exception;
|
||||
|
||||
Map<String, Integer> getInventory() throws Exception;
|
||||
|
||||
Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception;
|
||||
|
||||
Order placeOrder(Order body) throws Exception;
|
||||
|
||||
}
|
||||
@@ -10,74 +10,50 @@ import java.util.HashMap;
|
||||
import java.io.FileInputStream;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
public class UserApiControllerImp implements UserApiControllerImpInterface {
|
||||
|
||||
private final ObjectMapper mapper;
|
||||
|
||||
@Inject
|
||||
private UserApiControllerImp() {
|
||||
mapper = new ObjectMapper();
|
||||
}
|
||||
|
||||
@Override
|
||||
public class UserApiControllerImp {
|
||||
|
||||
public void createUser(User body) throws Exception {
|
||||
//Do your magic!!!
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public void createUsersWithArrayInput(List<User> body) throws Exception {
|
||||
//Do your magic!!!
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public void createUsersWithListInput(List<User> body) throws Exception {
|
||||
//Do your magic!!!
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public void deleteUser(String username) throws Exception {
|
||||
//Do your magic!!!
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public User getUserByName(String username) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", User.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", User.class);
|
||||
}
|
||||
return new User();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public String loginUser( @NotNull String username, @NotNull String password) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", String.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", String.class);
|
||||
}
|
||||
return new String();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public void logoutUser() throws Exception {
|
||||
//Do your magic!!!
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public void updateUser(String username, User body) throws Exception {
|
||||
//Do your magic!!!
|
||||
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
package controllers;
|
||||
|
||||
import java.util.List;
|
||||
import apimodels.User;
|
||||
|
||||
import play.mvc.Http;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
public interface UserApiControllerImpInterface {
|
||||
void createUser(User body) throws Exception;
|
||||
|
||||
void createUsersWithArrayInput(List<User> body) throws Exception;
|
||||
|
||||
void createUsersWithListInput(List<User> body) throws Exception;
|
||||
|
||||
void deleteUser(String username) throws Exception;
|
||||
|
||||
User getUserByName(String username) throws Exception;
|
||||
|
||||
String loginUser( @NotNull String username, @NotNull String password) throws Exception;
|
||||
|
||||
void logoutUser() throws Exception;
|
||||
|
||||
void updateUser(String username, User body) throws Exception;
|
||||
|
||||
}
|
||||
@@ -6,10 +6,5 @@ lazy val root = (project in file(".")).enablePlugins(PlayJava)
|
||||
|
||||
scalaVersion := "2.11.7"
|
||||
|
||||
libraryDependencies ++= Seq(
|
||||
javaJdbc,
|
||||
cache,
|
||||
javaWs,
|
||||
"org.webjars" % "swagger-ui" % "2.2.10-1",
|
||||
"javax.validation" % "validation-api" % "1.1.0.Final"
|
||||
)
|
||||
libraryDependencies += "org.webjars" % "swagger-ui" % "2.2.10-1"
|
||||
libraryDependencies += "javax.validation" % "validation-api" % "1.1.0.Final"
|
||||
|
||||
@@ -59,7 +59,7 @@ play.modules {
|
||||
# in the root package (the "app" directory), or you can define them
|
||||
# explicitly below.
|
||||
# If there are any built-in modules that you want to disable, you can list them here.
|
||||
#disabled += ""
|
||||
disabled += "Module"
|
||||
}
|
||||
|
||||
## IDE
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
2017-08-08 13:00:28,358 [INFO] from play.api.Play in ForkJoinPool-1-worker-1 - Application started (Dev)
|
||||
@@ -173,6 +173,7 @@
|
||||
"security" : [ {
|
||||
"petstore_auth" : [ "write:pets", "read:pets" ]
|
||||
} ],
|
||||
"deprecated" : true,
|
||||
"x-contentType" : "application/json",
|
||||
"x-accepts" : "application/json"
|
||||
}
|
||||
@@ -749,7 +750,7 @@
|
||||
"title" : "Pet catehgry",
|
||||
"description" : "A category for a pet",
|
||||
"example" : {
|
||||
"name" : "aeiou",
|
||||
"name" : "name",
|
||||
"id" : 6
|
||||
},
|
||||
"xml" : {
|
||||
@@ -790,14 +791,14 @@
|
||||
"title" : "a User",
|
||||
"description" : "A User who is purchasing from the pet store",
|
||||
"example" : {
|
||||
"firstName" : "aeiou",
|
||||
"lastName" : "aeiou",
|
||||
"password" : "aeiou",
|
||||
"firstName" : "firstName",
|
||||
"lastName" : "lastName",
|
||||
"password" : "password",
|
||||
"userStatus" : 6,
|
||||
"phone" : "aeiou",
|
||||
"phone" : "phone",
|
||||
"id" : 0,
|
||||
"email" : "aeiou",
|
||||
"username" : "aeiou"
|
||||
"email" : "email",
|
||||
"username" : "username"
|
||||
},
|
||||
"xml" : {
|
||||
"name" : "User"
|
||||
@@ -817,7 +818,7 @@
|
||||
"title" : "Pet Tag",
|
||||
"description" : "A tag for a pet",
|
||||
"example" : {
|
||||
"name" : "aeiou",
|
||||
"name" : "name",
|
||||
"id" : 1
|
||||
},
|
||||
"xml" : {
|
||||
@@ -868,15 +869,18 @@
|
||||
"title" : "a Pet",
|
||||
"description" : "A pet for sale in the pet store",
|
||||
"example" : {
|
||||
"photoUrls" : [ "aeiou" ],
|
||||
"photoUrls" : [ "photoUrls", "photoUrls" ],
|
||||
"name" : "doggie",
|
||||
"id" : 0,
|
||||
"category" : {
|
||||
"name" : "aeiou",
|
||||
"name" : "name",
|
||||
"id" : 6
|
||||
},
|
||||
"tags" : [ {
|
||||
"name" : "aeiou",
|
||||
"name" : "name",
|
||||
"id" : 1
|
||||
}, {
|
||||
"name" : "name",
|
||||
"id" : 1
|
||||
} ],
|
||||
"status" : "available"
|
||||
@@ -903,8 +907,8 @@
|
||||
"description" : "Describes the result of uploading an image resource",
|
||||
"example" : {
|
||||
"code" : 0,
|
||||
"type" : "aeiou",
|
||||
"message" : "aeiou"
|
||||
"type" : "type",
|
||||
"message" : "message"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user