Registering Swagger doc in Javelin v. 2.0.7010 throws 500 Server error.
search cancel

Registering Swagger doc in Javelin v. 2.0.7010 throws 500 Server error.

book

Article ID: 135767

calendar_today

Updated On:

Products

CA Test Data Manager (Data Finder / Grid Tools)

Issue/Introduction

I get an HTTP 500 error trying to register a JSON file in Javelin .
What should the Body and headers look like for registering a JSON file in the server? 

Environment

Test Data Manager
TDM
Javelin

Resolution

It is not possible to perform this kind of upload/object registration via Javelin.
One can use cURL for that purpose.
Here is a sample cURL record

curl -X POST --header 'Content-Type: multipart/form-data' --header 'Accept: application/json' --header 'Authorization: Bearer <some token>' -F body={"objectType":"JSON","headerAt":1,"dataStartsAt":2,"tableNames":[]} -F files=Sample.json 'http://localhost:9999/TDMModelService/api/ca/v1/objects?projectId=7548&versionId=7549'

We need to introduce 2 modifications for this record to make it work:
1. There needs to be added ;type=application/json
2. Data for the body part of formData should have escaped quotes (with backslashes).

These changes are highlighted in bold below:

curl -X POST --header 'Content-Type: multipart/form-data' --header 'Accept: application/json' -header 'Authorization: Bearer <some token>' -F body={\"objectType\":\"JSON\",\"headerAt\":1,\"dataStartsAt\":2,\"tableNames\":[]};type=application/json -F files=Sample.json 'http://localhost:9999/TDMModelService/api/ca/v1/objects?projectId=7548&versionId=7549'