{"id":76260,"date":"2024-08-24T22:52:45","date_gmt":"2024-08-25T02:52:45","guid":{"rendered":"http:\/\/bangla.sitestree.com\/?p=76260"},"modified":"2024-08-24T22:52:52","modified_gmt":"2024-08-25T02:52:52","slug":"how-to-use-the-swagger-editor-to-design-your-api-or-to-create-an-api-specification","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=76260","title":{"rendered":"How to use the Swagger Editor to design your API (or to create an API specification)"},"content":{"rendered":"\n<p>Use the Insert menu to create\/generate misc API specification Items: <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/08\/image-4.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"709\" height=\"489\" src=\"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/08\/image-4.png?resize=709%2C489\" alt=\"\" class=\"wp-image-76264\" srcset=\"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/08\/image-4.png?w=709 709w, https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/08\/image-4.png?resize=300%2C207 300w\" sizes=\"auto, (max-width: 709px) 100vw, 709px\" \/><\/a><\/figure>\n\n\n\n<p>Also, watch some training videos such as:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\nhttps:\/\/www.youtube.com\/watch?v=7MS1Z_1c5CU\n<\/div><\/figure>\n\n\n\n<p><strong>Example use of the menu shown above to design your API:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/08\/image-5.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"347\" src=\"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/08\/image-5.png?resize=750%2C347\" alt=\"\" class=\"wp-image-76262\" srcset=\"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/08\/image-5.png?w=969 969w, https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/08\/image-5.png?resize=300%2C139 300w, https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/08\/image-5.png?resize=768%2C355 768w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/08\/image-3.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"496\" src=\"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/08\/image-3.png?resize=750%2C496\" alt=\"\" class=\"wp-image-76261\" srcset=\"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/08\/image-3.png?w=846 846w, https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/08\/image-3.png?resize=300%2C199 300w, https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/08\/image-3.png?resize=768%2C508 768w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/a><\/figure>\n\n\n\n<p>You can use the above approaches or the approach below:<\/p>\n\n\n\n<p>&#8212;<\/p>\n\n\n\n<p><strong>To keep things simple, you can just go there<\/strong>:&nbsp;<a href=\"https:\/\/editor.swagger.io\/\">https:\/\/editor.swagger.io\/<\/a>&nbsp; &nbsp;(make sure to use expand\/collapse to see what I am saying below)<\/p>\n\n\n\n<p>You will see an editor with an API specification for a Pet store. You can just reuse this API specification and add your specification on top of that.<\/p>\n\n\n\n<p>One simple approach can be: think about every single object (data) that you want the users to be able to access through your API, you create a path for each such object. For each such object, you can create paths\/subpaths as the following image is showing. Here Pet, store, and user are the objects. there are multiple paths for an object such as user, user\/login, user\/logout or \/pet, \/pet\/{petID}.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/08\/image-7.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"319\" height=\"318\" src=\"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/08\/image-7.png?resize=319%2C318\" alt=\"\" class=\"wp-image-76266\" srcset=\"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/08\/image-7.png?w=319 319w, https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/08\/image-7.png?resize=300%2C300 300w, https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/08\/image-7.png?resize=150%2C150 150w\" sizes=\"auto, (max-width: 319px) 100vw, 319px\" \/><\/a><\/figure>\n\n\n\n<p>Then you see under the path \/pet : some REST verbs<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/08\/image-6.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"108\" height=\"52\" src=\"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/08\/image-6.png?resize=108%2C52\" alt=\"\" class=\"wp-image-76263\"\/><\/a><\/figure>\n\n\n\n<p>The for example under post (if you expand post), you see: (some stuff, you need to know\/understand, otherwise you can just follow their style)<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/08\/image-8.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"457\" height=\"611\" src=\"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/08\/image-8.png?resize=457%2C611\" alt=\"\" class=\"wp-image-76265\" srcset=\"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/08\/image-8.png?w=457 457w, https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/08\/image-8.png?resize=224%2C300 224w\" sizes=\"auto, (max-width: 457px) 100vw, 457px\" \/><\/a><\/figure>\n\n\n\n<p>You can do such for all object paths (for your application), additional paths for objects, and for inside object REST verbs.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Use the Insert menu to create\/generate misc API specification Items: Also, watch some training videos such as: Example use of the menu shown above to design your API: You can use the above approaches or the approach below: &#8212; To keep things simple, you can just go there:&nbsp;https:\/\/editor.swagger.io\/&nbsp; &nbsp;(make sure to use expand\/collapse to see &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=76260\">Continue reading<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[182],"tags":[],"class_list":["post-76260","post","type-post","status-publish","format-standard","hentry","category---blog","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":22229,"url":"http:\/\/bangla.sitestree.com\/?p=22229","url_meta":{"origin":76260,"position":0},"title":"Java Multimedia #Root #Java","author":"Author-Check- Article-or-Video","date":"March 12, 2021","format":false,"excerpt":"Java MultimediaJava 3D API SpecificationJava Speech API Programmer's GuideJava Media Framework API GuideJava 3D API TutorialProgramming in Java Advanced ImagingJava Sound Programmer Guide From: http:\/\/sitestree.com\/?p=3256 Categories:Root, JavaTags: Post Data:2016-01-22 23:15:22 Shop Online: https:\/\/www.ShopForSoul.com\/ (Big Data, Cloud, Security, Machine Learning): Courses: http:\/\/Training.SitesTree.com In Bengali: http:\/\/Bangla.SaLearningSchool.com http:\/\/SitesTree.com 8112223 Canada Inc.\/JustEtc: http:\/\/JustEtc.net (Software\/Web\/Mobile\/Big-Data\/Machine\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":22585,"url":"http:\/\/bangla.sitestree.com\/?p=22585","url_meta":{"origin":76260,"position":1},"title":"Some Good to Know Stuff: Distributed SOA, Modular Design, API Design #Root #By Sayed Ahmed","author":"Author-Check- Article-or-Video","date":"March 16, 2021","format":false,"excerpt":"Distributed SOA Common mistakes to avoid when designing distributed SOA systems http:\/\/www.theserverside.com\/feature\/Common-mistakes-to-avoid-when-designing-distributed-SOA-systems \u00a0 Service Granularity in SOA Projects: A Trade-off Analysis http:\/\/essay.utwente.nl\/57339\/1\/scriptie_Steghuis.pdf The emergence of distributed SOA infrastructure https:\/\/skillsmatter.com\/courses\/258-advanced-distributed-systems-design-with-soa-course#programme \u00a0 A distributed service-oriented architecture for business process execution http:\/\/dl.acm.org\/citation.cfm?id=1658375 \u00a0 Restful API Best Practices for Designing a Pragmatic RESTful API\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":74240,"url":"http:\/\/bangla.sitestree.com\/?p=74240","url_meta":{"origin":76260,"position":2},"title":"Design and Engineering Considerations for API","author":"Sayed","date":"April 24, 2022","format":false,"excerpt":"https:\/\/youtu.be\/6rrknS7hB64","rel":"","context":"In &quot;From Youtube Channel&quot;","block_context":{"text":"From Youtube Channel","link":"http:\/\/bangla.sitestree.com\/?cat=1952"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/img.youtube.com\/vi\/6rrknS7hB64\/0.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":67753,"url":"http:\/\/bangla.sitestree.com\/?p=67753","url_meta":{"origin":76260,"position":3},"title":"Key concepts for system design #By Sayed Ahmed #System Design #API Design","author":"Author-Check- Article-or-Video","date":"July 28, 2021","format":false,"excerpt":"[youtube https:\/\/www.youtube.com\/watch?v=hvIyfbfYUq0&w=640&h=480] From: http:\/\/sitestree.com\/?p=4213 Categories:By Sayed Ahmed, System Design, API DesignTags: Post Data:2016-09-26 17:10:32 Shop Online: https:\/\/www.ShopForSoul.com\/ (Big Data, Cloud, Security, Machine Learning): Courses: http:\/\/Training.SitesTree.com In Bengali: http:\/\/Bangla.SaLearningSchool.com http:\/\/SitesTree.com 8112223 Canada Inc.\/JustEtc: http:\/\/JustEtc.net (Software\/Web\/Mobile\/Big-Data\/Machine Learning) Shop Online: https:\/\/www.ShopForSoul.com\/ Medium: https:\/\/medium.com\/@SayedAhmedCanada","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":21452,"url":"http:\/\/bangla.sitestree.com\/?p=21452","url_meta":{"origin":76260,"position":4},"title":"Twitter API Search Limitations and Tools to Overcome","author":"Author-Check- Article-or-Video","date":"March 1, 2021","format":false,"excerpt":"Twitter API Search has the limitations such as You may not be able to retrieve tweets from very old dates. It may return only 1500 or from 7 days which one is earlier. \u00a0 It may return only around 20 per request. You can set rpp to get more \u00a0\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":67444,"url":"http:\/\/bangla.sitestree.com\/?p=67444","url_meta":{"origin":76260,"position":5},"title":"Java\/J2EE:Important Resources: Struts, Spring, Hibernate, JPA #Java Short Notes","author":"Sayed","date":"July 22, 2021","format":false,"excerpt":"Java\/J2EE:Important Resources: Struts, Spring, Hibernate, JPA ...... .... ..... .... ... ... ... ... ... ... .. ..Struts Struts Developer and User Guides Struts API Struts TutorialsSpring, Hibernate, JPA Spring 2.5 API Spring 2.5 Reference Manual JPA APIJSF JSF 1.2 Java API JSF 1.2 Tag Library API JSF 1.1 Java\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/76260","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=76260"}],"version-history":[{"count":1,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/76260\/revisions"}],"predecessor-version":[{"id":76267,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/76260\/revisions\/76267"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=76260"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=76260"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=76260"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}