diff --git a/schemas/type/complex/mapping.schema.yaml b/schemas/type/complex/mapping.schema.yaml index 3b10098d..e070bc31 100644 --- a/schemas/type/complex/mapping.schema.yaml +++ b/schemas/type/complex/mapping.schema.yaml @@ -15,6 +15,7 @@ properties: const: mapping contains: type: object + title: Mapping key/value types properties: key: $ref: "schema:ethdebug/format/type/wrapper" diff --git a/schemas/type/complex/struct.schema.yaml b/schemas/type/complex/struct.schema.yaml index 01a86369..98b7c5fb 100644 --- a/schemas/type/complex/struct.schema.yaml +++ b/schemas/type/complex/struct.schema.yaml @@ -45,12 +45,12 @@ $defs: **ethdebug/format/type/wrapper** with additional fields. allOf: - $ref: "schema:ethdebug/format/type/wrapper" - - type: object - title: Additional fields + - 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 diff --git a/schemas/type/complex/tuple.schema.yaml b/schemas/type/complex/tuple.schema.yaml index 742ac656..4a282f80 100644 --- a/schemas/type/complex/tuple.schema.yaml +++ b/schemas/type/complex/tuple.schema.yaml @@ -16,19 +16,7 @@ properties: contains: type: array items: - title: '{ name?, type }' - allOf: - - $ref: "schema:ethdebug/format/type/wrapper" - - properties: - name: - type: string - description: - For tuple types where positional element types are identified - by name, this field **should** include this information. - - This schema makes no restriction on whether all-or-no elements - have names, and so this field may be sparse across elements of - the same tuple. + $ref: "#/$defs/Element" required: - kind @@ -49,3 +37,25 @@ examples: type: kind: uint bits: 128 + +$defs: + Element: + type: object + title: Element + description: + An optionally named element type within a tuple. This is an + **ethdebug/format/type/wrapper** with additional fields. + allOf: + - $ref: "schema:ethdebug/format/type/wrapper" + - title: Additional fields + type: object + properties: + name: + type: string + description: + For tuple types where positional element types are identified + by name, this field **should** include this information. + + This schema makes no restriction on whether all-or-no elements + have names, and so this field may be sparse across elements of + the same tuple. diff --git a/schemas/type/elementary/contract.schema.yaml b/schemas/type/elementary/contract.schema.yaml index ef9e3e45..16f41353 100644 --- a/schemas/type/elementary/contract.schema.yaml +++ b/schemas/type/elementary/contract.schema.yaml @@ -20,13 +20,15 @@ properties: $ref: "schema:ethdebug/format/type/definition" oneOf: - - properties: + - title: Normal contract type + properties: library: const: false interface: const: false - - properties: + - title: Contract library type + properties: library: const: true description: @@ -34,7 +36,8 @@ oneOf: required: - library - - properties: + - title: Contract interface type + properties: interface: const: true description: diff --git a/web/spec/type/concepts.mdx b/web/spec/type/concepts.mdx index 2aedf159..4edcbf7f 100644 --- a/web/spec/type/concepts.mdx +++ b/web/spec/type/concepts.mdx @@ -112,13 +112,13 @@ possibly includes other fields alongside `"type"`. { "kind": "struct", "contains": [{ - "member": "balance", + "name": "balance", "type": { "kind": "uint", "bits": 256 } }, { - "member": "scoreSheet", + "name": "scoreSheet", "type": { "id": "" } @@ -127,7 +127,7 @@ possibly includes other fields alongside `"type"`. ``` In this example, please note how this struct type represents member names - with a `"member"` field alongside the `"type"` field, and note how the + with a `"name"` field alongside the `"type"` field, and note how the value of `"type"` can be either a complete representation or a reference object in the form of `{ id }`.