{"id":1884,"date":"2025-10-30T14:07:46","date_gmt":"2025-10-30T21:07:46","guid":{"rendered":"http:\/\/10kdev.net\/?p=1884"},"modified":"2025-10-30T14:07:46","modified_gmt":"2025-10-30T21:07:46","slug":"generating-openapi-and-postman-collections-with-q","status":"publish","type":"post","link":"http:\/\/10kdev.net\/?p=1884","title":{"rendered":"Generating OpenAPI and PostMan Collections with Q"},"content":{"rendered":"<p>Generating out descriptive schema for your existing applications that AI can well.<\/p>\n<p>Working on a Grails API application, I am using with BurpSuite DAST to do some security testing on a regular basis for it. I&#8217;ve needed an API list of endpoints for their API security scan feature for quite some time, that&#8217;s easy to maintain.\u00a0 We don&#8217;t have any maps of the APIs, annoying, so I thought I would ask Amazon Q to make OpenAPI bill of endpoints as well as a Postman collection of them for good measure.<\/p>\n<blockquote>\n<p><a href=\"https:\/\/www.openapis.org\/\">OpenAPI<\/a> is a specification for making a kind of &#8220;schema&#8221; for your APIs.<\/p>\n<p><a href=\"https:\/\/www.postman.com\/\">Postman<\/a> is a tool for building and testing APIS.<\/p>\n<p><a href=\"https:\/\/portswigger.net\/burp\/dast\">BurpSuite DAST<\/a> &#8211; dynamic application security testing &#8211; is owned by PortSwigger.\u00a0 It&#8217;s good for penetration testing.<\/p>\n<\/blockquote>\n<p>\u00a0<\/p>\n<p>Here are the prompts I asked after opening my project:<\/p>\n<ol>\n<li>can you make a postman collect of the apis in &lt;myproject&gt;<\/li>\n<li>can you also make an OpenAI 3.0 definition, both json and yaml<\/li>\n<\/ol>\n<p>Voila &#8211; have my three files.<\/p>\n<p>BurpSuite added an extra selection for an API scan type, and I hadn&#8217;t been able to use it until I had the catalog of API endpoints.<\/p>\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/image-4.png\"><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"225\" src=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/image-4-1024x225.png\" alt=\"\" class=\"wp-image-1886\" srcset=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/image-4-1024x225.png 1024w, http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/image-4-300x66.png 300w, http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/image-4-768x169.png 768w, http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/image-4-1536x338.png 1536w, http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/image-4-2048x451.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p>BurpSuite can take these formats to describe APIs:<\/p>\n\n\n\n<p>SOAP WSDL, Postman Collection, or an OpenAPI definition in YAML or JSON format.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/image-5.png\"><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"353\" src=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/image-5-1024x353.png\" alt=\"\" class=\"wp-image-1887\" srcset=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/image-5-1024x353.png 1024w, http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/image-5-300x103.png 300w, http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/image-5-768x264.png 768w, http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/image-5-1536x529.png 1536w, http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/image-5-2048x705.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p>I like to work with yaml files as I work with some devops type things, Docker, and AI Specs (that use markup, I find more akin to yaml).  But for grins I generated out both formats, and then the Postman collection.  I didn&#8217;t try the wsdl.<\/p>\n\n\n\n<p>Example content:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>openapi: 3.0.0\ninfo:\n  title: Product Management API\n  version: 1.0.0\n  description: A sample API for managing products.\nservers:\n  - url: https:\/\/api.example.com\/v1\n    description: Production server\n  - url: http:\/\/localhost:8080\/v1\n    description: Development server\ntags:\n  - name: Products\n    description: Operations related to products\npaths:\n  \/products:\n    get:\n      tags:\n        - Products\n      summary: Get all products\n      operationId: getAllProducts\n      responses:\n        '200':\n          description: A list of products\n          content:\n            application\/json:\n              schema:\n                type: array\n                items:\n                  $ref: '#\/components\/schemas\/Product'\n    post:\n      tags:\n        - Products\n      summary: Create a new product\n      operationId: createProduct\n      requestBody:\n        required: true\n        content:\n          application\/json:\n            schema:\n              $ref: '#\/components\/schemas\/NewProduct'\n      responses:\n        '201':\n          description: Product created successfully\n          content:\n            application\/json:\n              schema:\n                $ref: '#\/components\/schemas\/Product'\n\n&lt; and so forth .... ><\/code><\/pre>\n\n\n\n<p>Here&#8217;s the file loaded into BurpSuite:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/image-7.png\"><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"404\" src=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/image-7-1024x404.png\" alt=\"\" class=\"wp-image-1889\" srcset=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/image-7-1024x404.png 1024w, http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/image-7-300x118.png 300w, http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/image-7-768x303.png 768w, http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/image-7-1536x606.png 1536w, http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/image-7-2048x809.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p>Then you can add authentication if you need to:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/image-8.png\"><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"715\" src=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/image-8-1024x715.png\" alt=\"\" class=\"wp-image-1890\" srcset=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/image-8-1024x715.png 1024w, http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/image-8-300x210.png 300w, http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/image-8-768x536.png 768w, http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/image-8-1536x1073.png 1536w, http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/image-8.png 1744w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p>The Postman collection looks like this.  It actually can import an OpenAPI spec and output a Postman collection.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\t\"info\": {\n\t\t\"_postman_id\": \"e2c42dd8-dabe-44fd-b90c-9136d35d9167\",\n\t\t\"name\": \"Product Management API\",\n\t\t\"description\": \"A sample API for managing products.\",\n\t\t\"schema\": \"https:\/\/schema.getpostman.com\/json\/collection\/v2.1.0\/collection.json\",\n\t\t\"_exporter_id\": \"6514261\"\n\t},\n\t\"item\": &#91;\n\t\t{\n\t\t\t\"name\": \"products\",\n\t\t\t\"item\": &#91;\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"{productId}\",\n\t\t\t\t\t\"item\": &#91;\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"Get a product by ID\",\n&lt; and so forth ... ><\/code><\/pre>\n\n\n\n<p>Postman Collection loaded into Postman tool &#8212; ready for use:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/image-9.png\"><img decoding=\"async\" loading=\"lazy\" width=\"301\" height=\"286\" src=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/image-9.png\" alt=\"\" class=\"wp-image-1892\"\/><\/a><\/figure>\n\n\n\n<p>So anyway, after you have this all loaded up into BurpSuite &#8212; you can run your scan job on the endpoints and hopefully nothing major to fix.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/image-10.png\"><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"593\" src=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/image-10-1024x593.png\" alt=\"\" class=\"wp-image-1893\" srcset=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/image-10-1024x593.png 1024w, http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/image-10-300x174.png 300w, http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/image-10-768x445.png 768w, http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/image-10.png 1132w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>The product test file I generated with the AI in my Chrome browser is in the following file.  You can test BurpSuite with it or import it into Postman.<\/p>\n\n\n\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-b32d315f-8ef3-4ce0-8070-6985be65e70a\" href=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/Product_OpenAPI.yaml_.zip\">Product_OpenAPI.yaml_<\/a><a href=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/10\/Product_OpenAPI.yaml_.zip\" class=\"wp-block-file__button wp-element-button\" download aria-describedby=\"wp-block-file--media-b32d315f-8ef3-4ce0-8070-6985be65e70a\">Download<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Generating out descriptive schema for your existing applications that AI can well. Working on a Grails API application, I am using with BurpSuite DAST to do some security testing on a regular basis for it. I&#8217;ve needed an API list of endpoints for their API security scan feature for quite some time, that&#8217;s easy to [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[97,1],"tags":[],"_links":{"self":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/1884"}],"collection":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1884"}],"version-history":[{"count":4,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/1884\/revisions"}],"predecessor-version":[{"id":1897,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/1884\/revisions\/1897"}],"wp:attachment":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1884"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1884"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1884"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}