Procházet zdrojové kódy

Use const instead of enum for 1-element enums

Samuel Jaffe před 8 roky
rodič
revize
654aa12d78
2 změnil soubory, kde provedl 8 přidání a 16 odebrání
  1. 4 4
      schema/spell.json
  2. 4 12
      schema/spellbook.json

+ 4 - 4
schema/spell.json

@@ -8,19 +8,19 @@
       "oneOf":[
         {
           "properties":{
-            "@type": {"enum": ["Line"]},
+            "@type": {"const": "Line"},
             "distance": {"type": "integer"}
           }
         },
         {
           "properties":{
-            "@type": {"enum": ["Emission"]},
+            "@type": {"const": "Emission"},
             "emit": {"enum": ["BURST", "EMANATION", "SPREAD", "NONE"]}
           }
         },
         {
           "properties":{
-            "@type": {"enum": ["Sphere"]},
+            "@type": {"const": "Sphere"},
             "radius": {"type": "integer"},
             "emit": {"enum": ["BURST", "EMANATION", "SPREAD", "NONE"]},
             "aroundYou": {"type": "boolean"}
@@ -28,7 +28,7 @@
         },
         {
           "properties":{
-            "@type": {"enum": ["Cylinder"]},
+            "@type": {"const": "Cylinder"},
             "radius": {"type": "integer"},
             "height": {"type": "integer"}
           }

+ 4 - 12
schema/spellbook.json

@@ -39,9 +39,7 @@
     {
       "properties": {
         "@class": {
-          "enum": [
-            "org.leumasjaffe.charsheet.model.magic.impl.Inspired"
-          ]
+          "const": "org.leumasjaffe.charsheet.model.magic.impl.Inspired"
         },
         "spellInfo": {
           "^[0-9]$": {
@@ -59,9 +57,7 @@
     {
       "properties": {
         "@class": {
-          "enum": [
-            "org.leumasjaffe.charsheet.model.magic.impl.Spontaneous"
-          ]
+          "const": "org.leumasjaffe.charsheet.model.magic.impl.Spontaneous"
         },
         "spellInfo": {
           "^[0-9]$": {
@@ -78,9 +74,7 @@
     {
       "properties": {
         "@class": {
-          "enum": [
-            "org.leumasjaffe.charsheet.model.magic.impl.Researched"
-          ]
+          "const": "org.leumasjaffe.charsheet.model.magic.impl.Researched"
         },
         "spellInfo": {
           "^[0-9]$": {
@@ -98,9 +92,7 @@
     {
       "properties": {
         "@class": {
-          "enum": [
-            "org.leumasjaffe.charsheet.model.magic.impl.Retrieved"
-          ]
+          "const": "org.leumasjaffe.charsheet.model.magic.impl.Retrieved"
         },
         "spellInfo": {
           "^[0-9]$": {