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

Generating classes fails if json-key contains whitespaces #1666

Closed
tobi-he opened this issue Feb 17, 2025 · 3 comments
Closed

Generating classes fails if json-key contains whitespaces #1666

tobi-he opened this issue Feb 17, 2025 · 3 comments

Comments

@tobi-he
Copy link

tobi-he commented Feb 17, 2025

Since version 1.1.2 of the jar-file and the maven-plugin (probably also with all other runners) generating java classes fails, if the json-key contains whitespaces. With version 1.1.1 it works

With the following example.json

{
   "hello world": "value"
}

the following error occurs

Execution default of goal org.jsonschema2pojo:jsonschema2pojo-mavenplugin:1.1.2: generate failed: Path not presend: hello%20world

How to reproduce:

Use the example.json from above and the following configuration of the maven-plugin

<plugin>
  <groupId>org.jsonschema2pojo</groupId>
  <artifactId>jsonschema2pojo-maven-plugin</artifactId>
  <version>1.1.2</version> <!-- or higher -->
  <configuration>
    <sourcePaths>${basedir}/example.json</sourcePaths>
    <sourceType>json</sourceType>
  </configuration>
  <executions>
    <execution>
      <goals>
        <goal>generate</goal>
      </goals>
    </execution>
  </executions>
</plugin>

Run mvn clean compile

@unkish
Copy link
Collaborator

unkish commented Feb 17, 2025

This seems to be duplicate of #1623

@tobi-he
Copy link
Author

tobi-he commented Feb 17, 2025

Yes, you are right. Sorry, I was just looking for whitespace instead of space. So this issue can be closed as duplicate

@unkish
Copy link
Collaborator

unkish commented Feb 18, 2025

No worries

@unkish unkish closed this as completed Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants