Skip to content

Recursive schema $ref generates an extra class #368

Closed

Description

@rpatrick00

I am trying to create a schema for a recursive etcd directory listing. From what I can tell, it should look something like this:

{
    "id": "EtcdDirectoryListing",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "The etcd Manifest used for recursive directory listings",
    "type": "object",
    "properties": {
    "action": { "type": "string" },
    "node": {
        "id": "EtcdNode",
        "description": "Etcd key-value node",
        "type": "object",
        "properties": {
        "key": { "type": "string" },
        "dir": { "type": "boolean" },
        "nodes": {
            "type": "array",
            "items": {
            "$ref": "#/properties/node"
            }
        },
        "modifiedIndex": { "type": "integer" },
        "createdIndex": { "type": "integer" }
        }
    }
    }
}

The problem I am having is that the Maven plugin is generating both a Node.java and a Node_.java class. I was expecting it to generate a single Node.java class that contains a List element in it. I assume that I am doing something stupid so any help would be appreciated.

Activity

  1. dadrus commented on Jan 12, 2016

    @dadrus
    Contributor

    This is same as #481. Possible solution is proposed in its description.

  2. added this to the 1.1.2 milestone on Apr 26, 2021
  3. added a commit that references this issue on Aug 8, 2024
    a0bf7f5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions