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

Schema relationships should be placed under properties #26

Closed
nwinch opened this issue Apr 8, 2016 · 1 comment
Closed

Schema relationships should be placed under properties #26

nwinch opened this issue Apr 8, 2016 · 1 comment
Labels

Comments

@nwinch
Copy link
Contributor

nwinch commented Apr 8, 2016

When generating a relationship, the related property is incorrectly placed at the root of the schema. This should be placed under properties.

Example: redbeard controller wolf -r sheep generates:

{
  ...
  "properties": {
    "id": {
      "type": "string",
      "faker": "random.uuid"
    },
    "name": {
      "type": "string",
      "faker": "name.findName"
    }
  },
  "sheep": {
    "type": "string",
    "faker": "random.uuid",
    "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
  },
  "links": [
    {
      "rel": "sheep",
      "href": "/sheep/{sheep}"
    }
  ],
  ...
}

Should be:

{
  ...
  "properties": {
    "id": {
      "type": "string",
      "faker": "random.uuid"
    },
    "name": {
      "type": "string",
      "faker": "name.findName"
    },
    "sheep": {
      "type": "string",
      "faker": "random.uuid",
      "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
    },
  },
  "links": [
    {
      "rel": "sheep",
      "href": "/sheep/{sheep}"
    }
  ],
  ...
}
@davidbanham
Copy link
Contributor

Fixed by #27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants