Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generator doesn't work without a Data Plan? #11

Open
brady-aiello opened this issue Jan 15, 2021 · 0 comments
Open

Generator doesn't work without a Data Plan? #11

brady-aiello opened this issue Jan 15, 2021 · 0 comments

Comments

@brady-aiello
Copy link

The README says that Smartype is analytics API agnostic:

Smartype is designed to be used by anyone, but support today is primarily for mParticle's Events API and SDKs by way of the mParticle Smartype receiver.

But the docs say:

Smartype is designed to work with mParticle Data Plans. If you haven’t yet created a Data Plan, you’ll need to do so and download your data plan to work with Smartype.

So what's correct? I'm assuming the latter.

Running the generator is failing for me. And it makes me think I need to become an mParticle customer, and create a Data Plan if I want to run the Smartype generator. Is that correct?

❯ java -jar smartype-generator-1.2.0.jar init
Would you like to generate iOS? [no]: yes
Would you like to generate Android? [no]: yes
Would you like to generate Web? [no]: yes
Where should Smartype libraries be generated [smartype-dist]:
Please specify a file path containing the JSON schema that you'd like to use for generation: data.json
smartype.config.json generated successfully! Have fun :-)
❯ java -jar smartype-generator-1.2.0.jar generate
Extracting mParticle Data Plan
Exception in thread "main" java.lang.NullPointerException
	at com.mparticle.smartype.generator.adapters.MParticleDataPlanAdapter.extractSchemas(MParticleDataPlanAdapter.kt:22)
	at com.mparticle.smartype.generator.Generate.run(Generator.kt:97)
	at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:154)
	at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:162)
	at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:14)
	at com.github.ajalt.clikt.core.CliktCommand.parse(CliktCommand.kt:252)
	at com.github.ajalt.clikt.core.CliktCommand.parse$default(CliktCommand.kt:249)
	at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:267)
	at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:290)
	at com.mparticle.smartype.generator.GeneratorKt.main(Generator.kt:236)

data.json

{
    "smartype_object_name": "doggo",
    "properties": {
        "id": {
            "type": "integer",
            "description": "The doggo UUID"
        },
        "breed": {
            "type": "string",
            "description": "The doggo breed"
        },
        "favorite": {
            "type": "boolean",
            "description": "Whether this doggo breed is a favorite."
        }
    }
}

smartype.config.json

{
    "iosOptions": {
        "enabled": true
    },
    "androidOptions": {
        "enabled": true
    },
    "webOptions": {
        "enabled": true
    },
    "binaryOutputDirectory": "smartype-dist",
    "apiSchemaFile": "data.json",
    "dedupEnums": false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant