Use typespec for generating API docs and json schema
Max Lapshin
max.lapshin@REDACTED
Sun Sep 20 19:49:15 CEST 2020
> https://github.com/extend/sheriff
are there any reasons, why don't you use it in cowboy for validating options?
On Sun, Sep 20, 2020 at 8:44 PM Loïc Hoguin <essen@REDACTED> wrote:
>
> Yes: https://github.com/extend/sheriff
>
> It's outdated but should be a good start.
>
> On 20/09/2020 19:35, Max Lapshin wrote:
> > I want to use typespecs for generating swagger-like API documentation
> > and creating json schema for frontend validations.
> >
> > Or maybe I want not a typespec, but using some other interface
> > definition language like json schema / protobuf / something else and
> > generate typespec from it.
> >
> > Also I want to add reading json input and validating accordingly to
> > this typespec.
> >
> > So maybe something like this:
> >
> >
> > -spec list_streams() -> [live_stream()]
> > list_streams() -> ....
> >
> > -spec create_stream(live_stream()) -> boolean()
> > create_stream(RawBody) ->
> > #live_stream{} = parse(live_stream(), RawBody),
> > ....
> > true.
> >
> >
> > Has anybody implemented something like this?
> >
>
> --
> Loïc Hoguin
> https://ninenines.eu
More information about the erlang-questions
mailing list