Feature: Assign values conditionally

  Scenario: Values depend on another property
    Given the following JSON schema:
      """
      {
        "$schema": "http://json-schema.org/draft-04/schema#",
        "type": "object",
        "oneOf": [
          { "$rel": "#/definitions/californiaAddress" },
          { "$rel": "#/definitions/floridaAddress"}
        ],
        "definitions": {
          "californiaAddress": {
            "street": { "type": "string" },
            "city": {
              "type": "string",
              "enum": [
                "San Diego",
                "Los Angeles",
                "San Francisco",
                "Sacramento"
              ]
            },
            "state": {
              "type": "string",
              "enum": [ "CA" ]
            },
            "zip": {
              "type": "string",
              "pattern": "\\d{5}"
            }
          },
          "floridaAddress": {
            "street": { "type": "string" },
            "city": {
              "type": "string",
              "enum": [
                "Miami",
                "Orlando",
                "St. Petersburg",
                "Tampa",
                "Fort Lauderdale",
                "Tallahassee",
                "Hialeah",
                "Jacksonville"
              ]
            },
            "state": {
              "type": "string",
              "enum": [ "FL" ]
            }
          }
        }
      }
      """
    When I run the JSON data generator
    Then the output should match the schema

Feature: Assign values conditionally

  Scenario: Values depend on another property
    Given the following JSON schema:
      """
      {
        "$schema": "http://json-schema.org/draft-04/schema#",
        "type": "object",
        "oneOf": [
          { "$rel": "#/definitions/californiaAddress" },
          { "$rel": "#/definitions/floridaAddress"}
        ],
        "definitions": {
          "californiaAddress": {
            "properties": {
              "street": { "type": "string" },
              "city": {
                "type": "string",
                "enum": [
                  "San Diego",
                  "Los Angeles",
                  "San Francisco",
                  "Sacramento"
                ]
              },
              "state": {
                "type": "string",
                "enum": [ "CA" ]
              },
              "zip": {
                "type": "string",
                "pattern": "\\d{5}"
              }
            }
          },
          "floridaAddress": {
            "properties": {
              "street": { "type": "string" },
              "city": {
                "type": "string",
                "enum": [
                  "Miami",
                  "Orlando",
                  "St. Petersburg",
                  "Tampa",
                  "Fort Lauderdale",
                  "Tallahassee",
                  "Hialeah",
                  "Jacksonville"
                ]
              },
              "state": {
                "type": "string",
                "enum": [ "FL" ]
              }
            }
          }
        }
      }
      """
    When I run the JSON data generator
    Then the output should match the schema

Fix syntax of JSON Schema
Fix syntax of JSON Schema
