Hello, I am using `tap-rest-api-msdk` (widen varia...
# troubleshooting
j
Hello, I am using
tap-rest-api-msdk
(widen variant) to extract data from an api and have data coming out of it that looks something like this:
Copy code
{
	"teams": [
		{"id": 1, ...},
		{"id": 2, ...},
		{"id": 3, ...}
	]
}
When this gets loaded in my target (postgres), it just dumps the entire json data into a single row column as a string. Is there a way to have meltano parse out the "teams" array and load each into its own row?
1
e
Hi @joe_enser! Is each element of
teams
here a record of the stream on question, or is
teams
part of a larger record? If it's the former, you might wanna take a look at `records_path`:
`records_path`: optional: a jsonpath string representing the path in the requests response that contains the records to process. Defaults to
$[*]
.
j
Thank you @Edgar Ramírez (Arch.dev). To answer your question, yes each element of
teams
is a record. I just tried using
records_path
like this:
records_path: $['teams']
And am getting this error:
Copy code
ValueError: Input must be a dict object.
Also tried:
records_path: $['teams'][*]
and get this error:
Copy code
Run invocation could not be completed as block failed: Extractor failed
Any thoughts on what I'm doing wrong here?
Nevermind, had an issue in my streams config for the primary key. I'm good to go now. Thank you for all the help!
e
Awesome, glad you figured it out!
👍 1