Bridgeconn / usfm-grammar

An elegant USFM parser.
https://usfmgrammar.vachanengine.org/
MIT License
36 stars 14 forks source link

Modify USJ spec #226

Closed kavitharaju closed 10 months ago

kavitharaju commented 10 months ago

Closes #225 Implementing the changes suggested in USJ schema by the USFM/X Committee

  1. Change oneOf condition to anyOf
  2. Instead of the field {type: "val1:val2"} keep two fields {type:"val1", marker: "val2"}

Changes in this PR

joelthe1 commented 10 months ago

The changes look good. Are you planing to add the change to Book Code regex separately (basically to mirror what's followed in USX)?

kavitharaju commented 10 months ago

Honestly I had forgotten that change. But now I remember what we had decided was

  1. To keep checking strictly with enum in usfm-grammar at our grammar level(no change needed for that)
  2. In the USJ schema keep as any 3 letter string using regex. I had sent a pr to tcdocs repo with the changes already in this pr and it is merged. So how about I make the json schema change as next task?

About point 2, is that okay? Or should we do it just like in usx by listing all codes as enum and then opening it up for any 3 letter string? I see the following reasons to not to

joelthe1 commented 10 months ago

Agreed. I will merge this in and we can work on the 'regex for book code' change as a separate PR. Also, let's leave out the special schema handling for now- enforcing any three letter regex is probably good enough (probably using what USX specifies already).