{"id":724,"date":"2026-03-21T23:08:55","date_gmt":"2026-03-21T15:08:55","guid":{"rendered":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/api-reference-openapi-json\/"},"modified":"2026-03-21T23:30:48","modified_gmt":"2026-03-21T15:30:48","slug":"api-reference-openapi-json","status":"publish","type":"post","link":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/api-reference-openapi-json\/","title":{"rendered":"OpenAPI \u63a5\u53e3\u6587\u6863"},"content":{"rendered":"<p>{<br \/>\n  &#8220;openapi&#8221;: &#8220;3.1.0&#8221;,<br \/>\n  &#8220;info&#8221;: {<br \/>\n    &#8220;title&#8221;: &#8220;OpenAPI Plant Store&#8221;,<br \/>\n    &#8220;description&#8221;: &#8220;A sample API that uses a plant store as an example to demonstrate features in the OpenAPI specification&#8221;,<br \/>\n    &#8220;license&#8221;: {<br \/>\n      &#8220;name&#8221;: &#8220;MIT&#8221;<br \/>\n    },<br \/>\n    &#8220;version&#8221;: &#8220;1.0.0&#8221;<br \/>\n  },<br \/>\n  &#8220;servers&#8221;: [<br \/>\n    {<br \/>\n      &#8220;url&#8221;: &#8220;http:\/\/sandbox.mintlify.com&#8221;<br \/>\n    }<br \/>\n  ],<br \/>\n  &#8220;security&#8221;: [<br \/>\n    {<br \/>\n      &#8220;bearerAuth&#8221;: []<br \/>\n    }<br \/>\n  ],<br \/>\n  &#8220;paths&#8221;: {<br \/>\n    &#8220;\/plants&#8221;: {<br \/>\n      &#8220;get&#8221;: {<br \/>\n        &#8220;description&#8221;: &#8220;Returns all plants from the system that the user has access to&#8221;,<br \/>\n        &#8220;parameters&#8221;: [<br \/>\n          {<br \/>\n            &#8220;name&#8221;: &#8220;limit&#8221;,<br \/>\n            &#8220;in&#8221;: &#8220;query&#8221;,<br \/>\n            &#8220;description&#8221;: &#8220;The maximum number of results to return&#8221;,<br \/>\n            &#8220;schema&#8221;: {<br \/>\n              &#8220;type&#8221;: &#8220;integer&#8221;,<br \/>\n              &#8220;format&#8221;: &#8220;int32&#8221;<br \/>\n            }<br \/>\n          }<br \/>\n        ],<br \/>\n        &#8220;responses&#8221;: {<br \/>\n          &#8220;200&#8221;: {<br \/>\n            &#8220;description&#8221;: &#8220;Plant response&#8221;,<br \/>\n            &#8220;content&#8221;: {<br \/>\n              &#8220;application\/json&#8221;: {<br \/>\n                &#8220;schema&#8221;: {<br \/>\n                  &#8220;type&#8221;: &#8220;array&#8221;,<br \/>\n                  &#8220;items&#8221;: {<br \/>\n                    &#8220;$ref&#8221;: &#8220;#\/components\/schemas\/Plant&#8221;<br \/>\n                  }<br \/>\n                }<br \/>\n              }<br \/>\n            }<br \/>\n          },<br \/>\n          &#8220;400&#8221;: {<br \/>\n            &#8220;description&#8221;: &#8220;Unexpected error&#8221;,<br \/>\n            &#8220;content&#8221;: {<br \/>\n              &#8220;application\/json&#8221;: {<br \/>\n                &#8220;schema&#8221;: {<br \/>\n                  &#8220;$ref&#8221;: &#8220;#\/components\/schemas\/Error&#8221;<br \/>\n                }<br \/>\n              }<br \/>\n            }<br \/>\n          }<br \/>\n        }<br \/>\n      },<br \/>\n      &#8220;post&#8221;: {<br \/>\n        &#8220;description&#8221;: &#8220;Creates a new plant in the store&#8221;,<br \/>\n        &#8220;requestBody&#8221;: {<br \/>\n          &#8220;description&#8221;: &#8220;Plant to add to the store&#8221;,<br \/>\n          &#8220;content&#8221;: {<br \/>\n            &#8220;application\/json&#8221;: {<br \/>\n              &#8220;schema&#8221;: {<br \/>\n                &#8220;$ref&#8221;: &#8220;#\/components\/schemas\/NewPlant&#8221;<br \/>\n              }<br \/>\n            }<br \/>\n          },<br \/>\n          &#8220;required&#8221;: true<br \/>\n        },<br \/>\n        &#8220;responses&#8221;: {<br \/>\n          &#8220;200&#8221;: {<br \/>\n            &#8220;description&#8221;: &#8220;plant response&#8221;,<br \/>\n            &#8220;content&#8221;: {<br \/>\n              &#8220;application\/json&#8221;: {<br \/>\n                &#8220;schema&#8221;: {<br \/>\n                  &#8220;$ref&#8221;: &#8220;#\/components\/schemas\/Plant&#8221;<br \/>\n                }<br \/>\n              }<br \/>\n            }<br \/>\n          },<br \/>\n          &#8220;400&#8221;: {<br \/>\n            &#8220;description&#8221;: &#8220;unexpected error&#8221;,<br \/>\n            &#8220;content&#8221;: {<br \/>\n              &#8220;application\/json&#8221;: {<br \/>\n                &#8220;schema&#8221;: {<br \/>\n                  &#8220;$ref&#8221;: &#8220;#\/components\/schemas\/Error&#8221;<br \/>\n                }<br \/>\n              }<br \/>\n            }<br \/>\n          }<br \/>\n        }<br \/>\n      }<br \/>\n    },<br \/>\n    &#8220;\/plants\/{id}&#8221;: {<br \/>\n      &#8220;delete&#8221;: {<br \/>\n        &#8220;description&#8221;: &#8220;Deletes a single plant based on the ID supplied&#8221;,<br \/>\n        &#8220;parameters&#8221;: [<br \/>\n          {<br \/>\n            &#8220;name&#8221;: &#8220;id&#8221;,<br \/>\n            &#8220;in&#8221;: &#8220;path&#8221;,<br \/>\n            &#8220;description&#8221;: &#8220;ID of plant to delete&#8221;,<br \/>\n            &#8220;required&#8221;: true,<br \/>\n            &#8220;schema&#8221;: {<br \/>\n              &#8220;type&#8221;: &#8220;integer&#8221;,<br \/>\n              &#8220;format&#8221;: &#8220;int64&#8221;<br \/>\n            }<br \/>\n          }<br \/>\n        ],<br \/>\n        &#8220;responses&#8221;: {<br \/>\n          &#8220;204&#8221;: {<br \/>\n            &#8220;description&#8221;: &#8220;Plant deleted&#8221;,<br \/>\n            &#8220;content&#8221;: {}<br \/>\n          },<br \/>\n          &#8220;400&#8221;: {<br \/>\n            &#8220;description&#8221;: &#8220;unexpected error&#8221;,<br \/>\n            &#8220;content&#8221;: {<br \/>\n              &#8220;application\/json&#8221;: {<br \/>\n                &#8220;schema&#8221;: {<br \/>\n                  &#8220;$ref&#8221;: &#8220;#\/components\/schemas\/Error&#8221;<br \/>\n                }<br \/>\n              }<br \/>\n            }<br \/>\n          }<br \/>\n        }<br \/>\n      }<br \/>\n    }<br \/>\n  },<br \/>\n  &#8220;webhooks&#8221;: {<br \/>\n    &#8220;\/plant\/webhook&#8221;: {<br \/>\n      &#8220;post&#8221;: {<br \/>\n        &#8220;description&#8221;: &#8220;Information about a new plant added to the store&#8221;,<br \/>\n        &#8220;requestBody&#8221;: {<br \/>\n          &#8220;description&#8221;: &#8220;Plant added to the store&#8221;,<br \/>\n          &#8220;content&#8221;: {<br \/>\n            &#8220;application\/json&#8221;: {<br \/>\n              &#8220;schema&#8221;: {<br \/>\n                &#8220;$ref&#8221;: &#8220;#\/components\/schemas\/NewPlant&#8221;<br \/>\n              }<br \/>\n            }<br \/>\n          }<br \/>\n        },<br \/>\n        &#8220;responses&#8221;: {<br \/>\n          &#8220;200&#8221;: {<br \/>\n            &#8220;description&#8221;: &#8220;Return a 200 status to indicate that the data was received successfully&#8221;<br \/>\n          }<br \/>\n        }<br \/>\n      }<br \/>\n    }<br \/>\n  },<br \/>\n  &#8220;components&#8221;: {<br \/>\n    &#8220;schemas&#8221;: {<br \/>\n      &#8220;Plant&#8221;: {<br \/>\n        &#8220;required&#8221;: [<br \/>\n          &#8220;name&#8221;<br \/>\n        ],<br \/>\n        &#8220;type&#8221;: &#8220;object&#8221;,<br \/>\n        &#8220;properties&#8221;: {<br \/>\n          &#8220;name&#8221;: {<br \/>\n            &#8220;description&#8221;: &#8220;The name of the plant&#8221;,<br \/>\n            &#8220;type&#8221;: &#8220;string&#8221;<br \/>\n          },<br \/>\n          &#8220;tag&#8221;: {<br \/>\n            &#8220;description&#8221;: &#8220;Tag to specify the type&#8221;,<br \/>\n            &#8220;type&#8221;: &#8220;string&#8221;<br \/>\n          }<br \/>\n        }<br \/>\n      },<br \/>\n      &#8220;NewPlant&#8221;: {<br \/>\n        &#8220;allOf&#8221;: [<br \/>\n          {<br \/>\n            &#8220;$ref&#8221;: &#8220;#\/components\/schemas\/Plant&#8221;<br \/>\n          },<br \/>\n          {<br \/>\n            &#8220;required&#8221;: [<br \/>\n              &#8220;id&#8221;<br \/>\n            ],<br \/>\n            &#8220;type&#8221;: &#8220;object&#8221;,<br \/>\n            &#8220;properties&#8221;: {<br \/>\n              &#8220;id&#8221;: {<br \/>\n                &#8220;description&#8221;: &#8220;Identification number of the plant&#8221;,<br \/>\n                &#8220;type&#8221;: &#8220;integer&#8221;,<br \/>\n                &#8220;format&#8221;: &#8220;int64&#8221;<br \/>\n              }<br \/>\n            }<br \/>\n          }<br \/>\n        ]<br \/>\n      },<br \/>\n      &#8220;Error&#8221;: {<br \/>\n        &#8220;required&#8221;: [<br \/>\n          &#8220;error&#8221;,<br \/>\n          &#8220;message&#8221;<br \/>\n        ],<br \/>\n        &#8220;type&#8221;: &#8220;object&#8221;,<br \/>\n        &#8220;properties&#8221;: {<br \/>\n          &#8220;error&#8221;: {<br \/>\n            &#8220;type&#8221;: &#8220;integer&#8221;,<br \/>\n            &#8220;format&#8221;: &#8220;int32&#8221;<br \/>\n          },<br \/>\n          &#8220;message&#8221;: {<br \/>\n            &#8220;type&#8221;: &#8220;string&#8221;<br \/>\n          }<br \/>\n        }<br \/>\n      }<br \/>\n    },<br \/>\n    &#8220;securitySchemes&#8221;: {<br \/>\n      &#8220;bearerAuth&#8221;: {<br \/>\n        &#8220;type&#8221;: &#8220;http&#8221;,<br \/>\n        &#8220;scheme&#8221;: &#8220;bearer&#8221;<br \/>\n      }<br \/>\n    }<br \/>\n  }<br \/>\n}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>{ &#8220;openapi&#8221;: &#8220;3.1.0&#8221;, &#8220;in [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-724","post","type-post","status-publish","format-standard","hentry","category-docs"],"_links":{"self":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/724","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/comments?post=724"}],"version-history":[{"count":1,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/724\/revisions"}],"predecessor-version":[{"id":876,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/724\/revisions\/876"}],"wp:attachment":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/media?parent=724"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/categories?post=724"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/tags?post=724"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}