From d9d86d188eca9ce4256214aaf9135151dc8b3818 Mon Sep 17 00:00:00 2001 From: "mintlify[bot]" <109931778+mintlify[bot]@users.noreply.github.com> Date: Thu, 21 Nov 2024 18:26:38 +0000 Subject: [PATCH] Documentation edits made through Mintlify web editor --- api-playground/openapi/setup.mdx | 79 +++++++++++++++++++++++++++++++- mint.json | 19 ++++++-- 2 files changed, 92 insertions(+), 6 deletions(-) diff --git a/api-playground/openapi/setup.mdx b/api-playground/openapi/setup.mdx index da05693..dd61d19 100644 --- a/api-playground/openapi/setup.mdx +++ b/api-playground/openapi/setup.mdx @@ -10,6 +10,83 @@ document in either JSON or YAML format that follows the [OpenAPI specification](https://swagger.io/specification/). Your document must follow OpenAPI specification 3.0+. +## OpenAPI File Formats + +OpenAPI specifications can be written in either YAML or JSON format. Both formats are equally valid and contain the same information - choose the one that best fits your workflow. + +### YAML Format + +YAML is often preferred for its readability and concise syntax: + +```yaml +openapi: 3.0.0 +info: + title: Sample API + version: 1.0.0 +paths: + /users: + get: + summary: Returns a list of users + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: array + items: + type: object + properties: + id: + type: integer + name: + type: string +``` + +### JSON Format + +JSON format is also widely used, especially when working with JavaScript tools: + +```json +{ + "openapi": "3.0.0", + "info": { + "title": "Sample API", + "version": "1.0.0" + }, + "paths": { + "/users": { + "get": { + "summary": "Returns a list of users", + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } +} +``` + ## Autogenerating the API playground You can either [autogenerate the API playground](/settings/navigation#tabs) or @@ -151,4 +228,4 @@ openapi-schema: "schema-key" --- ``` - + \ No newline at end of file diff --git a/mint.json b/mint.json index 0636b03..b6e13a7 100644 --- a/mint.json +++ b/mint.json @@ -122,7 +122,8 @@ }, { "group": "Advanced", - "pages": [{ + "pages": [ + { "icon": "code", "group": "Custom Scripts", "pages": [ @@ -196,7 +197,10 @@ }, { "group": "SDKs", - "pages": ["integrations/sdks/speakeasy", "integrations/sdks/stainless"] + "pages": [ + "integrations/sdks/speakeasy", + "integrations/sdks/stainless" + ] }, { "group": "Support", @@ -208,7 +212,10 @@ }, { "group": "Privacy", - "pages": ["integrations/privacy/overview", "integrations/privacy/osano"] + "pages": [ + "integrations/privacy/overview", + "integrations/privacy/osano" + ] }, { "group": "Components", @@ -240,7 +247,9 @@ }, { "group": "Changelog", - "pages": ["changelog/overview"] + "pages": [ + "changelog/overview" + ] } ], "footer": { @@ -324,4 +333,4 @@ "publicApiKey": "pk_76a6caa274e800f3ceff0b2bc6b9b9d82ab8" } } -} +} \ No newline at end of file