|
| 1 | +package io.swagger.petstore.resource; |
| 2 | + |
| 3 | +import io.swagger.petstore.data.PetData; |
| 4 | +import io.swagger.v3.oas.annotations.Hidden; |
| 5 | + |
| 6 | +import javax.ws.rs.GET; |
| 7 | +import javax.ws.rs.Path; |
| 8 | +import javax.ws.rs.Produces; |
| 9 | +import javax.ws.rs.core.MediaType; |
| 10 | +import javax.ws.rs.core.Response; |
| 11 | + |
| 12 | +@Path("/components/schemas/petdetails") |
| 13 | +@Produces({"application/json"}) |
| 14 | +public class PetDetailsResource { |
| 15 | + static PetData petData = new PetData(); |
| 16 | + |
| 17 | + @GET |
| 18 | + @Hidden |
| 19 | + public Response petDetails() { |
| 20 | + String json = "{\n" + |
| 21 | + " \"$id\": \"/api/v31/components/schemas/petdetails\",\n" + |
| 22 | + " \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n" + |
| 23 | + " \"$vocabulary\": \"https://spec.openapis.org/oas/3.1/schema-base\",\n" + |
| 24 | + " \"properties\": {\n" + |
| 25 | + " \"id\": {\n" + |
| 26 | + " \"type\": \"integer\",\n" + |
| 27 | + " \"format\": \"int64\",\n" + |
| 28 | + " \"$anchor\": \"pet_details_id\",\n" + |
| 29 | + " \"example\": 10\n" + |
| 30 | + " },\n" + |
| 31 | + " \"category\": {\n" + |
| 32 | + " \"$ref\": \"/api/v31/components/schemas/category\",\n" + |
| 33 | + " \"description\": \"PetDetails Category\"\n" + |
| 34 | + " },\n" + |
| 35 | + " \"tag\": {\n" + |
| 36 | + " \"$ref\": \"/api/v31/components/schemas/tag\"\n" + |
| 37 | + " }\n" + |
| 38 | + " },\n" + |
| 39 | + " \"xml\": {\n" + |
| 40 | + " \"name\": \"PetDetails\"\n" + |
| 41 | + " }\n" + |
| 42 | + "}"; |
| 43 | + |
| 44 | + return Response.ok(json, MediaType.APPLICATION_JSON).build(); |
| 45 | + } |
| 46 | +} |
0 commit comments