Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response can contains a "name" attribute #165

Open
jmini opened this issue Sep 8, 2020 · 1 comment
Open

Response can contains a "name" attribute #165

jmini opened this issue Sep 8, 2020 · 1 comment

Comments

@jmini
Copy link
Contributor

jmini commented Sep 8, 2020

When you save a response inside an Item in your collection. You can see it in the UI using the "Examples" menu:

Postman Examples menu

Then you see that there is a "Name" field and you can modify it:
Editing an Example in Postman

The corresponding exported collection is:

{
	"info": {
		"_postman_id": "8eb2ed98-751a-4cb1-802e-3a68fc75aece",
		"name": "example",
		"description": "This is an example",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
	},
	"item": [
		{
			"name": "Echo",
			"protocolProfileBehavior": {
				"strictSSL": true
			},
			"request": {
				"method": "GET",
				"header": [],
				"url": {
					"raw": "https://postman-echo.com/get?foo1=bar1&foo2=bar2",
					"protocol": "https",
					"host": [
						"postman-echo",
						"com"
					],
					"path": [
						"get"
					],
					"query": [
						{
							"key": "foo1",
							"value": "bar1"
						},
						{
							"key": "foo2",
							"value": "bar2"
						},
						{
							"key": "foo3",
							"value": "bar3",
							"disabled": true
						}
					]
				}
			},
			"response": [
				{
					"name": "An example response",
					"originalRequest": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://postman-echo.com/get?foo1=bar1&foo2=bar2",
							"protocol": "https",
							"host": [
								"postman-echo",
								"com"
							],
							"path": [
								"get"
							],
							"query": [
								{
									"key": "foo1",
									"value": "bar1"
								},
								{
									"key": "foo2",
									"value": "bar2"
								},
								{
									"key": "foo3",
									"value": "bar3",
									"disabled": true
								}
							]
						}
					},
					"status": "OK",
					"code": 200,
					"_postman_previewlanguage": "json",
					"header": [
						{
							"key": "Date",
							"value": "Tue, 08 Sep 2020 08:04:27 GMT"
						},
						{
							"key": "Content-Type",
							"value": "application/json; charset=utf-8"
						},
						{
							"key": "Content-Length",
							"value": "419"
						},
						{
							"key": "Connection",
							"value": "keep-alive"
						},
						{
							"key": "ETag",
							"value": "W/\"1a3-vwFawOO37OnYQGNtBFLTPixH31M\""
						},
						{
							"key": "Vary",
							"value": "Accept-Encoding"
						},
						{
							"key": "set-cookie",
							"value": "sails.sid=s%3ApyF9hzzYC5NjV7ogxvM7BNPFymP9Ls8H.DK8FFg7FOhLkO1RfjI9xv%2FzSGxGFsmnZG4lzuU2aUFQ; Path=/; HttpOnly"
						}
					],
					"cookie": [],
					"body": "{\n    \"args\": {\n        \"foo1\": \"bar1\",\n        \"foo2\": \"bar2\"\n    },\n    \"headers\": {\n        \"x-forwarded-proto\": \"https\",\n        \"x-forwarded-port\": \"443\",\n        \"host\": \"postman-echo.com\",\n        \"x-amzn-trace-id\": \"Root=1-5f573b0b-f2778ce614aa4802e5e31d63\",\n        \"user-agent\": \"PostmanRuntime/7.26.3\",\n        \"accept\": \"*/*\",\n        \"cache-control\": \"no-cache\",\n        \"postman-token\": \"1818d9cc-912f-4a22-bc79-a0a8d653d3c1\",\n        \"accept-encoding\": \"gzip, deflate, br\"\n    },\n    \"url\": \"https://postman-echo.com/get?foo1=bar1&foo2=bar2\"\n}"
				}
			]
		}
	],
	"event": [
		{
			"listen": "prerequest",
			"script": {
				"id": "d9560c6b-a476-48b8-9956-8841f7b1477a",
				"type": "text/javascript",
				"exec": [
					""
				]
			}
		},
		{
			"listen": "test",
			"script": {
				"id": "5a557916-971a-4b7a-ab08-13581ecf2a71",
				"type": "text/javascript",
				"exec": [
					""
				]
			}
		}
	],
	"protocolProfileBehavior": {}
}

As you can see on line 46, there is a name attribute containing the value.

But the schema doesn't describes this name attribute, inside the properties map:

@jmini
Copy link
Contributor Author

jmini commented Sep 8, 2020

From the same example you also see a _postman_previewlanguage attribute in the Response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant