Open lukasschwab opened 2 years ago
I ran into this same problem when trying to follow the readme instructions, and looks like https://github.com/lukasschwab/cambria-project/commit/77b602e22ec0d46c12d2861cd9c27ae47cb281ca indeed makes this error disappear.
Description
This demo mentioned in README.md seems broken:
In practice:
Cause
github-arthropod.lens.yml defines a valid
remove
op––no type required:https://github.com/inkandswitch/cambria-project/blob/da8961440cac7eba1c3113488f5bcbc26046620f/demo/github-arthropod.lens.yml#L41-L42
And reverse.ts just swaps in the
add
op:https://github.com/inkandswitch/cambria-project/blob/da8961440cac7eba1c3113488f5bcbc26046620f/src/reverse.ts#L30-L34
But an
add
op must specify a type! It's the type missing, not the name:https://github.com/inkandswitch/cambria-project/blob/da8961440cac7eba1c3113488f5bcbc26046620f/src/json-schema.ts#L35-L37
Solutions
remove
ops.remove
op without a type. I sketched that out here, and confirmed the demo works as expected and unit tests pass: https://github.com/lukasschwab/cambria-project/commit/77b602e22ec0d46c12d2861cd9c27ae47cb281caLet me know if you'd like me to open a PR.
Cool stuff––enjoyed the HYTRADBOI talk!