Skip to main content

Base schema

warning

The schema on this page is extended by other, more specific schemas as part of the larger ethdebug/format specification. These other schemas specify the representation of many common kinds of types (e.g. including signed/unsigned integers, arrays, structs, mappings, etc.). In order to adhere to this format fully, compilers that represent known types should do so with the appropriate more-specific schema.

Please see the ethdebug/format/type schema for representing these supported types.

This format defines the ethdebug/format/type/base schema for representing data types from high-level languages. These types may be user-defined or supplied as native data types in a language. This schema affords the representation of complex/parametric types, whose definition composes other types (e.g., arrays and structs, which contain at least one underlying type).

This base schema itself is designed to be extended by other schemas in this format, namely ethdebug/format/type. It serves to specify what is minimally necessary for a type to be a valid representation (i.e., all type representations must adhere to at least this base schema).

Differences from ethdebug/format/type

This base schema defines the structure of a type representation without respect to any known kind of type.

Unconstrained kind field

As described in key concepts Types are organized by kind and Known vs. unknown kinds, ethdebug/format/type imposes constraints on type representations' kind field. This base schema makes no restriction on the value of this field (other than it must be defined and must be a string).

Note to implementers

The primary purpose for the kind field is to discriminate type objects into the appropriate corresponding subschema for a well-understood family of type. Although ethdebug/format/type/base does not impose any constraints on objects based on the kind field, it includes this field so as to encourage the one-to-one pairing between values for this field and corresponding subschemas.

When extending this schema, there should exist exactly one corresponding schema for each kind value.

The class field is always optional

Although ethdebug/format/type does not require the class field to be defined for known types, it does require this field for representations of unknown types.

The ethdebug/format/type/base schema does not ever require this field.

A complex base type contains other base types

As described in key concept Elementary vs. complex types, this format allows the representation of types whose definition includes other types. Both the primary schema and this base schema require type composition to be represented via complex types' contains field.

These two schemas differ by which type schema this field is permitted to compose. Naturally, ethdebug/format/type's contains field composes ethdebug/format/type representations, and ethdebug/format/type/base's contains field composes ethdebug/format/type/base representations.

As a result of this, ethdebug/format/type/base defines its own type wrapper schema.

Base type wrapper schema

Loading ....

Full base schema

Loading ....

Example schema extensions for particular types

These examples show valid schemas that extend ethdebug/format/types/base for particular kinds of types.

Note: These are just examples and may not correspond to the canonical ethdebug/format/type schema.

Loading ....