I have been struggling with this for a day. I have...
# singer-tap-development
n
I have been struggling with this for a day. I have created a tap to get user data of duosecurity. The API returns the expected values, it seems there is some issue with the schema. I keep getting the following error:
2024-02-06T11:19:06.266443Z [info     ]     if property_name not in schema["properties"]: cmd_type=elb consumer=False name=tap-duo producer=True stdio=stderr string_id=tap-duo
2024-02-06T11:19:06.266688Z [info     ] KeyError: 'properties'         cmd_type=elb consumer=False name=tap-duo producer=True stdio=stderr string_id=tap-duo
The API response doesn't has a key 'properties', the json schema I have used is generated based on the response I am getting. Everything seems okay, what should I look into?
The API response: { "metadata": { "total_objects": 2 }, "response": [ { "alias1": null, "alias2": null, "alias3": null, "alias4": null, "aliases": {}, "created": 1707133511, "desktoptokens": [], "email": "nirndu@icloud.com", "firstname": null, "groups": [], "is_enrolled": true, "last_directory_sync": null, "last_login": null, "lastname": null, "lockout_reason": null, "notes": "", "phones": [], "realname": "nlendu", "status": "active", "tokens": [], "u2ftokens": [], "user_id": "DUPCY6R0LOCWC5TCEXWC", "username": "nirdiwak", "webauthncredentials": [ { "credential_name": "Face ID / Touch ID (iOS)", "date_added": 1707133573, "label": "Touch ID", "webauthnkey": "WACLOKG3L9XCFL73C4I9" } ] }, { "alias1": null, "alias2": null, "alias3": null, "alias4": null, "aliases": {}, "created": 1707164509, "desktoptokens": [], "email": "masbunty@gmail.com", "firstname": null, "groups": [], "is_enrolled": true, "last_directory_sync": null, "last_login": null, "lastname": null, "lockout_reason": null, "notes": "", "phones": [], "realname": "", "status": "active", "tokens": [], "u2ftokens": [], "user_id": "DUVWOWLFO7YNQ4L91X8Q", "username": "testuser", "webauthncredentials": [ { "credential_name": "Android biometric", "date_added": 1707164563, "label": "Touch ID", "webauthnkey": "WAENVQ0130CL94AMIK3Z" } ] } ], "stat": "OK" }
r
It's not the API response that's missing the
properties
key, it's the schema for the stream. How have you defined your stream schemas?
n
Yes, I have defined them The schema: { "type": "object", "properties": { "response": { "type": "array", "items": { "type": "object", "properties": { "alias1": { "type": ["string", "null"] }, "alias2": { "type": ["string", "null"] }, "alias3": { "type": "null" }, "alias4": { "type": "null" }, "aliases": { "type": "object", "properties": { "alias1": { "type": "string" }, "alias2": { "type": "string" } }, "required": ["alias1", "alias2"] }, "created": { "type": "integer" }, "email": { "type": "string" }, "firstname": { "type": "string" }, "groups": { "type": "array", "items": { "type": "object", "properties": { "desc": { "type": "string" }, "group_id": { "type": "string" }, "mobile_otp_enabled": { "type": "boolean" }, "name": { "type": "string" }, "push_enabled": { "type": "boolean" }, "sms_enabled": { "type": "boolean" }, "status": { "type": "string" }, "voice_enabled": { "type": "boolean" } }, "required": [ "desc", "group_id", "mobile_otp_enabled", "name", "push_enabled", "sms_enabled", "status", "voice_enabled" ] } }, "is_enrolled": { "type": "boolean" }, "last_directory_sync": { "type": ["integer", "null"] }, "last_login": { "type": "integer" }, "lastname": { "type": "string" }, "lockout_reason": { "type": "string" }, "notes": { "type": "string" }, "phones": { "type": "array", "items": { "type": "object", "properties": { "activated": { "type": "boolean" }, "capabilities": { "type": "array", "items": { "type": "string" } }, "encrypted": { "type": "string" }, "extension": { "type": "string" }, "fingerprint": { "type": "string" }, "last_seen": { "type": "string" }, "model": { "type": "string" }, "name": { "type": "string" }, "number": { "type": "string" }, "phone_id": { "type": "string" }, "platform": { "type": "string" }, "postdelay": { "type": "string" }, "predelay": { "type": "string" }, "screenlock": { "type": "string" }, "sms_passcodes_sent": { "type": "boolean" }, "tampered": { "type": "string" }, "type": { "type": "string" } }, "required": [ "activated", "capabilities", "encrypted", "extension", "fingerprint", "last_seen", "model", "name", "number", "phone_id", "platform", "postdelay", "predelay", "screenlock", "sms_passcodes_sent", "tampered", "type" ] } }, "realname": { "type": "string" }, "status": { "type": "string" }, "tokens": { "type": "array", "items": { "type": "object", "properties": { "serial": { "type": "string" }, "token_id": { "type": "string" }, "type": { "type": "string" } }, "required": ["serial", "token_id", "type"] } }, "u2ftokens": { "type": "array" }, "user_id": { "type": "string" }, "username": { "type": "string" }, "webauthncredentials": { "type": "array", "items": { "type": "object", "properties": { "credential_name": { "type": "string" }, "date_added": { "type": "integer" }, "label": { "type": "string" }, "webauthnkey": { "type": "string" } }, "required": ["credential_name", "date_added", "label", "webauthnkey"] } } }, "required": [ "alias1", "alias2", "alias3", "alias4", "aliases", "created", "email", "firstname", "groups", "is_enrolled", "last_directory_sync", "last_login", "lastname", "lockout_reason", "notes", "phones", "realname", "status", "tokens", "u2ftokens", "user_id", "username", "webauthncredentials" ] } } } }
With the above schema, I don't get errors but I don't get any extracted data too
The json path I've set is: '$.response[*]'
r
Is that schema in a JSON file? How are you referencing the schema in your stream?
n
I have these as json files in schemas folder. The path is correct