Use const instead of single-valued enum (#291)

This commit is contained in:
Graham Esau 2024-05-13 21:30:51 +01:00 committed by GitHub
parent 8c2c32bce0
commit 18300c67bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 61 additions and 131 deletions

View file

@ -11,10 +11,8 @@
},
{
"type": "string",
"deprecated": true,
"enum": [
"DeprecatedUnitVariant"
]
"const": "DeprecatedUnitVariant",
"deprecated": true
},
{
"type": "object",

View file

@ -13,9 +13,7 @@
{
"description": "This comment is included in the generated schema :)",
"type": "string",
"enum": [
"DocumentedUnit"
]
"const": "DocumentedUnit"
},
{
"title": "Complex variant",

View file

@ -7,9 +7,7 @@
"properties": {
"typeProperty": {
"type": "string",
"enum": [
"UnitOne"
]
"const": "UnitOne"
}
},
"additionalProperties": false,
@ -22,9 +20,7 @@
"properties": {
"typeProperty": {
"type": "string",
"enum": [
"StringMap"
]
"const": "StringMap"
}
},
"additionalProperties": {
@ -39,9 +35,7 @@
"properties": {
"typeProperty": {
"type": "string",
"enum": [
"UnitStructNewType"
]
"const": "UnitStructNewType"
}
},
"additionalProperties": false,
@ -61,9 +55,7 @@
},
"typeProperty": {
"type": "string",
"enum": [
"StructNewType"
]
"const": "StructNewType"
}
},
"required": [
@ -84,9 +76,7 @@
},
"typeProperty": {
"type": "string",
"enum": [
"Struct"
]
"const": "Struct"
}
},
"additionalProperties": false,
@ -101,9 +91,7 @@
"properties": {
"typeProperty": {
"type": "string",
"enum": [
"UnitTwo"
]
"const": "UnitTwo"
}
},
"additionalProperties": false,
@ -117,9 +105,7 @@
"properties": {
"typeProperty": {
"type": "string",
"enum": [
"WithInt"
]
"const": "WithInt"
}
},
"required": [

View file

@ -7,9 +7,7 @@
"properties": {
"typeProperty": {
"type": "string",
"enum": [
"UnitOne"
]
"const": "UnitOne"
}
},
"required": [
@ -21,9 +19,7 @@
"properties": {
"typeProperty": {
"type": "string",
"enum": [
"StringMap"
]
"const": "StringMap"
}
},
"additionalProperties": {
@ -38,9 +34,7 @@
"properties": {
"typeProperty": {
"type": "string",
"enum": [
"UnitStructNewType"
]
"const": "UnitStructNewType"
}
},
"required": [
@ -59,9 +53,7 @@
},
"typeProperty": {
"type": "string",
"enum": [
"StructNewType"
]
"const": "StructNewType"
}
},
"required": [
@ -82,9 +74,7 @@
},
"typeProperty": {
"type": "string",
"enum": [
"Struct"
]
"const": "Struct"
}
},
"required": [
@ -98,9 +88,7 @@
"properties": {
"typeProperty": {
"type": "string",
"enum": [
"UnitTwo"
]
"const": "UnitTwo"
}
},
"required": [
@ -113,9 +101,7 @@
"properties": {
"typeProperty": {
"type": "string",
"enum": [
"WithInt"
]
"const": "WithInt"
}
},
"required": [

View file

@ -7,9 +7,7 @@
"properties": {
"typeProperty": {
"type": "string",
"enum": [
"A"
]
"const": "A"
}
},
"additionalProperties": false,
@ -22,9 +20,7 @@
"properties": {
"typeProperty": {
"type": "string",
"enum": [
"B"
]
"const": "B"
}
},
"additionalProperties": false,
@ -37,9 +33,7 @@
"properties": {
"typeProperty": {
"type": "string",
"enum": [
"C"
]
"const": "C"
}
},
"additionalProperties": false,

View file

@ -7,9 +7,7 @@
"properties": {
"typeProperty": {
"type": "string",
"enum": [
"A"
]
"const": "A"
}
},
"required": [
@ -21,9 +19,7 @@
"properties": {
"typeProperty": {
"type": "string",
"enum": [
"B"
]
"const": "B"
}
},
"required": [
@ -35,9 +31,7 @@
"properties": {
"typeProperty": {
"type": "string",
"enum": [
"C"
]
"const": "C"
}
},
"required": [

View file

@ -6,23 +6,17 @@
"title": "A deer",
"description": "A female deer",
"type": "string",
"enum": [
"Do"
]
"const": "Do"
},
{
"description": "A drop of golden sun",
"type": "string",
"enum": [
"Re"
]
"const": "Re"
},
{
"description": "A name I call myself",
"type": "string",
"enum": [
"Mi"
]
"const": "Mi"
}
]
}

View file

@ -45,9 +45,7 @@
{
"description": "This is a documented unit variant",
"type": "string",
"enum": [
"DocumentedUnit"
]
"const": "DocumentedUnit"
},
{
"type": "object",

View file

@ -45,9 +45,7 @@
{
"description": "This is a documented unit variant",
"type": "string",
"enum": [
"DocumentedUnit"
]
"const": "DocumentedUnit"
},
{
"type": "object",

View file

@ -10,9 +10,7 @@
},
"typeProperty": {
"type": "string",
"enum": [
"Struct"
]
"const": "Struct"
}
},
"required": [
@ -25,9 +23,7 @@
"properties": {
"typeProperty": {
"type": "string",
"enum": [
"NewType"
]
"const": "NewType"
}
},
"required": [
@ -39,9 +35,7 @@
"properties": {
"typeProperty": {
"type": "string",
"enum": [
"Unit"
]
"const": "Unit"
}
},
"required": [