tmp to delete

by Leo

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/ajv/8.10.0/ajv7.bundle.js"></script>
<p>
Test discriminator in AJV v8.10.0
See  <a href="https://cdnjs.com/libraries/ajv">cdnjs:ajv </a>
</p>

CSS

html, document {
  background-color: black;
}

JavaScript

var schema = {
    "$defs": {
        "A": {
            "properties": {
                "foo": {
                    "const": "x"
                },
                "a": {
                    "type": "string"
                },
            },
            "required": ["a"],
        },
        "B": {
            "properties": {
                "foo": {
                    "enum": ["y", "z"]
                },
                "b": {
                    "type": "string"
                },
            },
            "required": ["b"],

        },
        "C": {
            "type": "object",
            "discriminator": {
                "propertyName": "foo"
            },
            "required": ["foo"],
            "oneOf": [{
                    "$ref": "#/$defs/A"
                }, {
                    "$ref": "#/$defs/B"
                },
            ]
        }
    },
    "type": "object",
    "properties": {
        "cs": {
            "items": {
                "$ref": "#/$defs/C"
            },
            "type": "array"
        }
    },
    "required": [
        "cs"
    ]	

};

var json = {
    "templateId": "1f365261-2d8c-40e4-8e1c-007e1f6600e4",
    "templateName": "stub template acceptance PP_new1",
    "sheets": [
        {
            "id": "f3a00b0d-7400-4041-8a47-4d5f603250ea",
            "sheetName": "Coverage 4G",
            "technology": "4G",
            "charts": [],
            "acceptanceKpis": [],
            "type": "mdt",
            "kpiThresholds": [{
                    "kpiName": "rsrpDiscrepancyPct",
                    // todo: changed type
                    "threshold": 60.000000
                }, {
                    "kpiName": "rsrqDiscrepancyPct",
                    // todo: changed type
                    "threshold": 61.000000
                }, {
                    "kpiName": "overshootingPct",
                    // todo: changed type
                    "threshold": 62.000000
                }, {
               ...