This repository was archived by the owner on Aug 8, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 138
This repository was archived by the owner on Aug 8, 2018. It is now read-only.
Default value of properties #212
Copy link
Copy link
Open
Description
I'm using the following model to validate the body of one of my endpoints
{
"type": "object",
"required": ["parsingRules"],
"additionalProperties": false,
"properties": {
"parsingRules": {
"type": "object",
"required": ["rules"],
"additionalProperties": false,
"properties": {
"delimiter": {
"type": "object",
"additionalProperties": false,
"default": {},
"properties": {
"flags": {
"type": "string",
"default": "g",
"pattern": "^(?:([gimuy])(?!.*\\1))*$"
},
"pattern": {
"type": "string",
"default": "([\\S\\s]+)",
"format": "regex",
"pattern": "^.{1,}?$"
}
}
},
"rules": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": ["name", "pattern"],
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"pattern": "^.{1,}?$"
},
"flags": {
"type": "string",
"default": "",
"pattern": "^(?:([gimuy])(?!.*\\1))*$"
},
"pattern": {
"type": "string",
"format": "regex",
"pattern": "^.{1,}?$"
},
"type": {
"type": "string",
"default": "System.String",
"enum": [
"System.Boolean",
"System.Byte",
"System.Char",
"System.DBNull",
"System.DateTime",
"System.Double",
"System.Int16",
"System.Int32",
"System.Int64",
"System.SByte",
"System.Single",
"System.String",
"System.Text",
"System.Text.StringBuilder",
"System.UInt16",
"System.Uint32",
"System.Uint64",
"Sytem.Decimal"
]
}
}
}
}
}
}
}
}And the validator is ignoring the default properties. Is this normal?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels