forked from loafle/openapi-generator-original
Merge branch 'update_java_server_samples'
This commit is contained in:
commit
39ae041975
@ -9,7 +9,7 @@
|
||||
"email" : "apiteam@swagger.io"
|
||||
},
|
||||
"license" : {
|
||||
"name" : "Apache 2.0",
|
||||
"name" : "Apache-2.0",
|
||||
"url" : "http://www.apache.org/licenses/LICENSE-2.0.html"
|
||||
}
|
||||
},
|
||||
@ -108,8 +108,8 @@
|
||||
"type" : "array",
|
||||
"items" : {
|
||||
"type" : "string",
|
||||
"enum" : [ "available", "pending", "sold" ],
|
||||
"default" : "available"
|
||||
"default" : "available",
|
||||
"enum" : [ "available", "pending", "sold" ]
|
||||
},
|
||||
"collectionFormat" : "csv"
|
||||
} ],
|
||||
|
@ -0,0 +1,35 @@
|
||||
package io.swagger.api;
|
||||
|
||||
import io.swagger.model.Client;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import org.apache.cxf.jaxrs.ext.multipart.*;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiResponses;
|
||||
import io.swagger.annotations.ApiResponse;
|
||||
import io.swagger.jaxrs.PATCH;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Path("/")
|
||||
@Api(value = "/", description = "")
|
||||
public interface AnotherFakeApi {
|
||||
|
||||
@PATCH
|
||||
@Path("/another-fake/dummy")
|
||||
@Consumes({ "application/json" })
|
||||
@Produces({ "application/json" })
|
||||
@ApiOperation(value = "To test special tags", tags={ "$another-fake?" })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Client.class) })
|
||||
public Client testSpecialTags(@Valid Client body);
|
||||
}
|
||||
|
@ -0,0 +1,27 @@
|
||||
package io.swagger.api.impl;
|
||||
|
||||
import io.swagger.api.*;
|
||||
import io.swagger.model.Client;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.Response;
|
||||
import org.apache.cxf.jaxrs.model.wadl.Description;
|
||||
import org.apache.cxf.jaxrs.model.wadl.DocTarget;
|
||||
|
||||
import org.apache.cxf.jaxrs.ext.multipart.*;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
|
||||
public class AnotherFakeApiServiceImpl implements AnotherFakeApi {
|
||||
public Client testSpecialTags(Client body) {
|
||||
// TODO: Implement...
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,88 @@
|
||||
/**
|
||||
* Swagger Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
package io.swagger.api;
|
||||
|
||||
import io.swagger.model.Client;
|
||||
import org.junit.Test;
|
||||
import org.junit.Before;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import javax.ws.rs.core.Response;
|
||||
import org.apache.cxf.jaxrs.client.JAXRSClientFactory;
|
||||
import org.apache.cxf.jaxrs.client.ClientConfiguration;
|
||||
import org.apache.cxf.jaxrs.client.WebClient;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* API tests for AnotherFakeApi
|
||||
*/
|
||||
public class AnotherFakeApiTest {
|
||||
|
||||
|
||||
private AnotherFakeApi api;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
JacksonJsonProvider provider = new JacksonJsonProvider();
|
||||
List providers = new ArrayList();
|
||||
providers.add(provider);
|
||||
|
||||
api = JAXRSClientFactory.create("http://petstore.swagger.io:80/v2", AnotherFakeApi.class, providers);
|
||||
org.apache.cxf.jaxrs.client.Client client = WebClient.client(api);
|
||||
|
||||
ClientConfiguration config = WebClient.getConfig(client);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* To test special tags
|
||||
*
|
||||
* To test special tags
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void testSpecialTagsTest() {
|
||||
Client body = null;
|
||||
//Client response = api.testSpecialTags(body);
|
||||
//assertNotNull(response);
|
||||
// TODO: test validations
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -9,6 +9,15 @@
|
||||
<build>
|
||||
<sourceDirectory>src/main/java</sourceDirectory>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.6.1</version>
|
||||
<configuration>
|
||||
<source>1.7</source>
|
||||
<target>1.7</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
|
@ -9,6 +9,15 @@
|
||||
<build>
|
||||
<sourceDirectory>src/main/java</sourceDirectory>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.6.1</version>
|
||||
<configuration>
|
||||
<source>1.7</source>
|
||||
<target>1.7</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
|
@ -9,7 +9,7 @@
|
||||
"email" : "apiteam@swagger.io"
|
||||
},
|
||||
"license" : {
|
||||
"name" : "Apache 2.0",
|
||||
"name" : "Apache-2.0",
|
||||
"url" : "http://www.apache.org/licenses/LICENSE-2.0.html"
|
||||
}
|
||||
},
|
||||
@ -108,8 +108,8 @@
|
||||
"type" : "array",
|
||||
"items" : {
|
||||
"type" : "string",
|
||||
"enum" : [ "available", "pending", "sold" ],
|
||||
"default" : "available"
|
||||
"default" : "available",
|
||||
"enum" : [ "available", "pending", "sold" ]
|
||||
},
|
||||
"collectionFormat" : "csv"
|
||||
} ],
|
||||
@ -680,8 +680,8 @@
|
||||
"type" : "array",
|
||||
"items" : {
|
||||
"type" : "string",
|
||||
"enum" : [ ">", "$" ],
|
||||
"default" : "$"
|
||||
"default" : "$",
|
||||
"enum" : [ ">", "$" ]
|
||||
}
|
||||
}, {
|
||||
"name" : "enum_form_string",
|
||||
@ -699,8 +699,8 @@
|
||||
"type" : "array",
|
||||
"items" : {
|
||||
"type" : "string",
|
||||
"enum" : [ ">", "$" ],
|
||||
"default" : "$"
|
||||
"default" : "$",
|
||||
"enum" : [ ">", "$" ]
|
||||
}
|
||||
}, {
|
||||
"name" : "enum_header_string",
|
||||
@ -718,8 +718,8 @@
|
||||
"type" : "array",
|
||||
"items" : {
|
||||
"type" : "string",
|
||||
"enum" : [ ">", "$" ],
|
||||
"default" : "$"
|
||||
"default" : "$",
|
||||
"enum" : [ ">", "$" ]
|
||||
}
|
||||
}, {
|
||||
"name" : "enum_query_string",
|
||||
|
@ -9,7 +9,7 @@
|
||||
"email" : "apiteam@swagger.io"
|
||||
},
|
||||
"license" : {
|
||||
"name" : "Apache 2.0",
|
||||
"name" : "Apache-2.0",
|
||||
"url" : "http://www.apache.org/licenses/LICENSE-2.0.html"
|
||||
}
|
||||
},
|
||||
@ -108,8 +108,8 @@
|
||||
"type" : "array",
|
||||
"items" : {
|
||||
"type" : "string",
|
||||
"enum" : [ "available", "pending", "sold" ],
|
||||
"default" : "available"
|
||||
"default" : "available",
|
||||
"enum" : [ "available", "pending", "sold" ]
|
||||
},
|
||||
"collectionFormat" : "csv"
|
||||
} ],
|
||||
@ -680,8 +680,8 @@
|
||||
"type" : "array",
|
||||
"items" : {
|
||||
"type" : "string",
|
||||
"enum" : [ ">", "$" ],
|
||||
"default" : "$"
|
||||
"default" : "$",
|
||||
"enum" : [ ">", "$" ]
|
||||
}
|
||||
}, {
|
||||
"name" : "enum_form_string",
|
||||
@ -699,8 +699,8 @@
|
||||
"type" : "array",
|
||||
"items" : {
|
||||
"type" : "string",
|
||||
"enum" : [ ">", "$" ],
|
||||
"default" : "$"
|
||||
"default" : "$",
|
||||
"enum" : [ ">", "$" ]
|
||||
}
|
||||
}, {
|
||||
"name" : "enum_header_string",
|
||||
@ -718,8 +718,8 @@
|
||||
"type" : "array",
|
||||
"items" : {
|
||||
"type" : "string",
|
||||
"enum" : [ ">", "$" ],
|
||||
"default" : "$"
|
||||
"default" : "$",
|
||||
"enum" : [ ">", "$" ]
|
||||
}
|
||||
}, {
|
||||
"name" : "enum_query_string",
|
||||
|
@ -0,0 +1,50 @@
|
||||
package io.swagger.api;
|
||||
|
||||
import io.swagger.model.*;
|
||||
import io.swagger.api.AnotherFakeApiService;
|
||||
import io.swagger.api.factories.AnotherFakeApiServiceFactory;
|
||||
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.jaxrs.*;
|
||||
|
||||
import com.sun.jersey.multipart.FormDataParam;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import io.swagger.model.Client;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import io.swagger.api.NotFoundException;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
import com.sun.jersey.core.header.FormDataContentDisposition;
|
||||
import com.sun.jersey.multipart.FormDataParam;
|
||||
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.SecurityContext;
|
||||
import javax.ws.rs.*;
|
||||
|
||||
@Path("/AnotherFake")
|
||||
|
||||
|
||||
@io.swagger.annotations.Api(description = "the AnotherFake API")
|
||||
|
||||
public class AnotherFakeApi {
|
||||
private final AnotherFakeApiService delegate = AnotherFakeApiServiceFactory.getAnotherFakeApi();
|
||||
|
||||
@PATCH
|
||||
|
||||
@Consumes({ "application/json" })
|
||||
@Produces({ "application/json" })
|
||||
@io.swagger.annotations.ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?" })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) })
|
||||
public Response testSpecialTags(
|
||||
@ApiParam(value = "client model" ,required=true) Client body,
|
||||
@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.testSpecialTags(body,securityContext);
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package io.swagger.api;
|
||||
|
||||
import io.swagger.api.*;
|
||||
import io.swagger.model.*;
|
||||
|
||||
import com.sun.jersey.multipart.FormDataParam;
|
||||
|
||||
import io.swagger.model.Client;
|
||||
|
||||
import java.util.List;
|
||||
import io.swagger.api.NotFoundException;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
import com.sun.jersey.core.header.FormDataContentDisposition;
|
||||
import com.sun.jersey.multipart.FormDataParam;
|
||||
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.SecurityContext;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
public abstract class AnotherFakeApiService {
|
||||
public abstract Response testSpecialTags(Client body,SecurityContext securityContext)
|
||||
throws NotFoundException;
|
||||
}
|
@ -20,7 +20,7 @@ public class Bootstrap extends HttpServlet {
|
||||
.contact(new Contact()
|
||||
.email("apiteam@swagger.io"))
|
||||
.license(new License()
|
||||
.name("Apache 2.0")
|
||||
.name("Apache-2.0")
|
||||
.url("http://www.apache.org/licenses/LICENSE-2.0.html"));
|
||||
|
||||
ServletContext context = config.getServletContext();
|
||||
|
@ -0,0 +1,13 @@
|
||||
package io.swagger.api.factories;
|
||||
|
||||
import io.swagger.api.AnotherFakeApiService;
|
||||
import io.swagger.api.impl.AnotherFakeApiServiceImpl;
|
||||
|
||||
|
||||
public class AnotherFakeApiServiceFactory {
|
||||
private final static AnotherFakeApiService service = new AnotherFakeApiServiceImpl();
|
||||
|
||||
public static AnotherFakeApiService getAnotherFakeApi() {
|
||||
return service;
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package io.swagger.api.impl;
|
||||
|
||||
import io.swagger.api.*;
|
||||
import io.swagger.model.*;
|
||||
|
||||
import com.sun.jersey.multipart.FormDataParam;
|
||||
|
||||
import io.swagger.model.Client;
|
||||
|
||||
import java.util.List;
|
||||
import io.swagger.api.NotFoundException;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
import com.sun.jersey.core.header.FormDataContentDisposition;
|
||||
import com.sun.jersey.multipart.FormDataParam;
|
||||
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.SecurityContext;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
public class AnotherFakeApiServiceImpl extends AnotherFakeApiService {
|
||||
@Override
|
||||
public Response testSpecialTags(Client body, SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
// do some magic!
|
||||
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
|
||||
}
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
package io.swagger.api;
|
||||
|
||||
import io.swagger.model.*;
|
||||
import io.swagger.api.AnotherFakeApiService;
|
||||
import io.swagger.api.factories.AnotherFakeApiServiceFactory;
|
||||
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.jaxrs.*;
|
||||
|
||||
import com.sun.jersey.multipart.FormDataParam;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import io.swagger.model.Client;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import io.swagger.api.NotFoundException;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
import com.sun.jersey.core.header.FormDataContentDisposition;
|
||||
import com.sun.jersey.multipart.FormDataParam;
|
||||
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.SecurityContext;
|
||||
import javax.ws.rs.*;
|
||||
|
||||
@Path("/another-fake")
|
||||
|
||||
|
||||
@io.swagger.annotations.Api(description = "the another-fake API")
|
||||
|
||||
public class AnotherFakeApi {
|
||||
private final AnotherFakeApiService delegate = AnotherFakeApiServiceFactory.getAnotherFakeApi();
|
||||
|
||||
@PATCH
|
||||
@Path("/dummy")
|
||||
@Consumes({ "application/json" })
|
||||
@Produces({ "application/json" })
|
||||
@io.swagger.annotations.ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?" })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) })
|
||||
public Response testSpecialTags(
|
||||
@ApiParam(value = "client model" ,required=true) Client body,
|
||||
@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.testSpecialTags(body,securityContext);
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package io.swagger.api;
|
||||
|
||||
import io.swagger.api.*;
|
||||
import io.swagger.model.*;
|
||||
|
||||
import com.sun.jersey.multipart.FormDataParam;
|
||||
|
||||
import io.swagger.model.Client;
|
||||
|
||||
import java.util.List;
|
||||
import io.swagger.api.NotFoundException;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
import com.sun.jersey.core.header.FormDataContentDisposition;
|
||||
import com.sun.jersey.multipart.FormDataParam;
|
||||
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.SecurityContext;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
public abstract class AnotherFakeApiService {
|
||||
public abstract Response testSpecialTags(Client body,SecurityContext securityContext)
|
||||
throws NotFoundException;
|
||||
}
|
@ -20,7 +20,7 @@ public class Bootstrap extends HttpServlet {
|
||||
.contact(new Contact()
|
||||
.email("apiteam@swagger.io"))
|
||||
.license(new License()
|
||||
.name("Apache 2.0")
|
||||
.name("Apache-2.0")
|
||||
.url("http://www.apache.org/licenses/LICENSE-2.0.html"));
|
||||
|
||||
ServletContext context = config.getServletContext();
|
||||
|
@ -0,0 +1,13 @@
|
||||
package io.swagger.api.factories;
|
||||
|
||||
import io.swagger.api.AnotherFakeApiService;
|
||||
import io.swagger.api.impl.AnotherFakeApiServiceImpl;
|
||||
|
||||
|
||||
public class AnotherFakeApiServiceFactory {
|
||||
private final static AnotherFakeApiService service = new AnotherFakeApiServiceImpl();
|
||||
|
||||
public static AnotherFakeApiService getAnotherFakeApi() {
|
||||
return service;
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package io.swagger.api.impl;
|
||||
|
||||
import io.swagger.api.*;
|
||||
import io.swagger.model.*;
|
||||
|
||||
import com.sun.jersey.multipart.FormDataParam;
|
||||
|
||||
import io.swagger.model.Client;
|
||||
|
||||
import java.util.List;
|
||||
import io.swagger.api.NotFoundException;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
import com.sun.jersey.core.header.FormDataContentDisposition;
|
||||
import com.sun.jersey.multipart.FormDataParam;
|
||||
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.SecurityContext;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
public class AnotherFakeApiServiceImpl extends AnotherFakeApiService {
|
||||
@Override
|
||||
public Response testSpecialTags(Client body, SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
// do some magic!
|
||||
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
|
||||
}
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package io.swagger.api;
|
||||
|
||||
import io.swagger.model.*;
|
||||
import io.swagger.api.AnotherFakeApiService;
|
||||
import io.swagger.api.factories.AnotherFakeApiServiceFactory;
|
||||
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.jaxrs.*;
|
||||
|
||||
import io.swagger.model.Client;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import io.swagger.api.NotFoundException;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
|
||||
import org.glassfish.jersey.media.multipart.FormDataParam;
|
||||
|
||||
import javax.servlet.ServletConfig;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.SecurityContext;
|
||||
import javax.ws.rs.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Path("/AnotherFake")
|
||||
|
||||
|
||||
@io.swagger.annotations.Api(description = "the AnotherFake API")
|
||||
|
||||
public class AnotherFakeApi {
|
||||
private final AnotherFakeApiService delegate;
|
||||
|
||||
public AnotherFakeApi(@Context ServletConfig servletContext) {
|
||||
AnotherFakeApiService delegate = null;
|
||||
|
||||
if (servletContext != null) {
|
||||
String implClass = servletContext.getInitParameter("AnotherFakeApi.implementation");
|
||||
if (implClass != null && !"".equals(implClass.trim())) {
|
||||
try {
|
||||
delegate = (AnotherFakeApiService) Class.forName(implClass).newInstance();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (delegate == null) {
|
||||
delegate = AnotherFakeApiServiceFactory.getAnotherFakeApi();
|
||||
}
|
||||
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
@PATCH
|
||||
|
||||
@Consumes({ "application/json" })
|
||||
@Produces({ "application/json" })
|
||||
@io.swagger.annotations.ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) })
|
||||
public Response testSpecialTags(@ApiParam(value = "client model" ,required=true) Client body
|
||||
,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.testSpecialTags(body,securityContext);
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package io.swagger.api;
|
||||
|
||||
import io.swagger.api.*;
|
||||
import io.swagger.model.*;
|
||||
|
||||
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
|
||||
|
||||
import io.swagger.model.Client;
|
||||
|
||||
import java.util.List;
|
||||
import io.swagger.api.NotFoundException;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.SecurityContext;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
public abstract class AnotherFakeApiService {
|
||||
public abstract Response testSpecialTags(Client body,SecurityContext securityContext) throws NotFoundException;
|
||||
}
|
@ -20,7 +20,7 @@ public class Bootstrap extends HttpServlet {
|
||||
.contact(new Contact()
|
||||
.email("apiteam@swagger.io"))
|
||||
.license(new License()
|
||||
.name("Apache 2.0")
|
||||
.name("Apache-2.0")
|
||||
.url("http://www.apache.org/licenses/LICENSE-2.0.html"));
|
||||
|
||||
ServletContext context = config.getServletContext();
|
||||
|
@ -0,0 +1,13 @@
|
||||
package io.swagger.api.factories;
|
||||
|
||||
import io.swagger.api.AnotherFakeApiService;
|
||||
import io.swagger.api.impl.AnotherFakeApiServiceImpl;
|
||||
|
||||
|
||||
public class AnotherFakeApiServiceFactory {
|
||||
private final static AnotherFakeApiService service = new AnotherFakeApiServiceImpl();
|
||||
|
||||
public static AnotherFakeApiService getAnotherFakeApi() {
|
||||
return service;
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package io.swagger.api.impl;
|
||||
|
||||
import io.swagger.api.*;
|
||||
import io.swagger.model.*;
|
||||
|
||||
import io.swagger.model.Client;
|
||||
|
||||
import java.util.List;
|
||||
import io.swagger.api.NotFoundException;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
|
||||
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.SecurityContext;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
public class AnotherFakeApiServiceImpl extends AnotherFakeApiService {
|
||||
@Override
|
||||
public Response testSpecialTags(Client body, SecurityContext securityContext) throws NotFoundException {
|
||||
// do some magic!
|
||||
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
|
||||
}
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package io.swagger.api;
|
||||
|
||||
import io.swagger.model.*;
|
||||
import io.swagger.api.AnotherFakeApiService;
|
||||
import io.swagger.api.factories.AnotherFakeApiServiceFactory;
|
||||
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.jaxrs.*;
|
||||
|
||||
import io.swagger.model.Client;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import io.swagger.api.NotFoundException;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
|
||||
import org.glassfish.jersey.media.multipart.FormDataParam;
|
||||
|
||||
import javax.servlet.ServletConfig;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.SecurityContext;
|
||||
import javax.ws.rs.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Path("/another-fake")
|
||||
|
||||
|
||||
@io.swagger.annotations.Api(description = "the another-fake API")
|
||||
|
||||
public class AnotherFakeApi {
|
||||
private final AnotherFakeApiService delegate;
|
||||
|
||||
public AnotherFakeApi(@Context ServletConfig servletContext) {
|
||||
AnotherFakeApiService delegate = null;
|
||||
|
||||
if (servletContext != null) {
|
||||
String implClass = servletContext.getInitParameter("AnotherFakeApi.implementation");
|
||||
if (implClass != null && !"".equals(implClass.trim())) {
|
||||
try {
|
||||
delegate = (AnotherFakeApiService) Class.forName(implClass).newInstance();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (delegate == null) {
|
||||
delegate = AnotherFakeApiServiceFactory.getAnotherFakeApi();
|
||||
}
|
||||
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
@PATCH
|
||||
@Path("/dummy")
|
||||
@Consumes({ "application/json" })
|
||||
@Produces({ "application/json" })
|
||||
@io.swagger.annotations.ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) })
|
||||
public Response testSpecialTags(@ApiParam(value = "client model" ,required=true) Client body
|
||||
,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.testSpecialTags(body,securityContext);
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package io.swagger.api;
|
||||
|
||||
import io.swagger.api.*;
|
||||
import io.swagger.model.*;
|
||||
|
||||
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
|
||||
|
||||
import io.swagger.model.Client;
|
||||
|
||||
import java.util.List;
|
||||
import io.swagger.api.NotFoundException;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.SecurityContext;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
public abstract class AnotherFakeApiService {
|
||||
public abstract Response testSpecialTags(Client body,SecurityContext securityContext) throws NotFoundException;
|
||||
}
|
@ -20,7 +20,7 @@ public class Bootstrap extends HttpServlet {
|
||||
.contact(new Contact()
|
||||
.email("apiteam@swagger.io"))
|
||||
.license(new License()
|
||||
.name("Apache 2.0")
|
||||
.name("Apache-2.0")
|
||||
.url("http://www.apache.org/licenses/LICENSE-2.0.html"));
|
||||
|
||||
ServletContext context = config.getServletContext();
|
||||
|
@ -0,0 +1,13 @@
|
||||
package io.swagger.api.factories;
|
||||
|
||||
import io.swagger.api.AnotherFakeApiService;
|
||||
import io.swagger.api.impl.AnotherFakeApiServiceImpl;
|
||||
|
||||
|
||||
public class AnotherFakeApiServiceFactory {
|
||||
private final static AnotherFakeApiService service = new AnotherFakeApiServiceImpl();
|
||||
|
||||
public static AnotherFakeApiService getAnotherFakeApi() {
|
||||
return service;
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package io.swagger.api.impl;
|
||||
|
||||
import io.swagger.api.*;
|
||||
import io.swagger.model.*;
|
||||
|
||||
import io.swagger.model.Client;
|
||||
|
||||
import java.util.List;
|
||||
import io.swagger.api.NotFoundException;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
|
||||
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.SecurityContext;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
public class AnotherFakeApiServiceImpl extends AnotherFakeApiService {
|
||||
@Override
|
||||
public Response testSpecialTags(Client body, SecurityContext securityContext) throws NotFoundException {
|
||||
// do some magic!
|
||||
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
|
||||
}
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program (2.3.0-SNAPSHOT).
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package io.swagger.api;
|
||||
|
||||
import io.swagger.model.Client;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
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.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import java.io.IOException;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Api(value = "another-fake", description = "the another-fake API")
|
||||
public interface AnotherFakeApi {
|
||||
|
||||
@ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Client.class) })
|
||||
@RequestMapping(value = "/another-fake/dummy",
|
||||
produces = { "application/json" },
|
||||
consumes = { "application/json" },
|
||||
method = RequestMethod.PATCH)
|
||||
default CompletableFuture<ResponseEntity<Client>> testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception {
|
||||
// do some magic!
|
||||
return CompletableFuture.completedFuture(new ResponseEntity<Client>(HttpStatus.OK));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package io.swagger.api;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import java.io.IOException;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Controller
|
||||
public class AnotherFakeApiController implements AnotherFakeApi {
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
public AnotherFakeApiController(ObjectMapper objectMapper) {
|
||||
this.objectMapper = objectMapper;
|
||||
}
|
||||
|
||||
}
|
@ -18,7 +18,7 @@ public class SwaggerDocumentationConfig {
|
||||
return new ApiInfoBuilder()
|
||||
.title("Swagger Petstore")
|
||||
.description("This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\")
|
||||
.license("Apache 2.0")
|
||||
.license("Apache-2.0")
|
||||
.licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html")
|
||||
.termsOfServiceUrl("")
|
||||
.version("1.0.0")
|
||||
|
@ -33,7 +33,7 @@ public class AdditionalPropertiesClass {
|
||||
|
||||
public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) {
|
||||
if (this.mapProperty == null) {
|
||||
this.mapProperty = new HashMap<String, String>();
|
||||
this.mapProperty = new HashMap<>();
|
||||
}
|
||||
this.mapProperty.put(key, mapPropertyItem);
|
||||
return this;
|
||||
@ -61,7 +61,7 @@ public class AdditionalPropertiesClass {
|
||||
|
||||
public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map<String, String> mapOfMapPropertyItem) {
|
||||
if (this.mapOfMapProperty == null) {
|
||||
this.mapOfMapProperty = new HashMap<String, Map<String, String>>();
|
||||
this.mapOfMapProperty = new HashMap<>();
|
||||
}
|
||||
this.mapOfMapProperty.put(key, mapOfMapPropertyItem);
|
||||
return this;
|
||||
|
@ -29,7 +29,7 @@ public class ArrayOfArrayOfNumberOnly {
|
||||
|
||||
public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List<BigDecimal> arrayArrayNumberItem) {
|
||||
if (this.arrayArrayNumber == null) {
|
||||
this.arrayArrayNumber = new ArrayList<List<BigDecimal>>();
|
||||
this.arrayArrayNumber = new ArrayList<>();
|
||||
}
|
||||
this.arrayArrayNumber.add(arrayArrayNumberItem);
|
||||
return this;
|
||||
|
@ -29,7 +29,7 @@ public class ArrayOfNumberOnly {
|
||||
|
||||
public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) {
|
||||
if (this.arrayNumber == null) {
|
||||
this.arrayNumber = new ArrayList<BigDecimal>();
|
||||
this.arrayNumber = new ArrayList<>();
|
||||
}
|
||||
this.arrayNumber.add(arrayNumberItem);
|
||||
return this;
|
||||
|
@ -37,7 +37,7 @@ public class ArrayTest {
|
||||
|
||||
public ArrayTest addArrayOfStringItem(String arrayOfStringItem) {
|
||||
if (this.arrayOfString == null) {
|
||||
this.arrayOfString = new ArrayList<String>();
|
||||
this.arrayOfString = new ArrayList<>();
|
||||
}
|
||||
this.arrayOfString.add(arrayOfStringItem);
|
||||
return this;
|
||||
@ -65,7 +65,7 @@ public class ArrayTest {
|
||||
|
||||
public ArrayTest addArrayArrayOfIntegerItem(List<Long> arrayArrayOfIntegerItem) {
|
||||
if (this.arrayArrayOfInteger == null) {
|
||||
this.arrayArrayOfInteger = new ArrayList<List<Long>>();
|
||||
this.arrayArrayOfInteger = new ArrayList<>();
|
||||
}
|
||||
this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem);
|
||||
return this;
|
||||
@ -94,7 +94,7 @@ public class ArrayTest {
|
||||
|
||||
public ArrayTest addArrayArrayOfModelItem(List<ReadOnlyFirst> arrayArrayOfModelItem) {
|
||||
if (this.arrayArrayOfModel == null) {
|
||||
this.arrayArrayOfModel = new ArrayList<List<ReadOnlyFirst>>();
|
||||
this.arrayArrayOfModel = new ArrayList<>();
|
||||
}
|
||||
this.arrayArrayOfModel.add(arrayArrayOfModelItem);
|
||||
return this;
|
||||
|
@ -114,7 +114,7 @@ public class EnumArrays {
|
||||
|
||||
public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) {
|
||||
if (this.arrayEnum == null) {
|
||||
this.arrayEnum = new ArrayList<ArrayEnumEnum>();
|
||||
this.arrayEnum = new ArrayList<>();
|
||||
}
|
||||
this.arrayEnum.add(arrayEnumItem);
|
||||
return this;
|
||||
|
@ -65,7 +65,7 @@ public class MapTest {
|
||||
|
||||
public MapTest putMapMapOfStringItem(String key, Map<String, String> mapMapOfStringItem) {
|
||||
if (this.mapMapOfString == null) {
|
||||
this.mapMapOfString = new HashMap<String, Map<String, String>>();
|
||||
this.mapMapOfString = new HashMap<>();
|
||||
}
|
||||
this.mapMapOfString.put(key, mapMapOfStringItem);
|
||||
return this;
|
||||
@ -94,7 +94,7 @@ public class MapTest {
|
||||
|
||||
public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) {
|
||||
if (this.mapOfEnumString == null) {
|
||||
this.mapOfEnumString = new HashMap<String, InnerEnum>();
|
||||
this.mapOfEnumString = new HashMap<>();
|
||||
}
|
||||
this.mapOfEnumString.put(key, mapOfEnumStringItem);
|
||||
return this;
|
||||
|
@ -80,7 +80,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
|
||||
|
||||
public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) {
|
||||
if (this.map == null) {
|
||||
this.map = new HashMap<String, Animal>();
|
||||
this.map = new HashMap<>();
|
||||
}
|
||||
this.map.put(key, mapItem);
|
||||
return this;
|
||||
|
@ -31,7 +31,7 @@ public class Pet {
|
||||
|
||||
@JsonProperty("photoUrls")
|
||||
@Valid
|
||||
private List<String> photoUrls = new ArrayList<String>();
|
||||
private List<String> photoUrls = new ArrayList<>();
|
||||
|
||||
@JsonProperty("tags")
|
||||
@Valid
|
||||
@ -168,7 +168,7 @@ public class Pet {
|
||||
|
||||
public Pet addTagsItem(Tag tagsItem) {
|
||||
if (this.tags == null) {
|
||||
this.tags = new ArrayList<Tag>();
|
||||
this.tags = new ArrayList<>();
|
||||
}
|
||||
this.tags.add(tagsItem);
|
||||
return this;
|
||||
|
@ -0,0 +1,39 @@
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program (2.3.0-SNAPSHOT).
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package io.swagger.api;
|
||||
|
||||
import io.swagger.model.Client;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
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.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import java.io.IOException;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Api(value = "another-fake", description = "the another-fake API")
|
||||
public interface AnotherFakeApi {
|
||||
|
||||
@ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Client.class) })
|
||||
@RequestMapping(value = "/another-fake/dummy",
|
||||
produces = { "application/json" },
|
||||
consumes = { "application/json" },
|
||||
method = RequestMethod.PATCH)
|
||||
ResponseEntity<Client> testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception;
|
||||
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package io.swagger.api;
|
||||
|
||||
import io.swagger.model.Client;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
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.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import java.io.IOException;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Controller
|
||||
public class AnotherFakeApiController implements AnotherFakeApi {
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
public AnotherFakeApiController(ObjectMapper objectMapper) {
|
||||
this.objectMapper = objectMapper;
|
||||
}
|
||||
|
||||
public ResponseEntity<Client> testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body,
|
||||
@RequestHeader(value = "Accept", required = false) String accept) throws Exception {
|
||||
// do some magic!
|
||||
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return new ResponseEntity<Client>(objectMapper.readValue("{ \"client\" : \"client\"}", Client.class), HttpStatus.OK);
|
||||
}
|
||||
|
||||
return new ResponseEntity<Client>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
@ -18,7 +18,7 @@ public class SwaggerDocumentationConfig {
|
||||
return new ApiInfoBuilder()
|
||||
.title("Swagger Petstore")
|
||||
.description("This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\")
|
||||
.license("Apache 2.0")
|
||||
.license("Apache-2.0")
|
||||
.licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html")
|
||||
.termsOfServiceUrl("")
|
||||
.version("1.0.0")
|
||||
|
@ -0,0 +1,39 @@
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program (2.3.0-SNAPSHOT).
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package io.swagger.api;
|
||||
|
||||
import io.swagger.model.Client;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
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.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import java.io.IOException;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Api(value = "another-fake", description = "the another-fake API")
|
||||
public interface AnotherFakeApi {
|
||||
|
||||
@ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Client.class) })
|
||||
@RequestMapping(value = "/another-fake/dummy",
|
||||
produces = { "application/json" },
|
||||
consumes = { "application/json" },
|
||||
method = RequestMethod.PATCH)
|
||||
ResponseEntity<Client> testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception;
|
||||
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package io.swagger.api;
|
||||
|
||||
import io.swagger.model.Client;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
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.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import java.io.IOException;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Controller
|
||||
public class AnotherFakeApiController implements AnotherFakeApi {
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
public AnotherFakeApiController(ObjectMapper objectMapper) {
|
||||
this.objectMapper = objectMapper;
|
||||
}
|
||||
|
||||
public ResponseEntity<Client> testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body,
|
||||
@RequestHeader(value = "Accept", required = false) String accept) throws Exception {
|
||||
// do some magic!
|
||||
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return new ResponseEntity<Client>(objectMapper.readValue("{ \"client\" : \"client\"}", Client.class), HttpStatus.OK);
|
||||
}
|
||||
|
||||
return new ResponseEntity<Client>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
@ -18,7 +18,7 @@ public class SwaggerDocumentationConfig {
|
||||
return new ApiInfoBuilder()
|
||||
.title("Swagger Petstore")
|
||||
.description("This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\")
|
||||
.license("Apache 2.0")
|
||||
.license("Apache-2.0")
|
||||
.licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html")
|
||||
.termsOfServiceUrl("")
|
||||
.version("1.0.0")
|
||||
|
@ -0,0 +1,43 @@
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program (2.3.0-SNAPSHOT).
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package io.swagger.api;
|
||||
|
||||
import io.swagger.model.Client;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
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.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import java.io.IOException;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Api(value = "another-fake", description = "the another-fake API")
|
||||
public interface AnotherFakeApi {
|
||||
|
||||
@ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Client.class) })
|
||||
@RequestMapping(value = "/another-fake/dummy",
|
||||
produces = { "application/json" },
|
||||
consumes = { "application/json" },
|
||||
method = RequestMethod.PATCH)
|
||||
default ResponseEntity<Client> testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception {
|
||||
// do some magic!
|
||||
return new ResponseEntity<Client>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package io.swagger.api;
|
||||
|
||||
import io.swagger.model.Client;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
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.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import java.io.IOException;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Controller
|
||||
public class AnotherFakeApiController implements AnotherFakeApi {
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
public AnotherFakeApiController(ObjectMapper objectMapper) {
|
||||
this.objectMapper = objectMapper;
|
||||
}
|
||||
|
||||
private final AnotherFakeApiDelegate delegate;
|
||||
|
||||
@org.springframework.beans.factory.annotation.Autowired
|
||||
public AnotherFakeApiController(AnotherFakeApiDelegate delegate) {
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
public ResponseEntity<Client> testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body,
|
||||
@RequestHeader(value = "Accept", required = false) String accept) throws Exception {
|
||||
// do some magic!
|
||||
return delegate.testSpecialTags(body);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package io.swagger.api;
|
||||
|
||||
import io.swagger.model.Client;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* A delegate to be called by the {@link AnotherFakeApiController}}.
|
||||
* Should be implemented as a controller but without the {@link org.springframework.stereotype.Controller} annotation.
|
||||
* Instead, use spring to autowire this class into the {@link AnotherFakeApiController}.
|
||||
*/
|
||||
|
||||
public interface AnotherFakeApiDelegate {
|
||||
|
||||
/**
|
||||
* @see AnotherFakeApi#testSpecialTags
|
||||
*/
|
||||
default ResponseEntity<Client> testSpecialTags(Client body) {
|
||||
// do some magic!
|
||||
return new ResponseEntity<Client>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
@ -18,7 +18,7 @@ public class SwaggerDocumentationConfig {
|
||||
return new ApiInfoBuilder()
|
||||
.title("Swagger Petstore")
|
||||
.description("This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\")
|
||||
.license("Apache 2.0")
|
||||
.license("Apache-2.0")
|
||||
.licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html")
|
||||
.termsOfServiceUrl("")
|
||||
.version("1.0.0")
|
||||
|
@ -33,7 +33,7 @@ public class AdditionalPropertiesClass {
|
||||
|
||||
public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) {
|
||||
if (this.mapProperty == null) {
|
||||
this.mapProperty = new HashMap<String, String>();
|
||||
this.mapProperty = new HashMap<>();
|
||||
}
|
||||
this.mapProperty.put(key, mapPropertyItem);
|
||||
return this;
|
||||
@ -61,7 +61,7 @@ public class AdditionalPropertiesClass {
|
||||
|
||||
public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map<String, String> mapOfMapPropertyItem) {
|
||||
if (this.mapOfMapProperty == null) {
|
||||
this.mapOfMapProperty = new HashMap<String, Map<String, String>>();
|
||||
this.mapOfMapProperty = new HashMap<>();
|
||||
}
|
||||
this.mapOfMapProperty.put(key, mapOfMapPropertyItem);
|
||||
return this;
|
||||
|
@ -29,7 +29,7 @@ public class ArrayOfArrayOfNumberOnly {
|
||||
|
||||
public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List<BigDecimal> arrayArrayNumberItem) {
|
||||
if (this.arrayArrayNumber == null) {
|
||||
this.arrayArrayNumber = new ArrayList<List<BigDecimal>>();
|
||||
this.arrayArrayNumber = new ArrayList<>();
|
||||
}
|
||||
this.arrayArrayNumber.add(arrayArrayNumberItem);
|
||||
return this;
|
||||
|
@ -29,7 +29,7 @@ public class ArrayOfNumberOnly {
|
||||
|
||||
public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) {
|
||||
if (this.arrayNumber == null) {
|
||||
this.arrayNumber = new ArrayList<BigDecimal>();
|
||||
this.arrayNumber = new ArrayList<>();
|
||||
}
|
||||
this.arrayNumber.add(arrayNumberItem);
|
||||
return this;
|
||||
|
@ -37,7 +37,7 @@ public class ArrayTest {
|
||||
|
||||
public ArrayTest addArrayOfStringItem(String arrayOfStringItem) {
|
||||
if (this.arrayOfString == null) {
|
||||
this.arrayOfString = new ArrayList<String>();
|
||||
this.arrayOfString = new ArrayList<>();
|
||||
}
|
||||
this.arrayOfString.add(arrayOfStringItem);
|
||||
return this;
|
||||
@ -65,7 +65,7 @@ public class ArrayTest {
|
||||
|
||||
public ArrayTest addArrayArrayOfIntegerItem(List<Long> arrayArrayOfIntegerItem) {
|
||||
if (this.arrayArrayOfInteger == null) {
|
||||
this.arrayArrayOfInteger = new ArrayList<List<Long>>();
|
||||
this.arrayArrayOfInteger = new ArrayList<>();
|
||||
}
|
||||
this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem);
|
||||
return this;
|
||||
@ -94,7 +94,7 @@ public class ArrayTest {
|
||||
|
||||
public ArrayTest addArrayArrayOfModelItem(List<ReadOnlyFirst> arrayArrayOfModelItem) {
|
||||
if (this.arrayArrayOfModel == null) {
|
||||
this.arrayArrayOfModel = new ArrayList<List<ReadOnlyFirst>>();
|
||||
this.arrayArrayOfModel = new ArrayList<>();
|
||||
}
|
||||
this.arrayArrayOfModel.add(arrayArrayOfModelItem);
|
||||
return this;
|
||||
|
@ -114,7 +114,7 @@ public class EnumArrays {
|
||||
|
||||
public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) {
|
||||
if (this.arrayEnum == null) {
|
||||
this.arrayEnum = new ArrayList<ArrayEnumEnum>();
|
||||
this.arrayEnum = new ArrayList<>();
|
||||
}
|
||||
this.arrayEnum.add(arrayEnumItem);
|
||||
return this;
|
||||
|
@ -65,7 +65,7 @@ public class MapTest {
|
||||
|
||||
public MapTest putMapMapOfStringItem(String key, Map<String, String> mapMapOfStringItem) {
|
||||
if (this.mapMapOfString == null) {
|
||||
this.mapMapOfString = new HashMap<String, Map<String, String>>();
|
||||
this.mapMapOfString = new HashMap<>();
|
||||
}
|
||||
this.mapMapOfString.put(key, mapMapOfStringItem);
|
||||
return this;
|
||||
@ -94,7 +94,7 @@ public class MapTest {
|
||||
|
||||
public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) {
|
||||
if (this.mapOfEnumString == null) {
|
||||
this.mapOfEnumString = new HashMap<String, InnerEnum>();
|
||||
this.mapOfEnumString = new HashMap<>();
|
||||
}
|
||||
this.mapOfEnumString.put(key, mapOfEnumStringItem);
|
||||
return this;
|
||||
|
@ -80,7 +80,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
|
||||
|
||||
public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) {
|
||||
if (this.map == null) {
|
||||
this.map = new HashMap<String, Animal>();
|
||||
this.map = new HashMap<>();
|
||||
}
|
||||
this.map.put(key, mapItem);
|
||||
return this;
|
||||
|
@ -31,7 +31,7 @@ public class Pet {
|
||||
|
||||
@JsonProperty("photoUrls")
|
||||
@Valid
|
||||
private List<String> photoUrls = new ArrayList<String>();
|
||||
private List<String> photoUrls = new ArrayList<>();
|
||||
|
||||
@JsonProperty("tags")
|
||||
@Valid
|
||||
@ -168,7 +168,7 @@ public class Pet {
|
||||
|
||||
public Pet addTagsItem(Tag tagsItem) {
|
||||
if (this.tags == null) {
|
||||
this.tags = new ArrayList<Tag>();
|
||||
this.tags = new ArrayList<>();
|
||||
}
|
||||
this.tags.add(tagsItem);
|
||||
return this;
|
||||
|
@ -0,0 +1,39 @@
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program (2.3.0-SNAPSHOT).
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package io.swagger.api;
|
||||
|
||||
import io.swagger.model.Client;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
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.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import java.io.IOException;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Api(value = "another-fake", description = "the another-fake API")
|
||||
public interface AnotherFakeApi {
|
||||
|
||||
@ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Client.class) })
|
||||
@RequestMapping(value = "/another-fake/dummy",
|
||||
produces = { "application/json" },
|
||||
consumes = { "application/json" },
|
||||
method = RequestMethod.PATCH)
|
||||
ResponseEntity<Client> testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception;
|
||||
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package io.swagger.api;
|
||||
|
||||
import io.swagger.model.Client;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
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.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import java.io.IOException;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Controller
|
||||
public class AnotherFakeApiController implements AnotherFakeApi {
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
public AnotherFakeApiController(ObjectMapper objectMapper) {
|
||||
this.objectMapper = objectMapper;
|
||||
}
|
||||
|
||||
private final AnotherFakeApiDelegate delegate;
|
||||
|
||||
@org.springframework.beans.factory.annotation.Autowired
|
||||
public AnotherFakeApiController(AnotherFakeApiDelegate delegate) {
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
public ResponseEntity<Client> testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body,
|
||||
@RequestHeader(value = "Accept", required = false) String accept) throws Exception {
|
||||
// do some magic!
|
||||
return delegate.testSpecialTags(body);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package io.swagger.api;
|
||||
|
||||
import io.swagger.model.Client;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* A delegate to be called by the {@link AnotherFakeApiController}}.
|
||||
* Should be implemented as a controller but without the {@link org.springframework.stereotype.Controller} annotation.
|
||||
* Instead, use spring to autowire this class into the {@link AnotherFakeApiController}.
|
||||
*/
|
||||
|
||||
public interface AnotherFakeApiDelegate {
|
||||
|
||||
/**
|
||||
* @see AnotherFakeApi#testSpecialTags
|
||||
*/
|
||||
ResponseEntity<Client> testSpecialTags(Client body);
|
||||
|
||||
}
|
@ -18,7 +18,7 @@ public class SwaggerDocumentationConfig {
|
||||
return new ApiInfoBuilder()
|
||||
.title("Swagger Petstore")
|
||||
.description("This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\")
|
||||
.license("Apache 2.0")
|
||||
.license("Apache-2.0")
|
||||
.licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html")
|
||||
.termsOfServiceUrl("")
|
||||
.version("1.0.0")
|
||||
|
@ -0,0 +1,42 @@
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program (2.3.0-SNAPSHOT).
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package io.swagger.api;
|
||||
|
||||
import io.swagger.model.Client;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
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.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import java.io.IOException;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Api(value = "another-fake", description = "the another-fake API")
|
||||
public interface AnotherFakeApi {
|
||||
|
||||
@ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Client.class) })
|
||||
@ApiImplicitParams({
|
||||
|
||||
})
|
||||
@RequestMapping(value = "/another-fake/dummy",
|
||||
produces = { "application/json" },
|
||||
consumes = { "application/json" },
|
||||
method = RequestMethod.PATCH)
|
||||
ResponseEntity<Client> testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception;
|
||||
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package io.swagger.api;
|
||||
|
||||
import io.swagger.model.Client;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
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.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import java.io.IOException;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Controller
|
||||
public class AnotherFakeApiController implements AnotherFakeApi {
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
public AnotherFakeApiController(ObjectMapper objectMapper) {
|
||||
this.objectMapper = objectMapper;
|
||||
}
|
||||
|
||||
public ResponseEntity<Client> testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body,
|
||||
@RequestHeader(value = "Accept", required = false) String accept) throws Exception {
|
||||
// do some magic!
|
||||
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return new ResponseEntity<Client>(objectMapper.readValue("{ \"client\" : \"client\"}", Client.class), HttpStatus.OK);
|
||||
}
|
||||
|
||||
return new ResponseEntity<Client>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
@ -18,7 +18,7 @@ public class SwaggerDocumentationConfig {
|
||||
return new ApiInfoBuilder()
|
||||
.title("Swagger Petstore")
|
||||
.description("This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\")
|
||||
.license("Apache 2.0")
|
||||
.license("Apache-2.0")
|
||||
.licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html")
|
||||
.termsOfServiceUrl("")
|
||||
.version("1.0.0")
|
||||
|
@ -0,0 +1,40 @@
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program (2.3.0-SNAPSHOT).
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package io.swagger.api;
|
||||
|
||||
import io.swagger.model.Client;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
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.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import java.io.IOException;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Api(value = "another-fake", description = "the another-fake API")
|
||||
public interface AnotherFakeApi {
|
||||
|
||||
@ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Client.class) })
|
||||
@RequestMapping(value = "/another-fake/dummy",
|
||||
produces = { "application/json" },
|
||||
consumes = { "application/json" },
|
||||
method = RequestMethod.PATCH)
|
||||
ResponseEntity<Client> testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception;
|
||||
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package io.swagger.api;
|
||||
|
||||
import io.swagger.model.Client;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
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.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import java.io.IOException;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Controller
|
||||
public class AnotherFakeApiController implements AnotherFakeApi {
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
public AnotherFakeApiController(ObjectMapper objectMapper) {
|
||||
this.objectMapper = objectMapper;
|
||||
}
|
||||
|
||||
public ResponseEntity<Client> testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body,
|
||||
@RequestHeader(value = "Accept", required = false) String accept) throws Exception {
|
||||
// do some magic!
|
||||
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return new ResponseEntity<Client>(objectMapper.readValue("{ \"client\" : \"client\"}", Client.class), HttpStatus.OK);
|
||||
}
|
||||
|
||||
return new ResponseEntity<Client>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
@ -18,7 +18,7 @@ public class SwaggerDocumentationConfig {
|
||||
return new ApiInfoBuilder()
|
||||
.title("Swagger Petstore")
|
||||
.description("This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\")
|
||||
.license("Apache 2.0")
|
||||
.license("Apache-2.0")
|
||||
.licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html")
|
||||
.termsOfServiceUrl("")
|
||||
.version("1.0.0")
|
||||
|
@ -0,0 +1,39 @@
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program (2.3.0-SNAPSHOT).
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package io.swagger.api;
|
||||
|
||||
import io.swagger.model.Client;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
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.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import java.io.IOException;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Api(value = "another-fake", description = "the another-fake API")
|
||||
public interface AnotherFakeApi {
|
||||
|
||||
@ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Client.class) })
|
||||
@RequestMapping(value = "/another-fake/dummy",
|
||||
produces = { "application/json" },
|
||||
consumes = { "application/json" },
|
||||
method = RequestMethod.PATCH)
|
||||
ResponseEntity<Client> testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception;
|
||||
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package io.swagger.api;
|
||||
|
||||
import io.swagger.model.Client;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
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.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import java.io.IOException;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Controller
|
||||
public class AnotherFakeApiController implements AnotherFakeApi {
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
public AnotherFakeApiController(ObjectMapper objectMapper) {
|
||||
this.objectMapper = objectMapper;
|
||||
}
|
||||
|
||||
public ResponseEntity<Client> testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body,
|
||||
@RequestHeader(value = "Accept", required = false) String accept) throws Exception {
|
||||
// do some magic!
|
||||
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return new ResponseEntity<Client>(objectMapper.readValue("{ \"client\" : \"client\"}", Client.class), HttpStatus.OK);
|
||||
}
|
||||
|
||||
return new ResponseEntity<Client>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
@ -18,7 +18,7 @@ public class SwaggerDocumentationConfig {
|
||||
return new ApiInfoBuilder()
|
||||
.title("Swagger Petstore")
|
||||
.description("This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\")
|
||||
.license("Apache 2.0")
|
||||
.license("Apache-2.0")
|
||||
.licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html")
|
||||
.termsOfServiceUrl("")
|
||||
.version("1.0.0")
|
||||
|
Loading…
x
Reference in New Issue
Block a user