Hello Everyone, I’m new to Meltano, so apologies ...
# getting-started
s
Hello Everyone, I’m new to Meltano, so apologies if this isn’t the right channel for my question. I’m facing an issue with a
tap-rest-api-msdk
extractor where I’m encountering a JSON decoding error. The API endpoint I’m using points to a CSV file hosted on AWS API Gateway. When I tested the API endpoint in Postman, it returned a 200 OK status and successfully provided the text data. However, I wrote my first meltano.yml file to replicate the same operation, but I’m running into an error related to JSON decoding. The API is suppose returns a CSV file, and I’ve specified the Content-Type in the headers as text/csv, but I’m unsure if I’ve configured it correctly. Here’s the error I’m seeing below Any guidance or suggestions to resolve this would be greatly appreciated! Thank you!
File "site-packages/singer_sdk/tap_base.py", line 134, in streams
for stream in self.load_streams():
File "site-packages/singer_sdk/tap_base.py", line 358, in load_streams
for stream in self.discover_streams():
File "site-packages/tap_rest_api_msdk/tap.py", line 494, in discover_streams
schema = self.get_schema()
File "site-packages/tap_rest_api_msdk/tap.py", line 615, in get_schema
extract_jsonpath(records_path, input=_json())
File "site-packages/requests/models.py", line 978, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Here is my first ever version meltanol.yaml not sure if I am using a wrong version or doing the wrong thing just follow the basic instructions
version: 1
default_environment: dev
project_id: fcde5f5-df01-438f-9b43-dd0e0f50e48a
environments:
name: dev
config:
plugins:
extractors:
name: tap-rest-api-msdk
config:
api_url: https://api.stormvistawxmodels.com/v1/model-data/ecmwf-eps/20250109/12
streams:
name: ercot-solargen-forecast
path: ~/home/file.csv
headers:
content-type: text/csv
# api_keys:
#   X-API-KEY: <your-api-key>
loaders:
name: target-azureblobstorage
config:
account_name: dlsdevgbaz1527foan1st
container_name: xxxxxxxxxxxx
environments:
name: staging
name: prod
plugins:
extractors:
▪︎
name: tap-rest-api-msdk
variant: widen
pip_url: tap-rest-api-msdk
loaders:
▪︎
name: target-azureblobstorage
variant: shrutikaponde-vc
pip_url: git+https://github.com/shrutikaponde-vc/target-azureblobstorage.git
e
Hi @Samson Eromonsei! The tap is very much oriented towards JSON APIs and it doesn't seem to have a way of processing any other types of responses. That means you'll need to build your own tap that overrides RESTStream.parse_response.