Enum Object

You can leverage our ready-to-use Enums Objects, eliminating the need to develop your own specific Enums and API implementations.

Our Enums API provides a centralized, consistent, and maintainable way to expose predefined fixed sets of values. Your applications can use them for dynamically populating dropdown menus, radio buttons, checkboxes, etc.

We support 6 enum types: - EnumBoolean - EnumDateTime - EnumInteger - EnumFloat - EnumString - EnumStringLocalized (for when you need translations support)

Enum Boolean

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://apis.objectsgrid.com/schemas/OGObject.schema.json",
  "title": "EnumBoolean",
  "description": "Objects Grid EnumBoolean Object",
  "type": "object",
  "properties": {
    "id": {
      "description": "The unique identifier for EnumBoolean",
      "type": "string",
      "minLength": 0,
      "maxLength": 50
    },
    "description": {
      "description": "The EnumBoolean description",
      "type": "string",
      "minLength": 0,
      "maxLength": 255
    },
    "values": {
      "description": "EnumBoolean Values",
      "type": ["array", "null"],
      "items": {
        "value": {
          "type": "object",
          "properties": {
            "key": {
              "type": "string",
              "minLength": 1
            },
            "val": {
              "type": "boolean",
              "minLength": 1
            },
            "order": {
              "type": "integer",
              "minLength": 0
            }
          }
        }
      }
    },
    "disabled": {
      "description": "Is this Enum disabled",
      "type": "boolean"
    },
    "tags": {
      "description": "Object Tags",
      "type": ["array", "null"],
      "items": {
        "tag": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1
            },
            "val": {
              "type": "string",
              "minLength": 1
            }
          }
        }
      }
    }
  },
  "required": ["id", "values"]
}

Enum DateTime

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://apis.objectsgrid.com/schemas/OGObject.schema.json",
  "title": "EnumDateTime",
  "description": "Objects Grid EnumDateTime Object",
  "type": "object",
  "properties": {
    "id": {
      "description": "The unique identifier for EnumDateTime",
      "type": "string",
      "minLength": 0,
      "maxLength": 50
    },
    "description": {
      "description": "The EnumDateTime description",
      "type": "string",
      "minLength": 0,
      "maxLength": 255
    },
    "values": {
      "description": "EnumDateTime Values",
      "type": ["array", "null"],
      "items": {
        "value": {
          "type": "object",
          "properties": {
            "key": {
              "type": "string",
              "minLength": 1
            },
            "val": {
              "type": "string",
              "minLength": 1,
              "format": "date-time"
            },
            "order": {
              "type": "integer",
              "minLength": 0
            }
          }
        }
      }
    },
    "disabled": {
      "description": "Is this Enum disabled",
      "type": "boolean"
    },
    "tags": {
      "description": "Object Tags",
      "type": ["array", "null"],
      "items": {
        "tag": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1
            },
            "val": {
              "type": "string",
              "minLength": 1
            }
          }
        }
      }
    }
  },
  "required": ["id", "values"]
}

Enum Float

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://apis.objectsgrid.com/schemas/OGObject.schema.json",
  "title": "EnumFloat",
  "description": "Objects Grid EnumFloat Object",
  "type": "object",
  "properties": {
    "id": {
      "description": "The unique identifier for EnumFloat",
      "type": "string",
      "minLength": 0,
      "maxLength": 50
    },
    "description": {
      "description": "The EnumFloat description",
      "type": "string",
      "minLength": 0,
      "maxLength": 255
    },
    "values": {
      "description": "EnumFloat Values",
      "type": ["array", "null"],
      "items": {
        "value": {
          "type": "object",
          "properties": {
            "key": {
              "type": "string",
              "minLength": 1
            },
            "val": {
              "type": "number",
              "minLength": 1
            },
            "order": {
              "type": "integer",
              "minLength": 0
            }
          }
        }
      }
    },
    "disabled": {
      "description": "Is this Enum disabled",
      "type": "boolean"
    },
    "tags": {
      "description": "Object Tags",
      "type": ["array", "null"],
      "items": {
        "tag": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1
            },
            "val": {
              "type": "string",
              "minLength": 1
            }
          }
        }
      }
    }
  },
  "required": ["id", "values"]
}

