purescript / registry-dev

Development work related to the PureScript Registry
https://github.com/purescript/registry
95 stars 80 forks source link

Port from codec-argonaut to codec-json #690

Closed f-f closed 2 months ago

f-f commented 2 months ago

Not sure if we are tracking this in this repo, but we talked about doing this in the past, and we need it for https://github.com/purescript/spago/issues/1090

Maybe the most important detail here is that we are propagating the errors from the parsers into the DecodeErrors, so that they get through to the user when parsing things like PackageNames that are too long.

thomashoneyman commented 2 months ago

At a glance this all looks like a straightforward, mechanical change. I guess we don’t have much in the way of error tests; what does the new error output look like when for example a JSON payload contains an invalid package name?

f-f commented 2 months ago

@thomashoneyman good point - I added a test to exercise the new errors!

f-f commented 2 months ago

Ah yeah, autoformatter didn't run for some reason