diff --git a/api-reference/delete-plants.mdx b/api-reference/delete-plants.mdx deleted file mode 100644 index cbd6b1c..0000000 --- a/api-reference/delete-plants.mdx +++ /dev/null @@ -1,3 +0,0 @@ ---- -openapi: delete /plants/{id} ---- \ No newline at end of file diff --git a/api-reference/get-plants.mdx b/api-reference/get-plants.mdx deleted file mode 100644 index 40fd931..0000000 --- a/api-reference/get-plants.mdx +++ /dev/null @@ -1,3 +0,0 @@ ---- -openapi: get /plants ---- \ No newline at end of file diff --git a/api-reference/openapi.json b/api-reference/openapi.json index a4e3031..77e69cf 100644 --- a/api-reference/openapi.json +++ b/api-reference/openapi.json @@ -1,54 +1,59 @@ { - "openapi": "3.0.1", + "openapi": "3.0.0", "info": { - "title": "OpenAPI Plant Store", - "description": "A sample API that uses a plant store as an example to demonstrate features in the OpenAPI specification", + "version": "1.0.0", + "title": "Swagger Petstore", "license": { "name": "MIT" - }, - "version": "1.0.0" + } }, "servers": [ { - "url": "http://sandbox.mintlify.com" - } - ], - "security": [ - { - "bearerAuth": [] + "url": "http://petstore.swagger.io/v1" } ], "paths": { - "/plants": { + "/pets": { "get": { - "description": "Returns all plants from the system that the user has access to", + "summary": "List all pets", + "operationId": "listPets", + "tags": [ + "pets" + ], "parameters": [ { "name": "limit", "in": "query", - "description": "The maximum number of results to return", + "description": "How many items to return at one time (max 100)", + "required": false, "schema": { "type": "integer", + "maximum": 100, "format": "int32" } } ], "responses": { "200": { - "description": "Plant response", + "description": "A paged array of pets", + "headers": { + "x-next": { + "description": "A link to the next page of responses", + "schema": { + "type": "string" + } + } + }, "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Plant" - } + "$ref": "#/components/schemas/Pets" } } } }, - "400": { - "description": "Unexpected error", + "default": { + "description": "unexpected error", "content": { "application/json": { "schema": { @@ -60,44 +65,44 @@ }, "x-codeSamples": [ { - "lang": "Go", - "source": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/swagger-api/swagger-petstore/pkg/testsdkconfig\"\n \"github.com/swagger-api/swagger-petstore/pkg/testsdk\"\n \"github.com/swagger-api/swagger-petstore/pkg/plants\"\n)\n\nconfig := testsdkconfig.NewConfig()\nclient := testsdk.NewTestSdk(config)\n\n\nparams := plants.GetPlantsRequestParams{}\n\n\nresponse, err := client.Plants.GetPlants(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Print(response)" + "source": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/swagger-api/swagger-petstore/pkg/testsdkconfig\"\n \"github.com/swagger-api/swagger-petstore/pkg/testsdk\"\n \"github.com/swagger-api/swagger-petstore/pkg/pets\"\n)\n\nconfig := testsdkconfig.NewConfig()\nclient := testsdk.NewTestSdk(config)\n\n\nparams := pets.ListPetsRequestParams{}\n\n\nresponse, err := client.Pets.ListPets(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)", + "lang": "Go" }, { - "lang": "TypeScript", - "source": "import { TestSdk } from 'test-sdk';\n\n(async () => {\n const testSdk = new TestSdk({\n token: 'YOUR_TOKEN',\n });\n\n const { data } = await testSdk.plants.getPlants({\n limit: 8,\n });\n\n console.log(data);\n})();" + "source": "import { TestSdk } from 'test-sdk';\n\n(async () => {\n const testSdk = new TestSdk({\n token: 'YOUR_TOKEN',\n });\n\n const { data } = await testSdk.pets.listPets({\n limit: 31,\n });\n\n console.log(data);\n})();", + "lang": "TypeScript" }, { - "lang": "Python", - "source": "from test_sdk import TestSdk, Environment\n\nsdk = TestSdk(\n access_token=\"YOUR_ACCESS_TOKEN\",\n base_url=Environment.DEFAULT.value,\n timeout=10000\n)\n\nresult = sdk.plants.get_plants(limit=8)\n\nprint(result)" + "source": "from test_sdk import TestSdk\n\nsdk = TestSdk(\n access_token=\"YOUR_ACCESS_TOKEN\",\n timeout=10000\n)\n\nresult = sdk.pets.list_pets(limit=85)\n\nprint(result)", + "lang": "Python" + }, + { + "source": "import com.swagger.petstore.TestSdk;\nimport com.swagger.petstore.config.TestSdkConfig;\nimport com.swagger.petstore.models.ListPetsParameters;\nimport com.swagger.petstore.models.Pet;\nimport java.util.List;\n\npublic class Main {\n\n public static void main(String[] args) {\n TestSdkConfig config = TestSdkConfig.builder().accessToken(\"YOUR_ACCESS_TOKEN\").build();\n\n TestSdk testSdk = new TestSdk(config);\n\n ListPetsParameters requestParameters = ListPetsParameters.builder().limit(85L).build();\n\n List response = testSdk.pets.listPets(requestParameters);\n\n System.out.println(response);\n }\n}", + "lang": "Java" } ] }, "post": { - "description": "Creates a new plant in the store", + "summary": "Create a pet", + "operationId": "createPets", + "tags": [ + "pets" + ], "requestBody": { - "description": "Plant to add to the store", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NewPlant" + "$ref": "#/components/schemas/Pet" } } }, "required": true }, "responses": { - "200": { - "description": "plant response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Plant" - } - } - } + "201": { + "description": "Null response" }, - "400": { + "default": { "description": "unexpected error", "content": { "application/json": { @@ -110,41 +115,54 @@ }, "x-codeSamples": [ { - "lang": "Go", - "source": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/swagger-api/swagger-petstore/pkg/testsdkconfig\"\n \"github.com/swagger-api/swagger-petstore/pkg/testsdk\"\n \"github.com/swagger-api/swagger-petstore/pkg/plants\"\n)\n\nconfig := testsdkconfig.NewConfig()\nclient := testsdk.NewTestSdk(config)\n\n\nrequest := plants.NewPlant{}\nrequest.SetName(\"Name\")\nrequest.SetId(int64(123))\n\nresponse, err := client.Plants.CreatePlants(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Print(response)" + "source": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/swagger-api/swagger-petstore/pkg/testsdkconfig\"\n \"github.com/swagger-api/swagger-petstore/pkg/testsdk\"\n \"github.com/swagger-api/swagger-petstore/pkg/pets\"\n)\n\nconfig := testsdkconfig.NewConfig()\nclient := testsdk.NewTestSdk(config)\n\n\nrequest := pets.Pet{}\nrequest.SetId(int64(123))\nrequest.SetName(\"Name\")\nrequest.SetTag(\"Tag\")\n\nresponse, err := client.Pets.CreatePets(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)", + "lang": "Go" + }, + { + "source": "import { Pet, TestSdk } from 'test-sdk';\n\n(async () => {\n const testSdk = new TestSdk({\n token: 'YOUR_TOKEN',\n });\n\n const pet: Pet = {\n id: 8,\n name: 'name',\n tag: 'tag',\n };\n\n const { data } = await testSdk.pets.createPets(pet);\n\n console.log(data);\n})();", + "lang": "TypeScript" }, { - "lang": "TypeScript", - "source": "import { NewPlant, TestSdk } from 'test-sdk';\n\n(async () => {\n const testSdk = new TestSdk({\n token: 'YOUR_TOKEN',\n });\n\n const newPlant: NewPlant = {\n name: 'name',\n tag: 'tag',\n id: 2,\n };\n\n const { data } = await testSdk.plants.createPlants(input);\n\n console.log(data);\n})();" + "source": "from test_sdk import TestSdk\nfrom test_sdk.models import Pet\n\nsdk = TestSdk(\n access_token=\"YOUR_ACCESS_TOKEN\",\n timeout=10000\n)\n\nrequest_body = Pet(\n id_=8,\n name=\"name\",\n tag=\"tag\"\n)\n\nresult = sdk.pets.create_pets(request_body=request_body)\n\nprint(result)", + "lang": "Python" }, { - "lang": "Python", - "source": "from test_sdk import TestSdk, Environment\nfrom test_sdk.models import NewPlant\n\nsdk = TestSdk(\n access_token=\"YOUR_ACCESS_TOKEN\",\n base_url=Environment.DEFAULT.value,\n timeout=10000\n)\n\nrequest_body = NewPlant(\n name=\"name\",\n tag=\"tag\",\n id_=2\n)\n\nresult = sdk.plants.create_plants(request_body=request_body)\n\nprint(result)" + "source": "import com.swagger.petstore.TestSdk;\nimport com.swagger.petstore.config.TestSdkConfig;\nimport com.swagger.petstore.models.Pet;\n\npublic class Main {\n\n public static void main(String[] args) {\n TestSdkConfig config = TestSdkConfig.builder().accessToken(\"YOUR_ACCESS_TOKEN\").build();\n\n TestSdk testSdk = new TestSdk(config);\n\n Pet pet = Pet.builder().id(8L).name(\"name\").tag(\"tag\").build();\n\n testSdk.pets.createPets(pet);\n }\n}", + "lang": "Java" } ] } }, - "/plants/{id}": { - "delete": { - "description": "Deletes a single plant based on the ID supplied", + "/pets/{petId}": { + "get": { + "summary": "Info for a specific pet", + "operationId": "showPetById", + "tags": [ + "pets" + ], "parameters": [ { - "name": "id", + "name": "petId", "in": "path", - "description": "ID of plant to delete", "required": true, + "description": "The id of the pet to retrieve", "schema": { - "type": "integer", - "format": "int64" + "type": "string" } } ], "responses": { - "204": { - "description": "Plant deleted", - "content": {} + "200": { + "description": "Expected response to a valid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + } + } }, - "400": { + "default": { "description": "unexpected error", "content": { "application/json": { @@ -157,16 +175,20 @@ }, "x-codeSamples": [ { - "lang": "Go", - "source": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/swagger-api/swagger-petstore/pkg/testsdkconfig\"\n \"github.com/swagger-api/swagger-petstore/pkg/testsdk\"\n)\n\nconfig := testsdkconfig.NewConfig()\nclient := testsdk.NewTestSdk(config)\n\nresponse, err := client.Plants.DeletePlantsById(context.Background(), int64(1234))\nif err != nil {\n panic(err)\n}\n\nfmt.Print(response)" + "source": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/swagger-api/swagger-petstore/pkg/testsdkconfig\"\n \"github.com/swagger-api/swagger-petstore/pkg/testsdk\"\n)\n\nconfig := testsdkconfig.NewConfig()\nclient := testsdk.NewTestSdk(config)\n\nresponse, err := client.Pets.ShowPetById(context.Background(), \"petId\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)", + "lang": "Go" }, { - "lang": "TypeScript", - "source": "import { TestSdk } from 'test-sdk';\n\n(async () => {\n const testSdk = new TestSdk({\n token: 'YOUR_TOKEN',\n });\n\n const { data } = await testSdk.plants.deletePlantsById(9);\n\n console.log(data);\n})();" + "source": "import { TestSdk } from 'test-sdk';\n\n(async () => {\n const testSdk = new TestSdk({\n token: 'YOUR_TOKEN',\n });\n\n const { data } = await testSdk.pets.showPetById('petId');\n\n console.log(data);\n})();", + "lang": "TypeScript" }, { - "lang": "Python", - "source": "from test_sdk import TestSdk, Environment\n\nsdk = TestSdk(\n access_token=\"YOUR_ACCESS_TOKEN\",\n base_url=Environment.DEFAULT.value,\n timeout=10000\n)\n\nresult = sdk.plants.delete_plants_by_id(id_=3)\n\nprint(result)" + "source": "from test_sdk import TestSdk\n\nsdk = TestSdk(\n access_token=\"YOUR_ACCESS_TOKEN\",\n timeout=10000\n)\n\nresult = sdk.pets.show_pet_by_id(pet_id=\"petId\")\n\nprint(result)", + "lang": "Python" + }, + { + "source": "import com.swagger.petstore.TestSdk;\nimport com.swagger.petstore.config.TestSdkConfig;\nimport com.swagger.petstore.models.Pet;\n\npublic class Main {\n\n public static void main(String[] args) {\n TestSdkConfig config = TestSdkConfig.builder().accessToken(\"YOUR_ACCESS_TOKEN\").build();\n\n TestSdk testSdk = new TestSdk(config);\n\n Pet response = testSdk.pets.showPetById(\"petId\");\n\n System.out.println(response);\n }\n}", + "lang": "Java" } ] } @@ -174,50 +196,40 @@ }, "components": { "schemas": { - "Plant": { + "Pet": { + "type": "object", "required": [ + "id", "name" ], - "type": "object", "properties": { + "id": { + "type": "integer", + "format": "int64" + }, "name": { - "description": "The name of the plant", "type": "string" }, "tag": { - "description": "Tag to specify the type", "type": "string" } } }, - "NewPlant": { - "allOf": [ - { - "$ref": "#/components/schemas/Plant" - }, - { - "required": [ - "id" - ], - "type": "object", - "properties": { - "id": { - "description": "Identification number of the plant", - "type": "integer", - "format": "int64" - } - } - } - ] + "Pets": { + "type": "array", + "maxItems": 100, + "items": { + "$ref": "#/components/schemas/Pet" + } }, "Error": { + "type": "object", "required": [ - "error", + "code", "message" ], - "type": "object", "properties": { - "error": { + "code": { "type": "integer", "format": "int32" }, @@ -226,12 +238,6 @@ } } } - }, - "securitySchemes": { - "bearerAuth": { - "type": "http", - "scheme": "bearer" - } } } } \ No newline at end of file diff --git a/api-reference/pets/create-a-pet.mdx b/api-reference/pets/create-a-pet.mdx new file mode 100644 index 0000000..9aefeb4 --- /dev/null +++ b/api-reference/pets/create-a-pet.mdx @@ -0,0 +1,3 @@ +--- +openapi: post /pets +--- \ No newline at end of file diff --git a/api-reference/pets/info-for-a-specific-pet.mdx b/api-reference/pets/info-for-a-specific-pet.mdx new file mode 100644 index 0000000..28acb69 --- /dev/null +++ b/api-reference/pets/info-for-a-specific-pet.mdx @@ -0,0 +1,3 @@ +--- +openapi: get /pets/{petId} +--- \ No newline at end of file diff --git a/api-reference/pets/list-all-pets.mdx b/api-reference/pets/list-all-pets.mdx new file mode 100644 index 0000000..b4c2a48 --- /dev/null +++ b/api-reference/pets/list-all-pets.mdx @@ -0,0 +1,3 @@ +--- +openapi: get /pets +--- \ No newline at end of file diff --git a/api-reference/post-plants.mdx b/api-reference/post-plants.mdx deleted file mode 100644 index ebdb49e..0000000 --- a/api-reference/post-plants.mdx +++ /dev/null @@ -1,3 +0,0 @@ ---- -openapi: post /plants ---- \ No newline at end of file diff --git a/mint.json b/mint.json index e2d0560..1f96fd3 100644 --- a/mint.json +++ b/mint.json @@ -78,11 +78,11 @@ "group": "api reference", "pages": [ { - "group": "API Reference", + "group": "pets", "pages": [ - "api-reference/get-plants", - "api-reference/post-plants", - "api-reference/delete-plants" + "api-reference/pets/list-all-pets", + "api-reference/pets/create-a-pet", + "api-reference/pets/info-for-a-specific-pet" ] } ] @@ -100,5 +100,18 @@ "x": "https://x.com/mintlify", "github": "https://github.com/mintlify", "linkedin": "https://www.linkedin.com/company/mintsearch" + }, + "api": { + "request": { + "example": { + "languages": [ + "bash", + "Go", + "Java", + "Python", + "TypeScript" + ] + } + } } } \ No newline at end of file