Skip to content

Switch to if/then style for context properties - #150

Merged
gnidan merged 3 commits into
mainfrom
iffy-contexts
Apr 29, 2025
Merged

gnidan merged 3 commits into
mainfrom
iffy-contexts

Conversation

@gnidan

@gnidan gnidan commented Apr 23, 2025

Copy link
Copy Markdown
Member

... to provide better error-reporting when using general-purpose JSON Schema validators.

@github-actions

github-actions Bot commented Apr 23, 2025 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.6.1
Preview removed because the pull request was closed.
2025-04-29 17:54 UTC

gnidan added 2 commits April 23, 2025 20:15
... to provide better error-reporting when using general-purpose JSON Schema
validators.
@gnidan gnidan changed the title Switch to if/then/else style for context properties Switch to if/then style for context properties Apr 24, 2025
@gnidan

gnidan commented Apr 24, 2025

Copy link
Copy Markdown
Member Author
Screenshot 2025-04-23 at 20 16 45

Added some logic to do custom rendering for this kind of schema. This is modeled after how I did the pointer collection schema, although this might be overkill.

Will try to simplify a bit before merging.

@gnidan

gnidan commented Apr 29, 2025

Copy link
Copy Markdown
Member Author

Regarding the concern raised in my previous comment here, I considered an alternative approach: just define context properties the normal object way, i.e.,

type: object
properties:
  code:
    $ref: "schema:ethdebug/format/materials/source-range"
  # ... etc.

This is functionally the same thing as the current state of the schema, but it would require removing the outer wrapping from each of the context types, which are defined in separate schema files. I am apprehensive about this, because I would like each kind of context fact to be defined with its own key identifier in the schema itself.

I will leave this as is for now, although I might consider this more in the future (if this approach isn't actually worth the overhead complexity)

@gnidan
gnidan marked this pull request as ready for review April 29, 2025 17:52
@gnidan
gnidan merged commit 193c181 into main Apr 29, 2025
@gnidan
gnidan deleted the iffy-contexts branch April 29, 2025 17:52
gnidan added a commit that referenced this pull request Sep 17, 2026
The empty-context history was attributed to the wrong PR: #145 dropped
`minProperties: 1` and the `required` entry, but the context schema's
`anyOf` still rejected an explicit `{}` until #150 replaced the union
with `if`/`then` clauses. #131 likewise never declared the compilation
`id` required in prose; it only dropped the "optional" wording.

Every `Schemas:` list now names each schema file the change touched,
verified against the diffs. The #284 entry is split, since the segment
offset carry and the `$this` circularity rule are separate changes with
separate consequences. The encoding label rule is marked as a normative
tightening no validator catches, and its canonical label is described as
preferred rather than required, matching the schema. The id uniqueness
requirement is presented as the new part of #172, and `frame`'s values
as examples rather than an enumeration. The preamble explains why this
file is keyed by the `@ethdebug/format` version, and the history ends at
`0.1.0-0`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant