Skip to content

Commit

Permalink
[Enhancement] Use docs with embedded links as category link (#114)
Browse files Browse the repository at this point in the history
* Add createTagPage

* Add TagPageMetadata

* Use tag doc as category link

* Implement writing MDX for tag docs

* Add tag pages to items

* Add cleanup for *.tag.mdx files

* Re-gen petstore API docs

* Update tag page mustache template

* Remove title from createTagPageMD

* Use tag display name as title and description

* Re-gen petstore API docs

* Exclude schema definition tags

* Re-gen petstore API docs
  • Loading branch information
sserrata authored Jun 1, 2022
1 parent 6690931 commit f51c38f
Show file tree
Hide file tree
Showing 31 changed files with 272 additions and 6,174 deletions.
308 changes: 5 additions & 303 deletions demo/docs/petstore/add-a-new-pet-to-the-store.api.mdx

Large diffs are not rendered by default.

372 changes: 5 additions & 367 deletions demo/docs/petstore/create-user.api.mdx

Large diffs are not rendered by default.

Large diffs are not rendered by default.

380 changes: 3 additions & 377 deletions demo/docs/petstore/creates-list-of-users-with-given-input-list.api.mdx

Large diffs are not rendered by default.

118 changes: 5 additions & 113 deletions demo/docs/petstore/delete-purchase-order-by-id.api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,127 +3,19 @@ id: delete-purchase-order-by-id
sidebar_label: Delete purchase order by ID
hide_title: true
hide_table_of_contents: true
api:
{
"tags": ["Petstore Orders"],
"description": "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors",
"operationId": "deleteOrder",
"parameters":
[
{
"name": "orderId",
"in": "path",
"description": "ID of the order that needs to be deleted",
"required": true,
"schema": { "type": "string", "minimum": 1 },
},
],
"responses":
{
"400": { "description": "Invalid ID supplied" },
"404": { "description": "Order not found" },
},
"method": "delete",
"path": "/store/order/{orderId}",
"servers":
[
{ "url": "//petstore.swagger.io/v2", "description": "Default server" },
{
"url": "//petstore.swagger.io/sandbox",
"description": "Sandbox server",
},
],
"securitySchemes":
{
"petstore_auth":
{
"description": "Get access to data while protecting your account credentials.\nOAuth2 is also a safer and more secure way to give you access.\n",
"type": "oauth2",
"flows":
{
"implicit":
{
"authorizationUrl": "http://petstore.swagger.io/api/oauth/dialog",
"scopes":
{
"write:pets": "modify pets in your account",
"read:pets": "read your pets",
},
},
},
},
"api_key":
{
"description": "For this sample, you can use the api key `special-key` to test the authorization filters.\n",
"type": "apiKey",
"name": "api_key",
"in": "header",
},
},
"info":
{
"description": "This is a sample server Petstore server.\nYou can find out more about Swagger at\n[http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/).\nFor this sample, you can use the api key `special-key` to test the authorization filters.\n\n## Introduction\nThis API is documented in **OpenAPI format** and is based on\n[Petstore sample](http://petstore.swagger.io/) provided by [swagger.io](http://swagger.io) team.\nIt was **extended** to illustrate features of [generator-openapi-repo](https://github.com/Rebilly/generator-openapi-repo)\ntool and [ReDoc](https://github.com/Redocly/redoc) documentation. In addition to standard\nOpenAPI syntax we use a few [vendor extensions](https://github.com/Redocly/redoc/blob/master/docs/redoc-vendor-extensions.md).\n\n## OpenAPI Specification\nThis API is documented in **OpenAPI format** and is based on\n[Petstore sample](http://petstore.swagger.io/) provided by [swagger.io](http://swagger.io) team.\nIt was **extended** to illustrate features of [generator-openapi-repo](https://github.com/Rebilly/generator-openapi-repo)\ntool and [ReDoc](https://github.com/Redocly/redoc) documentation. In addition to standard\nOpenAPI syntax we use a few [vendor extensions](https://github.com/Redocly/redoc/blob/master/docs/redoc-vendor-extensions.md).\n\n## Cross-Origin Resource Sharing\nThis API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/).\nAnd that allows cross-domain communication from the browser.\nAll responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.\n\n## Authentication\n\nPetstore offers two forms of authentication:\n - API Key\n - OAuth2\nOAuth2 - an open protocol to allow secure authorization in a simple\nand standard method from web, mobile and desktop applications.\n\n<SecurityDefinitions />\n",
"version": "1.0.0",
"title": "Swagger Petstore YAML",
"termsOfService": "http://swagger.io/terms/",
"contact":
{
"name": "API Support",
"email": "[email protected]",
"url": "https://github.com/Redocly/redoc",
},
"x-logo":
{
"url": "https://redocly.github.io/redoc/petstore-logo.png",
"altText": "Petstore logo",
},
"license":
{
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html",
},
},
"postman":
{
"name": "Delete purchase order by ID",
"description":
{
"content": "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors",
"type": "text/plain",
},
"url":
{
"path": ["store", "order", ":orderId"],
"host": ["{{baseUrl}}"],
"query": [],
"variable":
[
{
"disabled": false,
"description":
{
"content": "(Required) ID of the order that needs to be deleted",
"type": "text/plain",
},
"type": "any",
"value": "",
"key": "orderId",
},
],
},
"method": "DELETE",
},
}
api: {"tags":["Petstore Orders"],"description":"For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors","operationId":"deleteOrder","parameters":[{"name":"orderId","in":"path","description":"ID of the order that needs to be deleted","required":true,"schema":{"type":"string","minimum":1}}],"responses":{"400":{"description":"Invalid ID supplied"},"404":{"description":"Order not found"}},"method":"delete","path":"/store/order/{orderId}","servers":[{"url":"//petstore.swagger.io/v2","description":"Default server"},{"url":"//petstore.swagger.io/sandbox","description":"Sandbox server"}],"securitySchemes":{"petstore_auth":{"description":"Get access to data while protecting your account credentials.\nOAuth2 is also a safer and more secure way to give you access.\n","type":"oauth2","flows":{"implicit":{"authorizationUrl":"http://petstore.swagger.io/api/oauth/dialog","scopes":{"write:pets":"modify pets in your account","read:pets":"read your pets"}}}},"api_key":{"description":"For this sample, you can use the api key `special-key` to test the authorization filters.\n","type":"apiKey","name":"api_key","in":"header"}},"info":{"description":"This is a sample server Petstore server.\nYou can find out more about Swagger at\n[http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/).\nFor this sample, you can use the api key `special-key` to test the authorization filters.\n\n## Introduction\nThis API is documented in **OpenAPI format** and is based on\n[Petstore sample](http://petstore.swagger.io/) provided by [swagger.io](http://swagger.io) team.\nIt was **extended** to illustrate features of [generator-openapi-repo](https://github.com/Rebilly/generator-openapi-repo)\ntool and [ReDoc](https://github.com/Redocly/redoc) documentation. In addition to standard\nOpenAPI syntax we use a few [vendor extensions](https://github.com/Redocly/redoc/blob/master/docs/redoc-vendor-extensions.md).\n\n## OpenAPI Specification\nThis API is documented in **OpenAPI format** and is based on\n[Petstore sample](http://petstore.swagger.io/) provided by [swagger.io](http://swagger.io) team.\nIt was **extended** to illustrate features of [generator-openapi-repo](https://github.com/Rebilly/generator-openapi-repo)\ntool and [ReDoc](https://github.com/Redocly/redoc) documentation. In addition to standard\nOpenAPI syntax we use a few [vendor extensions](https://github.com/Redocly/redoc/blob/master/docs/redoc-vendor-extensions.md).\n\n## Cross-Origin Resource Sharing\nThis API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/).\nAnd that allows cross-domain communication from the browser.\nAll responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.\n\n## Authentication\n\nPetstore offers two forms of authentication:\n - API Key\n - OAuth2\nOAuth2 - an open protocol to allow secure authorization in a simple\nand standard method from web, mobile and desktop applications.\n\n<SecurityDefinitions />\n","version":"1.0.0","title":"Swagger Petstore YAML","termsOfService":"http://swagger.io/terms/","contact":{"name":"API Support","email":"[email protected]","url":"https://github.com/Redocly/redoc"},"x-logo":{"url":"https://redocly.github.io/redoc/petstore-logo.png","altText":"Petstore logo"},"license":{"name":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"}},"postman":{"name":"Delete purchase order by ID","description":{"content":"For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors","type":"text/plain"},"url":{"path":["store","order",":orderId"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) ID of the order that needs to be deleted","type":"text/plain"},"type":"any","value":"","key":"orderId"}]},"method":"DELETE"}}
sidebar_class_name: "delete api-method"
---

import ParamsItem from "@theme/ParamsItem";
import SchemaItem from "@theme/SchemaItem";
import SchemaItem from "@theme/SchemaItem"
import ApiTabs from "@theme/ApiTabs";
import TabItem from "@theme/TabItem";

## Delete purchase order by ID



For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors

<details style={{"marginBottom":"1rem"}}><summary style={{}}><strong>Path Parameters</strong></summary><div><ul><ParamsItem className={"paramsItem"} param={{"name":"orderId","in":"path","description":"ID of the order that needs to be deleted","required":true,"schema":{"type":"string","minimum":1}}}></ParamsItem></ul></div></details><div><ApiTabs><TabItem label={"400"} value={"400"}><div>
Expand All @@ -135,4 +27,4 @@ Invalid ID supplied
Order not found

</div><div></div></TabItem></ApiTabs></div>

Loading

0 comments on commit f51c38f

Please sign in to comment.