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
@@ -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;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user