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

Please increase schema length constraint more than 51200 chars #551

Closed
RamNareshN opened this issue Apr 21, 2016 · 6 comments
Closed

Please increase schema length constraint more than 51200 chars #551

RamNareshN opened this issue Apr 21, 2016 · 6 comments

Comments

@RamNareshN
Copy link

I have a large schema which is more than 51K chars. While generating pojo's using this schema I am getting below length constraint.

There's a problem: Your input was larger than 51200 characters, try making this a bit smaller.

Could you help me out to execute my large schema.

@joelittlejohn
Copy link
Owner

If you have larger schemas it's best to use one of the plugins to generate code (CLI, Maven, Gradle). The website isn't really there to process large amounts of data.

@RamNareshN
Copy link
Author

Thank you Joe.
On Apr 21, 2016 4:19 PM, "Joe Littlejohn" [email protected] wrote:

If you have larger schemas it's best to use one of the plugins to generate
code (CLI, Maven, Gradle). The website isn't really there to process large
amounts of data.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#551 (comment)

@annemariepeek
Copy link

annemariepeek commented Jul 2, 2024

I'm trying to generate a pojo from a larger schema via a gradle task, and unfortunately I'm having issues generating. For files with 51k characters and less the gradle task works, so I know I configured it correctly. For the large file the gradle build is successfull, however I don't get the generated output. Is there something I am missing in my build.gradle file?

plugins {
    id 'java'
    id "org.jsonschema2pojo" version "1.2.1"
}

dependencies {
    ... other dependencies
    implementation 'com.fasterxml.jackson.core:jackson-databind:2.12.3'
    implementation 'org.jsonschema2pojo:jsonschema2pojo-core:1.1.1'
    implementation 'org.jsonschema2pojo:jsonschema2pojo-cli:1.1.1'
}

sourceSets {
    generated {
        java {
            srcDir "path/to/dir/GeneratedAdaptiveCard"
        }
    }
}

task generateAdaptiveCardClasses(type: JavaExec) {
    main = 'org.jsonschema2pojo.cli.Jsonschema2PojoCLI'
    classpath = sourceSets.main.runtimeClasspath
    args = [
            '--source', "path/to/json/adaptive-card.json",
            '--target', "path/to/target/GeneratedAdaptiveCard",
            '--package', 'com.teams.adaptivecards',
            '--generate-builders',
    ]
}

The schema in question is this adaptive-card.json file from Microsoft (unfortunately there isn't a java SDK for Adaptive Cards).

Thank you!

@joelittlejohn
Copy link
Owner

I don't know if any limit when using the gradle plugin. The limit only applies to the online generator at jsonschema2pojo.org.

Do you see any errors?

@annemariepeek
Copy link

No errors. The build is successful however there is no output. The adaptive card schema version 1.1.0 works, however I suspect it's because that schema is significantly smaller (1.1.0 also generates on jsonschema2pojo.org). Also the flags --info and --debug are quite unhelpful and don't signal any errors

@unkish
Copy link
Collaborator

unkish commented Jul 4, 2024

It seems that referred schema v. 1.5.0 does not generate any output as it has only 2 "keywords" under root:

    "definitions": {
    ...
    },
    "anyOf": [{
            "allOf": [{
                    "$ref": "#/definitions/AdaptiveCard"
                }
            ]
        }
    ]

Note that at present jsonschema2pojo does not process

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

4 participants