Skip to content

Switch to if/then style for context properties#150

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

Switch to if/then style for context properties#150
gnidan merged 3 commits intomainfrom
iffy-contexts

Conversation

@gnidan
Copy link
Member

@gnidan gnidan commented Apr 23, 2025

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

@github-actions
Copy link
Contributor

github-actions bot commented Apr 23, 2025

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
Copy link
Member Author

gnidan commented Apr 24, 2025

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
Copy link
Member Author

gnidan commented Apr 29, 2025

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
3 checks passed
@gnidan gnidan deleted the iffy-contexts branch April 29, 2025 17:52
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