struct
- Explore
- View source
- Playground
Loading ....
- YAML
- JSON
ethdebug/format/type/complex/struct
$schema: "https://json-schema.org/draft/2020-12/schema"
$id: "schema:ethdebug/format/type/complex/struct"
title: ethdebug/format/type/complex/struct
description: |
Schema for representing struct types. A struct type is an ordered list
of member types. Members may have names. A struct with no named members
is a tuple. A struct with no members is legal.
type: object
properties:
label:
$ref: "schema:ethdebug/format/type/base#/$defs/Label"
class:
type: string
const: complex
kind:
type: string
const: struct
contains:
type: array
items:
$ref: "#/$defs/MemberField"
definition:
$ref: "schema:ethdebug/format/type/definition"
required:
- kind
- contains
examples:
- kind: struct
contains:
- name: x
type:
kind: number
- name: y
type:
kind: number
- # a struct with unnamed members (a tuple)
kind: struct
contains:
- type:
kind: number
- type:
kind: bool
- # a struct with no members
kind: struct
contains: []
$defs:
MemberField:
type: object
title: MemberField
description:
A schema representing a member field inside a struct type. This is an
**ethdebug/format/type/wrapper** with additional fields.
allOf:
- $ref: "schema:ethdebug/format/type/wrapper"
- title: Additional fields
description:
An object with optional `name` property for identifying named struct
member fields. **Note** that this language does not specify that a
struct must be consistent in its use of naming for all fields or none
type: object
properties:
name:
type: string
ethdebug/format/type/complex/struct
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "schema:ethdebug/format/type/complex/struct",
"title": "ethdebug/format/type/complex/struct",
"description": "Schema for representing struct types. A struct type is an ordered list\nof member types. Members may have names. A struct with no named members\nis a tuple. A struct with no members is legal.\n",
"type": "object",
"properties": {
"label": {
"$ref": "schema:ethdebug/format/type/base#/$defs/Label"
},
"class": {
"type": "string",
"const": "complex"
},
"kind": {
"type": "string",
"const": "struct"
},
"contains": {
"type": "array",
"items": {
"$ref": "#/$defs/MemberField"
}
},
"definition": {
"$ref": "schema:ethdebug/format/type/definition"
}
},
"required": [
"kind",
"contains"
],
"examples": [
{
"kind": "struct",
"contains": [
{
"name": "x",
"type": {
"kind": "number"
}
},
{
"name": "y",
"type": {
"kind": "number"
}
}
]
},
{
"kind": "struct",
"contains": [
{
"type": {
"kind": "number"
}
},
{
"type": {
"kind": "bool"
}
}
]
},
{
"kind": "struct",
"contains": []
}
],
"$defs": {
"MemberField": {
"type": "object",
"title": "MemberField",
"description": "A schema representing a member field inside a struct type. This is an **ethdebug/format/type/wrapper** with additional fields.",
"allOf": [
{
"$ref": "schema:ethdebug/format/type/wrapper"
},
{
"title": "Additional fields",
"description": "An object with optional `name` property for identifying named struct member fields. **Note** that this language does not specify that a struct must be consistent in its use of naming for all fields or none",
"type": "object",
"properties": {
"name": {
"type": "string"
}
}
}
]
}
}
}
Loading playground...