enum
- Explore
- View source
- Playground
Loading ....
- YAML
- JSON
ethdebug/format/type/elementary/enum
$schema: "https://json-schema.org/draft/2020-12/schema"
$id: "schema:ethdebug/format/type/elementary/enum"
title: ethdebug/format/type/elementary/enum
description: |
Schema describing the representation of an enumerated type.
Standard interpretation: read the bytes of the value as a big-endian
unsigned integer `i`. The value is `values[i]`. If `i` is not less than
`values.length`, the value is invalid.
type: object
properties:
label:
$ref: "schema:ethdebug/format/type/base#/$defs/Label"
class:
const: elementary
kind:
const: enum
values:
description: The names of the enum values, where `values[i]` is value `i`.
type: array
items:
type: string
minItems: 1
uniqueItems: true
definition:
$ref: "schema:ethdebug/format/type/definition"
required:
- kind
- values
examples:
- kind: enum
values:
- A
- B
- C
- kind: enum
label: Direction
values:
- North
- South
definition:
name: Direction
ethdebug/format/type/elementary/enum
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "schema:ethdebug/format/type/elementary/enum",
"title": "ethdebug/format/type/elementary/enum",
"description": "Schema describing the representation of an enumerated type.\n\nStandard interpretation: read the bytes of the value as a big-endian\nunsigned integer `i`. The value is `values[i]`. If `i` is not less than\n`values.length`, the value is invalid.\n",
"type": "object",
"properties": {
"label": {
"$ref": "schema:ethdebug/format/type/base#/$defs/Label"
},
"class": {
"const": "elementary"
},
"kind": {
"const": "enum"
},
"values": {
"description": "The names of the enum values, where `values[i]` is value `i`.",
"type": "array",
"items": {
"type": "string"
},
"minItems": 1,
"uniqueItems": true
},
"definition": {
"$ref": "schema:ethdebug/format/type/definition"
}
},
"required": [
"kind",
"values"
],
"examples": [
{
"kind": "enum",
"values": [
"A",
"B",
"C"
]
},
{
"kind": "enum",
"label": "Direction",
"values": [
"North",
"South"
],
"definition": {
"name": "Direction"
}
}
]
}
Loading playground...