-
Notifications
You must be signed in to change notification settings - Fork 362
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
147 additions
and
21 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
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
42 changes: 42 additions & 0 deletions
42
src/main/java/io/swagger/petstore/resource/CategoryResource.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,42 @@ | ||
package io.swagger.petstore.resource; | ||
|
||
import io.swagger.petstore.data.PetData; | ||
import io.swagger.v3.oas.annotations.Hidden; | ||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.Produces; | ||
import javax.ws.rs.core.MediaType; | ||
import javax.ws.rs.core.Response; | ||
|
||
@Path("/components/schemas/category") | ||
@Produces({"application/json"}) | ||
public class CategoryResource { | ||
static PetData petData = new PetData(); | ||
|
||
@GET | ||
@Hidden | ||
public Response category() { | ||
String json = "{\n" + | ||
" \"Category\" : {\n" + | ||
" \"$id\" : \"/api/v31/components/schemas/category\",\n" + | ||
" \"description\" : \"Category\",\n" + | ||
" \"properties\" : {\n" + | ||
" \"id\" : {\n" + | ||
" \"type\" : \"integer\",\n" + | ||
" \"format\" : \"int64\",\n" + | ||
" \"example\" : 1\n" + | ||
" },\n" + | ||
" \"name\" : {\n" + | ||
" \"type\" : \"string\",\n" + | ||
" \"example\" : \"Dogs\"\n" + | ||
" }\n" + | ||
" },\n" + | ||
" \"xml\" : {\n" + | ||
" \"name\" : \"Category\"\n" + | ||
" }\n" + | ||
" }\n" + | ||
"}"; | ||
|
||
return Response.ok(json, MediaType.APPLICATION_JSON).build(); | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
src/main/java/io/swagger/petstore/resource/PetDetailsResource.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,46 @@ | ||
package io.swagger.petstore.resource; | ||
|
||
import io.swagger.petstore.data.PetData; | ||
import io.swagger.v3.oas.annotations.Hidden; | ||
|
||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.Produces; | ||
import javax.ws.rs.core.MediaType; | ||
import javax.ws.rs.core.Response; | ||
|
||
@Path("/components/schemas/petdetails") | ||
@Produces({"application/json"}) | ||
public class PetDetailsResource { | ||
static PetData petData = new PetData(); | ||
|
||
@GET | ||
@Hidden | ||
public Response petDetails() { | ||
String json = "{\n" + | ||
" \"$id\": \"/api/v31/components/schemas/petdetails\",\n" + | ||
" \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n" + | ||
" \"$vocabulary\": \"https://spec.openapis.org/oas/3.1/schema-base\",\n" + | ||
" \"properties\": {\n" + | ||
" \"id\": {\n" + | ||
" \"type\": \"integer\",\n" + | ||
" \"format\": \"int64\",\n" + | ||
" \"$anchor\": \"pet_details_id\",\n" + | ||
" \"example\": 10\n" + | ||
" },\n" + | ||
" \"category\": {\n" + | ||
" \"$ref\": \"/api/v31/components/schemas/category\",\n" + | ||
" \"description\": \"PetDetails Category\"\n" + | ||
" },\n" + | ||
" \"tag\": {\n" + | ||
" \"$ref\": \"/api/v31/components/schemas/tag\"\n" + | ||
" }\n" + | ||
" },\n" + | ||
" \"xml\": {\n" + | ||
" \"name\": \"PetDetails\"\n" + | ||
" }\n" + | ||
"}"; | ||
|
||
return Response.ok(json, MediaType.APPLICATION_JSON).build(); | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
src/main/java/io/swagger/petstore/resource/TagResource.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,38 @@ | ||
package io.swagger.petstore.resource; | ||
|
||
import io.swagger.petstore.data.PetData; | ||
import io.swagger.v3.oas.annotations.Hidden; | ||
|
||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.Produces; | ||
import javax.ws.rs.core.MediaType; | ||
import javax.ws.rs.core.Response; | ||
|
||
@Path("/components/schemas/tag") | ||
@Produces({"application/json"}) | ||
public class TagResource { | ||
static PetData petData = new PetData(); | ||
|
||
@GET | ||
@Hidden | ||
public Response tag() { | ||
String json = "{\n" + | ||
" \"$id\": \"/api/v3/components/schemas/tag\",\n" + | ||
" \"properties\": {\n" + | ||
" \"id\": {\n" + | ||
" \"type\": \"integer\",\n" + | ||
" \"format\": \"int64\"\n" + | ||
" },\n" + | ||
" \"name\": {\n" + | ||
" \"type\": \"string\"\n" + | ||
" }\n" + | ||
" },\n" + | ||
" \"xml\": {\n" + | ||
" \"name\": \"Tag\"\n" + | ||
" }\n" + | ||
"}"; | ||
|
||
return Response.ok(json, MediaType.APPLICATION_JSON).build(); | ||
} | ||
} |
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