Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions api-reference/delete-plants.mdx

This file was deleted.

3 changes: 0 additions & 3 deletions api-reference/get-plants.mdx

This file was deleted.

196 changes: 101 additions & 95 deletions api-reference/openapi.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand All @@ -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<Pet> 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": {
Expand All @@ -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": {
Expand All @@ -157,67 +175,61 @@
},
"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"
}
]
}
}
},
"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"
},
Expand All @@ -226,12 +238,6 @@
}
}
}
},
"securitySchemes": {
"bearerAuth": {
"type": "http",
"scheme": "bearer"
}
}
}
}
3 changes: 3 additions & 0 deletions api-reference/pets/create-a-pet.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: post /pets
---
3 changes: 3 additions & 0 deletions api-reference/pets/info-for-a-specific-pet.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: get /pets/{petId}
---
3 changes: 3 additions & 0 deletions api-reference/pets/list-all-pets.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: get /pets
---
3 changes: 0 additions & 3 deletions api-reference/post-plants.mdx

This file was deleted.

21 changes: 17 additions & 4 deletions mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
]
Expand All @@ -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"
]
}
}
}
}