Use typespec for generating API docs and json schema

Max Lapshin <[email protected]>
Newsgroups gmane.comp.lang.erlang.general
Message-ID <CAMxVRxBib9EHsNCAL+K8sqRnvcdg99jvqdGdpD243z-nTydbHw@mail.gmail.com>
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?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.