ssbc / rooms2

Design doc for the next edition of SSB Room servers
https://ssbc.github.io/rooms2
21 stars 4 forks source link

alias resolve error schema #28

Closed cryptix closed 3 years ago

cryptix commented 3 years ago

The web endpoint schema only defines the happy route but not what to do when an error happens (i.e. alias undefined).

Maybe we could require a status string as well which should be successful for known aliases and if it's not there can be an error string as well on the object.

staltz commented 3 years ago

Wouldn't 404 be enough? (Also for JSON alias requests)

cryptix commented 3 years ago

I don't like it (alias not set and page not found are two different things for me) but I guess it works.

Can we define that, tho?

staltz commented 3 years ago

alias not set and page not found are two different things for me

Yes, this makes a lot of sense. I think there are two things to define: (1) what the users sees if they open the alias URL in the browser, (2) the JSON response.

(1) doesn't need to be spec'd strictly (flexibility and variation is fine for humans) but (2) needs to be clearly defined since it's programmatic (flexibility and variation is generally not fine for computers). That's why I suggested 404, primarily thinking about (2).