Yes, in fact, the canonical representation of compiled Cap'n Proto schemas
is defined in Cap'n Proto!

Check out:
https://github.com/sandstorm-io/capnproto/blob/master/c++/src/capnp/schema.capnp

A Cap'n Proto schema file compiles into a set of `Node` structures. They
can be passed into capnp::SchemaLoader at runtime to generate capnp::Schema
objects, which in turn can be used with the "dynamic" API in
`capnp/dynamic.h` to manipulate actual messages.

For what it's worth, Protocol Buffers has a similar design:
google/protobuf/descriptor.proto defines protobuf types representing
compiled protobuf schemas.

-Kenton

On Fri, Jan 20, 2017 at 5:53 PM, Ian Jeffries <[email protected]> wrote:

> Currently I'm working on a data store that uses JSON and JSON Schema. All
> the schemas currently uploaded to the store are tracked, and users can
> upload JSON instances of each schema (if the instance is valid). Because
> JSON Schemas themselves are written in JSON, they can be uploaded and
> validated just like any other piece of data.
>
> Unfortunately JSON isn't a perfect serialization format and so I'm
> exploring other options. If Cap'n Proto schemas could be
> serialized/deserialized from Cap'n Proto messages it might be an option for
> me, is this possible?
>
> Also, if it is possible, has someone written a Cap'n Proto schema that
> describes all other Cap'n Proto schemas?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Cap'n Proto" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> Visit this group at https://groups.google.com/group/capnproto.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/capnproto.

Reply via email to