Skip to content

fix(schemas/yazi.json): update $defs/offset#45

Closed
AminurAlam wants to merge 1 commit intoyazi-rs:mainfrom
AminurAlam:main
Closed

fix(schemas/yazi.json): update $defs/offset#45
AminurAlam wants to merge 1 commit intoyazi-rs:mainfrom
AminurAlam:main

Conversation

@AminurAlam
Copy link
Copy Markdown
Contributor

offset (x, y, width, height) only allows the following ranges:

  • -32768 ≤ x ≤ 32767
  • -32768 ≤ y ≤ 32767
  • 0 ≤ width ≤ 32767
  • 3 ≤ 32767 ≤ 32767

maybe consider adding i16 type to simplify these

@uncenter
Copy link
Copy Markdown
Member

uncenter commented Jul 7, 2025

maybe consider adding i16 type to simplify these

I did that and this exact change in #14 last year, but I used prefixItems instead of items as the key. I can't recall why I made this distinction, but because of it Taplo - the primary TOML LSP/linter - became a blocker as it didn't (and still doesn't) support the draft of JSON Schema that includes prefixItems. Can you look into the differences in validation logic between using items vs prefixItems?

EDIT: A place to start looking: https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-00#rfc.section.10.3.1.1

@AminurAlam
Copy link
Copy Markdown
Contributor Author

AminurAlam commented Jul 7, 2025

this page has some examples of how prefixItems works. items should be used instead

@uncenter
Copy link
Copy Markdown
Member

uncenter commented Jul 9, 2025

Do you want to make a PR into the branch for #14 (https://github.com/yazi-rs/schemas/tree/fix/use-i16-for-offset-coords) changing prefixItems to items?

Would love to give you credit for your contribution along with my existing i16 stuff!

@AminurAlam
Copy link
Copy Markdown
Contributor Author

sure, closing this in favour of #46

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.

2 participants