Skip to content

Wrong class name when using $ref in json schema #164

@razem-io

Description

@razem-io

We have the following issue:

alliance.json

{
  "type": "object",
  "properties": {
    "tag": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "points": {
      "type": "integer"
    },
    "diplomacy": {
      "type": "object",
      "properties": {
        "treaties": {
          "type": "array",
          "items": {
               "$ref": "alliance_treaty.json"
          }
        },
        "ownOffers": {
          "type": "array",
          "items": {
               "$ref": "alliance_treaty.json"
          }
        },
        "foreignOffers": {
          "type": "array",
          "items": {
               "$ref": "alliance_treaty.json"
          }
        }
      }
    }
  }
}

alliance_treaty.json

{
  "type": "object",
  "properties": {
    "allianceId": {
      "type": "integer"
    },
    "otherAllianceId": {
      "type": "integer"
    },
    "type": {
      "type": "integer"
    },
    "status": {
      "type": "integer"
    } 
  }
}

We expect the output to be like this:

  • Alliance.java
  • AllianceTreaty.java

Actual result is:

  • Alliance.java
  • Treaty.java

This only happens when using "$ref" otherwise the class gets generated correctly. Is this a bug or are we missing something?

Thanks for your time!
Julian

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions