From c54ba49fe98e3cf2514e6e50ec85a189f0ce1728 Mon Sep 17 00:00:00 2001 From: Kathryn Isabelle Lawrence Date: Wed, 23 Apr 2025 14:47:09 -0700 Subject: [PATCH 1/4] add x-hidden docs --- api-playground/openapi/advanced-features.mdx | 40 ++++++++++++++++++++ api-playground/openapi/setup.mdx | 2 + 2 files changed, 42 insertions(+) diff --git a/api-playground/openapi/advanced-features.mdx b/api-playground/openapi/advanced-features.mdx index d68b47e6e..4e0b4b892 100644 --- a/api-playground/openapi/advanced-features.mdx +++ b/api-playground/openapi/advanced-features.mdx @@ -135,3 +135,43 @@ paths: const planter = require('planter'); planter.list({ potted: true }); ``` + +## `x-hidden` + +If your pages are [autogenerated](/openapi/setup) from an OpenAPI document, but there are some paths that you don't want to create pages for, you can hide them by adding the property `x-hidden`. + +You can add the `x-hidden` tag under endpoint or webhook paths below the method. + +Here's are examples of how that would look in an OpenAPI schema document for an endpoint or a webhook path: + +```json {14} +"paths": { + "/plants": { + "get": { + "description": "Returns all plants from the store", + "parameters": { ... }, + "responses": { ... }, + } + } + "/secret_plants": { + "get": { + "description": "Returns all secret plants from the store (do not publish this endpoint!)", + "parameters": { ... }, + "responses": { ... }, + "x-hidden": true + } + } +}, +``` + +```json {5} +"webhooks": { + "/secret_pants_hook": { + "post": { + "description": "Secret webhook for information about a new plant added to the store", + "x-hidden": true + } + } +} +``` + diff --git a/api-playground/openapi/setup.mdx b/api-playground/openapi/setup.mdx index ff34e940c..e2d1d46ce 100644 --- a/api-playground/openapi/setup.mdx +++ b/api-playground/openapi/setup.mdx @@ -61,6 +61,8 @@ When using this option, the metadata for the generated pages will have the follo There are some scenarios in which the default behavior isn't sufficient. If you need more customizability, you can create an MDX page for your OpenAPI operation, and modify it just like any other MDX page. +If you have some endpoints in your OpenAPI schema that you don't want pages generated for automatically, you can add the [x-hidden](/optnapi/advanced-features#x-hidden) property + ## Create MDX files for API pages If you want to customize the page metadata, add additional content, omit certain OpenAPI operations, or reorder OpenAPI pages in your navigation, you'll need an MDX page for each operation. Here is [an example MDX OpenAPI page](https://github.com/mindsdb/mindsdb/blob/main/docs/rest/databases/create-databases.mdx) from [MindsDB](https://docs.mindsdb.com/rest/databases/create-databases). From b42f56876d01a814c1d692d847de50db341f27a3 Mon Sep 17 00:00:00 2001 From: Kathryn Isabelle Lawrence Date: Wed, 23 Apr 2025 14:49:09 -0700 Subject: [PATCH 2/4] fix broken link --- api-playground/openapi/setup.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api-playground/openapi/setup.mdx b/api-playground/openapi/setup.mdx index e2d1d46ce..a985d0153 100644 --- a/api-playground/openapi/setup.mdx +++ b/api-playground/openapi/setup.mdx @@ -61,7 +61,7 @@ When using this option, the metadata for the generated pages will have the follo There are some scenarios in which the default behavior isn't sufficient. If you need more customizability, you can create an MDX page for your OpenAPI operation, and modify it just like any other MDX page. -If you have some endpoints in your OpenAPI schema that you don't want pages generated for automatically, you can add the [x-hidden](/optnapi/advanced-features#x-hidden) property +If you have some endpoints in your OpenAPI schema that you don't want pages generated for automatically, you can add the [x-hidden](/openapi/advanced-features#x-hidden) property ## Create MDX files for API pages From 4ba1a6c82929ce0417dbbeea4a758938a10fa2e6 Mon Sep 17 00:00:00 2001 From: Kathryn Isabelle Lawrence Date: Wed, 23 Apr 2025 14:50:51 -0700 Subject: [PATCH 3/4] fix link for real --- api-playground/openapi/setup.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api-playground/openapi/setup.mdx b/api-playground/openapi/setup.mdx index a985d0153..5615bed6f 100644 --- a/api-playground/openapi/setup.mdx +++ b/api-playground/openapi/setup.mdx @@ -61,7 +61,7 @@ When using this option, the metadata for the generated pages will have the follo There are some scenarios in which the default behavior isn't sufficient. If you need more customizability, you can create an MDX page for your OpenAPI operation, and modify it just like any other MDX page. -If you have some endpoints in your OpenAPI schema that you don't want pages generated for automatically, you can add the [x-hidden](/openapi/advanced-features#x-hidden) property +If you have some endpoints in your OpenAPI schema that you don't want pages generated for automatically, you can add the [x-hidden](/api-playground/openapi/advanced-features#x-hidden) property ## Create MDX files for API pages From 96e4e3e8b6652bad7a2e831ac157505158747700 Mon Sep 17 00:00:00 2001 From: Kathryn Isabelle Lawrence Date: Wed, 23 Apr 2025 15:03:11 -0700 Subject: [PATCH 4/4] doi fix the other link --- api-playground/openapi/advanced-features.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api-playground/openapi/advanced-features.mdx b/api-playground/openapi/advanced-features.mdx index 4e0b4b892..cf92428e1 100644 --- a/api-playground/openapi/advanced-features.mdx +++ b/api-playground/openapi/advanced-features.mdx @@ -138,7 +138,7 @@ paths: ## `x-hidden` -If your pages are [autogenerated](/openapi/setup) from an OpenAPI document, but there are some paths that you don't want to create pages for, you can hide them by adding the property `x-hidden`. +If your pages are [autogenerated](/api-playground/openapi/setup) from an OpenAPI document, but there are some paths that you don't want to create pages for, you can hide them by adding the property `x-hidden`. You can add the `x-hidden` tag under endpoint or webhook paths below the method.