While this may be good enough, you may eventually want to customize the look of your documentation. So far, all we did was playing with existing themes. If you want to know the list of themes that are available in your local environment, simply use the following command: However it could contain other templates or resources. A theme contains an index.tpl file, this is the only requirement. This is done by exposing the collection data with a few helpers to a theme. The whole point of Postmanerator is to be able to generate beautiful documentations from a Postman collection. When Postmanerator is done executing all the snippets, it will look for defined objects in the APIStructures global variable and make these structures definitions available for the theme. You can define as many of these code snippets as you need, even in multiple independant requests. The name of the function populateNewAPIStructures is also important as Postmanerator will execute this exact function. The /*]*/ and /*]*/ delimiters are important, Postmanerator will search for these delimiters to identify the portion of Javascript it needs to interpret. *]*/ function populateNewAPIStructures ( ) /*]*/ You can prevent Postmanerator to render them by providing comma seperated lists of headers to the following options: Maybe they are some request/response headers you don't want to see in your documentation. Prevent arbitrary request/response headers to be rendered You can change that by providing a path to the -output=/path/to/generated/doc.html option. Provide the outputīy default, Postmanerator will print the generated output to the standard output. You can either provide a theme name from the official themes repository, or a full local path to theme folder. Provide a themeīy default, Postmanerator will use its default theme, but you can change it by using the -theme=theme_name option. Use the -environment=/path/to/environment.json option to provide the environment to Postmanerator. You can get more information about Postman environments from the official documentation. The environment file is a JSON file generated from the Postman UI. Use the -collection=/path/to/collection.json option to provide the collection to Postmanerator. You can get more information about Postman collection from the official documentation. The collection is a JSON file generated from the Postman UI. You may want to use them to show different potential responses to your users, like a "successfull" response or an "invalid data error" response.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |