diff --git a/schemas/materials/compilation.schema.yaml b/schemas/materials/compilation.schema.yaml index 569feb21e..a86efcc84 100644 --- a/schemas/materials/compilation.schema.yaml +++ b/schemas/materials/compilation.schema.yaml @@ -63,7 +63,7 @@ properties: have access to the full representation by some other means) allOf: - - true + - {} sources: type: array diff --git a/schemas/pointer.schema.yaml b/schemas/pointer.schema.yaml index cf0ec1683..b28b22a60 100644 --- a/schemas/pointer.schema.yaml +++ b/schemas/pointer.schema.yaml @@ -11,12 +11,9 @@ description: | type: object -if: - required: [location] -then: - $ref: "schema:ethdebug/format/pointer/region" -else: - $ref: "schema:ethdebug/format/pointer/collection" +oneOf: + - $ref: "schema:ethdebug/format/pointer/region" + - $ref: "schema:ethdebug/format/pointer/collection" examples: - # example: a single particular storage slot diff --git a/schemas/pointer/collection.schema.yaml b/schemas/pointer/collection.schema.yaml index c01705112..a9bde682c 100644 --- a/schemas/pointer/collection.schema.yaml +++ b/schemas/pointer/collection.schema.yaml @@ -5,41 +5,11 @@ title: ethdebug/format/pointer/collection description: | A representation of a collection of pointers to data in the EVM type: object -allOf: - - oneOf: - - required: [group] - - required: [list] - - required: [if] - - required: [define] - - required: [template] - - required: [templates] - - if: - required: [group] - then: - $ref: "schema:ethdebug/format/pointer/collection/group" - - - if: - required: [list] - then: - $ref: "schema:ethdebug/format/pointer/collection/list" - - - if: - required: [if] - then: - $ref: "schema:ethdebug/format/pointer/collection/conditional" - - - if: - required: [define] - then: - $ref: "schema:ethdebug/format/pointer/collection/scope" - - - if: - required: [template] - then: - $ref: "schema:ethdebug/format/pointer/collection/reference" - - - if: - required: [templates] - then: - $ref: "schema:ethdebug/format/pointer/collection/templates" +oneOf: + - $ref: "schema:ethdebug/format/pointer/collection/group" + - $ref: "schema:ethdebug/format/pointer/collection/list" + - $ref: "schema:ethdebug/format/pointer/collection/conditional" + - $ref: "schema:ethdebug/format/pointer/collection/scope" + - $ref: "schema:ethdebug/format/pointer/collection/reference" + - $ref: "schema:ethdebug/format/pointer/collection/templates" diff --git a/schemas/pointer/region.schema.yaml b/schemas/pointer/region.schema.yaml index 0ab06a053..1a8b6842e 100644 --- a/schemas/pointer/region.schema.yaml +++ b/schemas/pointer/region.schema.yaml @@ -5,61 +5,19 @@ title: ethdebug/format/pointer/region description: | A representation of a region of data in the EVM type: object + properties: location: $ref: "#/$defs/Location" -allOf: - - if: - properties: - location: - const: stack - - then: - $ref: "schema:ethdebug/format/pointer/region/stack" - - - if: - properties: - location: - const: memory - - then: - $ref: "schema:ethdebug/format/pointer/region/memory" - - - if: - properties: - location: - const: storage - then: - $ref: "schema:ethdebug/format/pointer/region/storage" - - - if: - properties: - location: - const: calldata - then: - $ref: "schema:ethdebug/format/pointer/region/calldata" - - - if: - properties: - location: - const: returndata - then: - $ref: "schema:ethdebug/format/pointer/region/returndata" - - - if: - properties: - location: - const: transient - then: - $ref: "schema:ethdebug/format/pointer/region/transient" - - - if: - properties: - location: - const: code - then: - $ref: "schema:ethdebug/format/pointer/region/code" +oneOf: + - $ref: "schema:ethdebug/format/pointer/region/stack" + - $ref: "schema:ethdebug/format/pointer/region/memory" + - $ref: "schema:ethdebug/format/pointer/region/storage" + - $ref: "schema:ethdebug/format/pointer/region/calldata" + - $ref: "schema:ethdebug/format/pointer/region/returndata" + - $ref: "schema:ethdebug/format/pointer/region/transient" + - $ref: "schema:ethdebug/format/pointer/region/code" $defs: Location: diff --git a/schemas/pointer/region/base.schema.yaml b/schemas/pointer/region/base.schema.yaml index 1782352e8..6e89b93d0 100644 --- a/schemas/pointer/region/base.schema.yaml +++ b/schemas/pointer/region/base.schema.yaml @@ -11,11 +11,23 @@ properties: $ref: "schema:ethdebug/format/pointer/identifier" location: - type: string + $ref: "#/$defs/Location" required: - location +$defs: + Location: + type: string + enum: + - stack + - memory + - storage + - calldata + - returndata + - transient + - code + examples: - name: "array-item" location: memory