Sha256: 6bd2f1097ec7717ac3500711f14fa0df20f74300dd450e9ec11b9717bdb33521

Contents?: true

Size: 1.98 KB

Versions: 6

Compression:

Stored size: 1.98 KB

Contents

Feature: Assign values conditionally
  Scenario: Multiple schemas inline
    Given the following JSON schema:
      """
      {
        "$schema": "http://json-schema.org/draft-04/schema#",
        "type": "object",
        "oneOf": [
          {
            "required": [ "foo", "bar" ],
            "properties": {
              "foo": { "type": "string" },
              "bar": { "type": "integer" }
            }
          },
          {
            "required": [ "baz", "qux" ],
            "properties": {
              "baz": { "type": "string" },
              "qux": { "type": "string" }
            }
          }
        ]
      }
      """
    When I run the JSON data generator
    Then the output should match the schema

  Scenario: Multiple schemas with refs
    Given the following JSON schema:
      """
      {
        "$schema": "http://json-schema.org/draft-04/schema#",
        "type": "object",
        "oneOf": [
          { "$ref": "#/definitions/californiaAddress" },
          { "$ref": "#/definitions/floridaAddress"}
        ],
        "definitions": {
          "californiaAddress": {
            "required": [ "city", "state" ],
            "properties": {
              "city": {
                "type": "string",
                "enum": [
                  "San Diego",
                  "Los Angeles"
                ]
              },
              "state": {
                "type": "string",
                "enum": [ "CA" ]
              }
            }
          },
          "floridaAddress": {
            "required": [ "city", "state" ],
            "properties": {
              "city": {
                "type": "string",
                "enum": [
                  "Miami",
                  "Orlando"
                ]
              },
              "state": {
                "type": "string",
                "enum": [ "FL" ]
              }
            }
          }
        }
      }
      """
    When I run the JSON data generator
    Then the output should match the schema

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
json_test_data-1.2.0 features/conditional_properties.feature
json_test_data-1.1.3 features/conditional_properties.feature
json_test_data-1.1.2 features/conditional_properties.feature
json_test_data-1.1.1 features/conditional_properties.feature
json_test_data-1.1.0 features/conditional_properties.feature
json_test_data-1.0.0 features/conditional_properties.feature