{
"openapi": "3.0.0",
"info": {
"title": "APIs For Thrift Store",
"version": "1.0.0"
},
"paths": {
"/api/index": {
"get": {
"tags": [
"SWAPI - The Star Wars API"
],
"summary": "List",
"operationId": "4bdfff290a85076be5a3374984012554",
"responses": {
"200": {
"description": "success",
"content": {
"application/json": {
"schema": {
"properties": {
"rows": {
"type": "array",
"items": {
"properties": {
"id": {
"type": "number",
"example": "1"
},
"category": {
"type": "string",
"example": "category"
},
"number": {
"type": "string",
"example": "number"
},
"detail": {
"type": "string",
"example": "detail"
},
"updated_at": {
"type": "string",
"example": "2021-12-11T09:25:53.000000Z"
},
"created_at": {
"type": "string",
"example": "2021-12-11T09:25:53.000000Z"
}
},
"type": "object"
}
}
},
"type": "object"
}
}
}
}
}
}
},
"/api/store": {
"post": {
"tags": [
"SWAPI - The Star Wars API"
],
"summary": "Store",
"operationId": "b803d01b1e52fe70deb4f060904c0574",
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"": {
"properties": {
"category": {
"type": "string"
},
"value": {
"type": "string"
}
},
"type": "string"
}
},
"type": "object",
"example": {
"category": "people, planets, starships",
"value": "1, 3, 9"
}
}
}
}
},
"responses": {
"200": {
"description": "success",
"content": {
"application/json": {
"schema": {
"properties": {
"id": {
"type": "number",
"example": 1
},
"category": {
"type": "string",
"example": "people, planets, starships"
},
"value": {
"type": "string",
"example": "1, 3, 9"
},
"detail": {
"type": "string",
"example": "{name: , rotation_period: 24, orbital_period: 4818, diameter: 10200, climate: temperate, tropical, gravity: 1 standard, terrain: jungle, rainforests, surface_water: 8, population: 1000, residents: [], films: [https://swapi.dev/api/films/1/], created: 2014-12-10T11:37:19.144000Z,edited: 2014-12-20T20:58:18.421000Z, url: https://swapi.dev/api/planets/3/ }"
},
"updated_at": {
"type": "string",
"example": "2021-12-11T09:25:53.000000Z"
},
"created_at": {
"type": "string",
"example": "2021-12-11T09:25:53.000000Z"
}
},
"type": "object"
}
}
}
},
"400": {
"description": "invalid",
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"example": "fail"
}
},
"type": "object"
}
}
}
}
}
}
},
"/api/get/{id}": {
"get": {
"tags": [
"SWAPI - The Star Wars API"
],
"summary": "Get Detail Product",
"operationId": "940b541442764c5975bc01b64c033afa",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "success",
"content": {
"application/json": {
"schema": {
"properties": {
"id": {
"type": "number",
"example": 1
},
"title": {
"type": "string",
"example": "title"
},
"detail": {
"type": "string",
"example": "detail"
},
"updated_at": {
"type": "string",
"example": "2021-12-11T09:25:53.000000Z"
},
"created_at": {
"type": "string",
"example": "2021-12-11T09:25:53.000000Z"
}
},
"type": "object"
}
}
}
}
}
}
},
"/api/update/{id}": {
"put": {
"tags": [
"SWAPI - The Star Wars API"
],
"summary": "Update",
"operationId": "94f1bc69d09b2c8f8292f6a124be3cfa",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"": {
"properties": {
"title": {
"type": "string"
},
"number": {
"type": "string"
},
"detail": {
"type": "string"
}
},
"type": "string"
}
},
"type": "object",
"example": {
"category": "category",
"number": "number",
"detail": "detail"
}
}
}
}
},
"responses": {
"200": {
"description": "success",
"content": {
"application/json": {
"schema": {
"properties": {
"id": {
"type": "number",
"example": 1
},
"category": {
"type": "string",
"example": "people, planets, starships"
},
"value": {
"type": "string",
"example": "1, 3, 9"
},
"detail": {
"type": "string",
"example": "{name: , rotation_period: 24, orbital_period: 4818, diameter: 10200, climate: temperate, tropical, gravity: 1 standard, terrain: jungle, rainforests, surface_water: 8, population: 1000, residents: [], films: [https://swapi.dev/api/films/1/], created: 2014-12-10T11:37:19.144000Z,edited: 2014-12-20T20:58:18.421000Z, url: https://swapi.dev/api/planets/3/ }"
},
"updated_at": {
"type": "string",
"example": "2021-12-11T09:25:53.000000Z"
},
"created_at": {
"type": "string",
"example": "2021-12-11T09:25:53.000000Z"
}
},
"type": "object"
}
}
}
},
"400": {
"description": "invalid",
"content": {
"application/json": {
"schema": {
"properties": {
"msg": {
"type": "string",
"example": "fail"
}
},
"type": "object"
}
}
}
}
}
}
},
"/api/delete/{id}": {
"delete": {
"tags": [
"SWAPI - The Star Wars API"
],
"summary": "Delete",
"operationId": "537f1ff6fa5c5fbc3393fbe0eda4408e",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "success",
"content": {
"application/json": {
"schema": {
"properties": {
"messsage": {
"type": "string",
"example": "delete product"
}
},
"type": "object"
}
}
}
}
}
}
}
},
"components": {
"securitySchemes": {
"bearerAuth": {
"type": "http",
"name": "bearerAuth",
"in": "header",
"bearerFormat": "JWT",
"scheme": "bearer"
}
}
}
}
|