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

[Postman] Importing request with "formdata" of type "file" fails silently #2462

Closed
2 tasks done
darylteo opened this issue Jun 17, 2024 · 1 comment · Fixed by #2463
Closed
2 tasks done

[Postman] Importing request with "formdata" of type "file" fails silently #2462

darylteo opened this issue Jun 17, 2024 · 1 comment · Fixed by #2463
Assignees
Labels
bug Something isn't working

Comments

@darylteo
Copy link

darylteo commented Jun 17, 2024

I have checked the following:

  • I use the newest version of bruno.
  • I've searched existing issues and found nothing related to my issue.

Describe the bug

index.html:1 Uncaught (in promise) Error: Error invoking remote method 'renderer:import-collection': TypeError: Cannot read properties of undefined (reading 'includes')

As per https://schema.postman.com/collection/json/v2.1.0/draft-07/collection.json:683, a formdata body may have "key:value" attributes for type "string", but "key:src" instead for type "file".

.bru file to reproduce the bug

{
	"info": {
		"_postman_id": "redacted",
		"name": "redacted",
		"description": "redacted",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
		"_exporter_id": "",
		"_collection_link": ""
	},
	"item": [
		{
			"name": "Profile",
			"item": [
				{
					"name": "Update profile avatar",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{AUTH_TOKEN}}",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"value": "application/json",
								"type": "text"
							},
							{
								"key": "Content-Type",
								"value": "application/json",
								"type": "text"
							}
						],
						"body": {
							"mode": "formdata",
							"formdata": [
								{
									"key": "avatar",
									"type": "file",
									"src": "/Users/darylteo/Downloads/demo-images/001.jpg"
								}
							]
						},
						"url": {
							"raw": "{{API_URL}}/auth/profile/avatar",
							"host": [
								"{{API_URL}}"
							],
							"path": [
								"auth",
								"profile",
								"avatar"
							]
						},
						"description": ""
					},
					"response": [
						
					]
				}
			]
		}
	]
}

Screenshots/Live demo link

https://imgur.com/XmfbmLO

@darylteo darylteo added the bug Something isn't working label Jun 17, 2024
@sanjai0py sanjai0py self-assigned this Jun 17, 2024
@sanjai0py sanjai0py mentioned this issue Jun 17, 2024
5 tasks
helloanoop pushed a commit that referenced this issue Jun 18, 2024
* fixed

* refactor: conditionals.

* refactor: Update importPostmanV2CollectionItem function to handle file and text formdata
@helloanoop
Copy link
Contributor

The PR is merged.

Thanks for taking care of this @sanjai0py !
This is set to go out in the upcoming v1.20.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants