Skip to content

Latest commit

 

History

History

postman

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Postman

This directory contains templates associated with generating Postman configurations.

This document was created by template: local:/../ec-std-lib/templates/document/TemplateMarkdown

Template Summary

Template Description
PostmanTemplate Generates the Postman configuration for your endpoints.

Each of the template files will be covered in more detail below.

Postman Template

Postman is a nice tool for hitting your endpoints directly. However, it can take a long time to configure it for each of your endpoints. That's where this template is great, it generates the Postman configuration file specific to the endpoints generated by the ControllerTemplate!

Template Configuration

There are a number of ways to configure how the template generates the Postman configuration.

When declaring this template in your configuration {} block, inside the template PostmanConfig {} block add a config{} block with the values for the below parameters set.

Login

Most server applications have a login endpoint where you login with a username and password and it returns a token that you can then use for authentication for each subsequent access. The template will generate a configuration for a login endpoint and can be configured with the following template config parameters:

Template Config Parameter Description
loginUrlPath After the hostname, this is the URL path to be used for the login endpoint.
loginBody Typically the body is where some authentication related values go like a username and password.

The URL for the login endpoint will look like this:

http://{{secureHostnamePrefix}}{{hostname}}/loginUrlPath

where secureHostnamePrefix and hostname are Postname configuration parameters. This allow you to more easy change to different servers from within Postman. The secureHostnamePrefix is provided in case the login hostname is different than for the main endpoints and requires a prefix to the hostname.

Main Endpoints

The template can be configured with the following input parameters:

Template Config Parameter Description
apiName The first portion of the endpoint URLs (see below)
title A title for this Postman configuration.
description A description of this Postman configuration.
postmanId A UUID that you want to associate with the configuration. Postman uses this to uniquely identify this configuration so if you load the configuration again it will replace the existing one that has this ID.

The endpoints generated will all start as follows:

https://{{hostname}}/apiName/...

Where {{hostname}} is a Postman configuration parameter. This means that when you are using a configuration generated by this template, you can switch to a different server simply by choosing a different value for hostname right within Postman. This allows you to reuse this generationed configuration file for multiple servers where you are hosting your application.

References
Domains Model Service JSONDTO Controller APIPath