joelittlejohn / jsonschema2pojo

Generate Java types from JSON or JSON Schema and annotate those types for data-binding with Jackson, Gson, etc
http://www.jsonschema2pojo.org
Apache License 2.0
6.22k stars 1.66k forks source link

Generation failure after upgrade #1568

Closed AllenF88 closed 11 months ago

AllenF88 commented 11 months ago

Hi all

Upgrading from v 1.1.0 to 1.2.1 I now get this error: generate failed: Path not present: Single Sided

here is the implementation in the pom file.

<plugin>
    <groupId>org.jsonschema2pojo</groupId>
    <artifactId>jsonschema2pojo-maven-plugin</artifactId>
    <version>1.2.1</version>
    <configuration>
        <sourceDirectory>${basedir}/src/main/resources/schema</sourceDirectory>
        <targetPackage>com.#####.integration.consumers.generated</targetPackage>
    </configuration>
    <executions>
        <execution>
            <goals>
                <goal>generate</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Any ideas?

Stacktrace.log

unkish commented 11 months ago

Hi

It's rather hard to say what might be the cause without minimal sample schema which would reproduce the issue

joelittlejohn commented 11 months ago

Yes, are you able to provide a small snippet @AllenF88? Something that sticks out immediately is that the property name contains a space, I wonder if we have some poor handling of spaces when looking up a property. This is surprising as I'm sure we have tests for that.

AllenF88 commented 11 months ago

Hi all. Apologies I thought I closed this yesterday. The issue was in one of the schemas, a ? snuck into the field name. this wasnt an issue on the older version though. But its better that its being validating.

unkish commented 11 months ago

Properties with ? will be supported in next build/release (fixed with https://github.com/joelittlejohn/jsonschema2pojo/pull/1522)