-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'update_java_server_samples'
- Loading branch information
Showing
70 changed files
with
1,410 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
"email" : "[email protected]" | ||
}, | ||
"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" | ||
} ], | ||
|
35 changes: 35 additions & 0 deletions
35
samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/AnotherFakeApi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
|
27 changes: 27 additions & 0 deletions
27
...erver/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
|
||
} | ||
|
88 changes: 88 additions & 0 deletions
88
samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/AnotherFakeApiTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: [email protected] | ||
* | ||
* 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 | ||
|
||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
"email" : "[email protected]" | ||
}, | ||
"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", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
"email" : "[email protected]" | ||
}, | ||
"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", | ||
|
50 changes: 50 additions & 0 deletions
50
...les/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/AnotherFakeApi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...ver/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/AnotherFakeApiService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ public void init(ServletConfig config) throws ServletException { | |
.contact(new Contact() | ||
.email("[email protected]")) | ||
.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(); | ||
|
Oops, something went wrong.