Skip to content

Improve ergonomics of the describeSchema() function used everywhere#132

Merged
gnidan merged 2 commits intomainfrom
describe-schema
Feb 8, 2025
Merged

Improve ergonomics of the describeSchema() function used everywhere#132
gnidan merged 2 commits intomainfrom
describe-schema

Conversation

@gnidan
Copy link
Member

@gnidan gnidan commented Feb 8, 2025

Recently-added tests do a whole bunch of schema-lookup using describeSchema({ schema: { id }, pointer?: string }), which is overly verbose because describeSchema() is very polymorphic to account for all the ways this function gets used in testing code and on the website.

For now, I'm leaving it as "probably pretty useful" that this function is so polymorphic, but I wanted to simplify the syntax for simply obtaining a schema object for a particular ethdebug/format schema, so this PR just adds a new polymorphism, describeSchema({ schema: string; }) and treats that as equivalent to schema: { id: string }.

... in addition to the existing:
  - { schema: { id: string } }
  - { schema: { yaml: string }
  - { schema: JSONSchema }
@gnidan gnidan merged commit cafea6c into main Feb 8, 2025
3 checks passed
@gnidan gnidan deleted the describe-schema branch February 8, 2025 02:02
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