Code Monkey home page Code Monkey logo

Comments (2)

aaronsteers avatar aaronsteers commented on September 16, 2024

After careful review and consideration, I found that this represents something of a weakness in how JSON schemas had been modeled, essentially conflating "properties" and "types". I've changed this implementation to more naturally distinguish between types and properties, with a thorough description here: https://gitlab.com/meltano/singer-sdk/-/merge_requests/8

After updating to the latest (via poetry add singer-sdk==0.0.2-dev.1068744002), please replace your sample code above with:

    Property(
        "Datasets",
        ArrayType(
            ObjectType(
                Property("DatasetId", StringType),
                Property("DatasetName", StringType),
            )
        )

The new convention (with formal Property mapping) is demonstrated in this sample code from the MR (now with an added example of how to implement the nested ArrayType(ObjectType):

    jsonschema = PropertiesList(
        Property("id", IntegerType, required=True),
        Property("name", StringType,
        Property("tags", ArrayType(StringType)),
        Property("ratio", NumberType),
        Property("days_active", IntegerType),
        Property("updated_on", DateTimeType),
        Property("is_deleted", BooleanType,
        Property(
            "author",
            ObjectType(
                Property("id", StringType),
                Property("name", StringType),
            )
        ),
        Property(
            "groups",
            ArrayType(
                ObjectType(
                    Property("id", StringType),
                    Property("name", StringType),
                )
            )
        ),

The old syntax, wherein type definitions have names and the required flag, should still work for a little longer, but eventually I think it will probably make sense to move entirely to the new Property syntax as shown above.

Also note that ComplexType (which expected a name argument) is being replaced by ObjectTypes (which does not accept a name argument).

Let me know if you have any difficulty implementing this spec or if you have any questions/concerns. I'm happy to lend a hand as needed.

from tap-powerbi-metadata.

jtimeus-slalom avatar jtimeus-slalom commented on September 16, 2024

I was able to solve this by converting to the new Property spec

from tap-powerbi-metadata.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.