Enum Integer

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://apis.objectsgrid.com/schemas/OGObject.schema.json",
  "title": "EnumInteger",
  "description": "Objects Grid EnumInteger Object",
  "type": "object",
  "properties": {
    "id": {
      "description": "The unique identifier for EnumInteger",
      "type": "string",
      "minLength": 0,
      "maxLength": 50
    },
    "description": {
      "description": "The EnumInteger description",
      "type": "string",
      "minLength": 0,
      "maxLength": 255
    },
    "values": {
      "description": "EnumInteger Values",
      "type": ["array", "null"],
      "items": {
        "value": {
          "type": "object",
          "properties": {
            "key": {
              "type": "string",
              "minLength": 1
            },
            "val": {
              "type": "integer",
              "minLength": 1
            },
            "order": {
              "type": "integer",
              "minLength": 0
            }
          }
        }
      }
    },
    "disabled": {
      "description": "Is this Enum disabled",
      "type": "boolean"
    },
    "tags": {
      "description": "Object Tags",
      "type": ["array", "null"],
      "items": {
        "tag": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1
            },
            "val": {
              "type": "string",
              "minLength": 1
            }
          }
        }
      }
    }
  },
  "required": ["id", "values"]
}

Enum String

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://apis.objectsgrid.com/schemas/OGObject.schema.json",
  "title": "EnumString",
  "description": "Objects Grid EnumString Object",
  "type": "object",
  "properties": {
    "id": {
      "description": "The unique identifier for EnumString",
      "type": "string",
      "minLength": 0,
      "maxLength": 50
    },
    "description": {
      "description": "The EnumString description",
      "type": "string",
      "minLength": 0,
      "maxLength": 255
    },
    "values": {
      "description": "EnumString Values",
      "type": ["array", "null"],
      "items": {
        "value": {
          "type": "object",
          "properties": {
            "key": {
              "type": "string",
              "minLength": 1
            },
            "val": {
              "type": "string",
              "minLength": 1
            },
            "order": {
              "type": "integer",
              "minLength": 0
            }
          }
        }
      }
    },
    "disabled": {
      "description": "Is this Enum disabled",
      "type": "boolean"
    },
    "tags": {
      "description": "Object Tags",
      "type": ["array", "null"],
      "items": {
        "tag": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1
            },
            "val": {
              "type": "string",
              "minLength": 1
            }
          }
        }
      }
    }
  },
  "required": ["id", "values"]
}

Enum String Localized

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://apis.objectsgrid.com/schemas/OGObject.schema.json",
  "title": "EnumStringLocalized",
  "description": "Objects Grid EnumStringLocalized Object",
  "type": "object",
  "properties": {
    "id": {
      "description": "The unique identifier for EnumStringLocalized",
      "type": "string",
      "minLength": 0,
      "maxLength": 50
    },
    "description": {
      "description": "The EnumStringLocalized description",
      "type": "string",
      "minLength": 0,
      "maxLength": 255
    },
    "values": {
      "description": "EnumStringLocalized Values",
      "type": ["array", "null"],
      "items": {
        "value": {
          "type": "object",
          "properties": {
            "key": {
              "type": "string",
              "minLength": 1
            },
            "val": {
              "type": "array",
              "items": {
                  "value": {
                  "type": "object",
                  "properties": {
                      "language": {
                      "type": "string",
                      "minLength": 2
                      },
                      "value": {
                      "type": "string",
                      "minLength": 1
                      }
                  }
                }
              }
            },
            "order": {
              "type": "integer",
              "minLength": 0
            }
          }
        }
      }
    },
    "disabled": {
      "description": "Is this Enum disabled",
      "type": "boolean"
    },
    "tags": {
      "description": "Object Tags",
      "type": ["array", "null"],
      "items": {
        "tag": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1
            },
            "val": {
              "type": "string",
              "minLength": 1
            }
          }
        }
      }
    }
  },
  "required": ["id", "values"]
}

Last updated

Was this helpful?