2

I ran into an issue uploading file (png/jpg) with projectId, AppID and assets= [{"label": "image"}].

I do not need to use token.

Here is what I used to write script:

Feature: Upload a Asset

Scenario: upload file
    Given url "http://localhost:3004/api/design/assets/upload" 
    And multipart file files = { read: 'classpath:com/Repository/helpers/garden.jpg' }  
    And multipart field projectId = "someprojectId"
    And multipart field appId = '5f7b2d87-e12b-4f17-9c30-a476132b9efc'
    And multipart field assets = '[{"label":"garden.jpg"}]'
    When method post
    Then status 200

And the response I am getting is:

>>> failed features:
status code was: 500, expected: 200, response time in milliseconds: 134, url: http://localhost:3004/api/design/assets/upload, response: 
{"error":{"message":"projectId cannot be empty!","extensions":{"code":"GRAPHQL_VALIDATION_FAILED"}}}

When I run this in UI or in postman, the rest call is going through. I verified for port is working for end point.

Is this a bug not accepting the projectId and appId as multipart fields? Even after adding the projectId why is it still looking for projectId?

2
  • multi-part is hard. the best I can do is point teams to info they can use to self-troubleshoot: stackoverflow.com/a/60891444/143475 Commented Jan 16 at 11:41
  • 1
    I agree. That is my backup plan . Thanks for the response Commented Jan 16 at 14:46

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.