Skip to content
This repository has been archived by the owner on Mar 23, 2021. It is now read-only.

Schema parsing error #1

Open
YuriOsokin opened this issue Jun 14, 2016 · 1 comment
Open

Schema parsing error #1

YuriOsokin opened this issue Jun 14, 2016 · 1 comment

Comments

@YuriOsokin
Copy link

Schema's type sometimes is evaluated as cell of values, and sometimes as a string. In JSON.m line 250 if the type is string 'object', ismember() function returns array and the && in the conditional statement throws an error.
The json file and the schema are attached.
ParametersSchema.txt
Parameters.txt

@decatur
Copy link
Owner

decatur commented Jun 15, 2016

Hi Yuri,

currently, referenced schemas outside the normal schema structure must be under definitions.
Also, the schema under Calibration is invalid.

Right now the schema parser is not very sophisticated in validating schemas, so I will keep this ticket open.

There was issue #4, thanks.

Below is your rewritten schema which works for me.

Greetings Wolfgang

{
    "title": "KLM Schema",
    "type": "object",
    "properties": {
        "SEK": {
            "description": "SEK parameters",
            "type": "object",
            "required": [
                "Modules"
            ],
            "properties": {
                "Modules": {
                    "type": "object",
                    "required": [
                        "PF"
                    ],
                    "properties": {
                        "PF": {
                            "type": "object",
                            "oneOf": [
                                {"$ref": "#/definitions/Filter"},
                                {"$ref": "#/definitions/Calibration"}
                            ]
                        }
                    }
                }
            }
        },
        "Signals": {
            "type": "object"
        }
    },
    "required": [
        "SEK",
        "Signals"
    ],
    "definitions": {
        "Filter": {
            "type": "object",
            "required": [
                "Type",
                "Value"
            ],
            "properties": {
                "Type": {
                    "type": "string",
                    "pattern": "Filter"
                }
            }
        },
        "Calibration": {
            "type": "object",
            "required": [
                "Type",
                "Value"
            ],
            "properties": {
                "Type": {
                    "type": "string",
                    "pattern": "Calibration"
                },
                "Value": {
                    "type": "object",
                    "required": [],
                    "oneOf": [{"type":"string","pattern":"Length"},{"type":"string","pattern":"AcousticLength"}]
                }
            }
        }
    }
}

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

No branches or pull requests

2 participants