{"id":2685,"date":"2022-07-09T22:09:01","date_gmt":"2022-07-09T13:09:01","guid":{"rendered":"https:\/\/blog.wsd.sh\/?p=2685"},"modified":"2022-07-11T19:12:44","modified_gmt":"2022-07-11T10:12:44","slug":"yaml%e9%85%8d%e5%88%97%e3%80%81%e3%82%aa%e3%83%96%e3%82%b8%e3%82%a7%e3%82%af%e3%83%88","status":"publish","type":"post","link":"https:\/\/blog.wsd.sh\/?p=2685","title":{"rendered":"<small>openAPI \u6587\u6cd5: array, object, tag, parameters, schemas<\/small>"},"content":{"rendered":"<p>\uff11\uff0earray<\/p>\n<pre>\r\nmsg:\r\n  type: array\r\n  items:\r\n<\/pre>\n<p>\uff12\uff0eobject<\/p>\n<pre>\r\nmsg:\r\n  type: object\r\n  properties:\r\n<\/pre>\n<p>\uff13\uff0etag &#038; parameters &#038; schemas<\/p>\n<pre>\r\ntags:\r\n#1.\r\n  - name: \"contacts\"\r\n    description: \"Paths related to handling contacts\"\r\n\u30fb\u30fb\u30fb\r\n\r\npaths:\r\n  #1. \/api\/contacts\r\n  #1.1\r\n  #require('.\/routes\/contacts.js');\r\n\r\n  #1.1.1\r\n  \/api\/contacts\/generate:\r\n    post:\r\n      description: \\#1.1.1 contacts generate\r\n      operationId: contacts_generate\r\n      tags:\r\n        - \"contacts\"\r\n      parameters:\r\n        - in: \"body\"\r\n          name: \"body\"\r\n          required: true\r\n          schema:\r\n            $ref: '#\/contacts\/schemas\/Request_generate'\r\n\r\n      responses:\r\n        '200':\r\n          description: generate response\r\n          content:\r\n            application\/json:\r\n              schema:\r\n                $ref: '#\/contacts\/schemas\/Responses_generate'\r\n\u30fb\u30fb\u30fb\r\n\r\n#------------------------ schemas -------------------------\r\ncontacts:\r\n  schemas:\r\n    #1.1.1\r\n    Request_generate:\r\n      type: object\r\n      properties:\r\n        buyer:\r\n          type: string\r\n        seller:\r\n          type: string\r\n        uses:\r\n          type: string\r\n        expire:\r\n          type: string\r\n\r\n    Responses_generate:\r\n      required:\r\n      properties:\r\n        type: string\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\uff11\uff0earray msg: type: array items: \uff12\uff0eobject msg: type: object properties: \uff13\uff0etag &#038; parameters &#038; schemas &#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=\/wp\/v2\/posts\/2685"}],"collection":[{"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2685"}],"version-history":[{"count":20,"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=\/wp\/v2\/posts\/2685\/revisions"}],"predecessor-version":[{"id":2688,"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=\/wp\/v2\/posts\/2685\/revisions\/2688"}],"wp:attachment":[{"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2685"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2685"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2685"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}