Hi! This may be a total beginner question. However...
# getting-started
j
Hi! This may be a total beginner question. However, I am trying to create a tap that just
yields
one field per row which is a dictionary (essentially the JSON returned by the API I am querying). However, there doesn't seem to be a
DictType
I can specify in the schema? How do I do this?
v
Object is what you're after as it's json schema
j
Hi, could you please provide an example? From the example I see in the docs, I still have to give the properties
Copy code
Examples:
            >>> t = ObjectType(
            ...     Property("name", StringType, required=True),
            ...     Property("age", IntegerType),
            ...     Property("height", NumberType),
            ...     additional_properties=False,
            ... )
So essentially, I just want the tap to record a row as this:
Copy code
"payload": {
       "name": ...,
       "age": ...,
       "dict_like_entry": {...},
        ...
}
v
So this is a #C01PKLU5D1R question using the sdk? You're developing a tap using the SDK. I'm not certain about the code exactly in the SDK for an empty object I"d have to spend some time in the sdk library, but you can just point to a json schema file, and then point to an Object without defined properties. You could probably hack it at a minimum and do this
Copy code
Examples:
            >>> t = ObjectType(
            ...     Property("stub", StringType)
            ...     additional_properties=True,
            ... )
There's a class property somewhere that allows options for validation of objects at different levels, you'd have to find that too and turn it off I'd have to dig a bit