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

Sample generation fails to generate values when re-using definitions in schema #1560

Closed
leflings opened this issue Oct 2, 2022 · 0 comments · Fixed by #1561
Closed

Sample generation fails to generate values when re-using definitions in schema #1560

leflings opened this issue Oct 2, 2022 · 0 comments · Fixed by #1561

Comments

@leflings
Copy link
Contributor

leflings commented Oct 2, 2022

Given this schema:

{
    "definitions": {
        "withNumber": {
            "type": "object",
            "required": ["value"],
            "properties": {
                "value": {
                    "type": "number"
                }
            }
        }
    },
    "type": "object",
    "required": ["number1", "number2"],
    "properties": {
        "number1": { "$ref": "#/definitions/withNumber" },
        "number2": { "$ref": "#/definitions/withNumber" }
    }
}

I get the following JSON when using SampleJsonDataGenerator:

{
  "number1": {
    "value": 0.0
  },
  "number2": null
}

Where I would expect it to generate the following:

{
  "number1": {
    "value": 0.0
  },
  "number2": {
    "value": 0.0
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant