forked from apache/avro
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
avrogencpp: expose ValidSchema in generated code
The C++ avro library has readers and writers that depend on having an in-memory ValidSchema. The avrogencpp tool can take a JSON schema and generate code to interact with a given datum, but doesn't expose the ValidSchema, despite using it during codegen. This adds a valid_schema() method to the avrogencpp binary that builds the schema and exposes it via generated code. This is inspired largely by the kspp[1] library. Note, the escape() method used is copied from [2]. [1] https://github.com/bitbouncer/kspp/blob/8539f359e32bd3dd1360ac4616eab88e79aab607/tools/kspp_avrogencpp/kspp_avrogencpp.cpp [2] https://github.com/redpanda-data/avro/blob/1410e79f9df61669c2d52f6d0643e6c35156e615/lang/c%2B%2B/impl/NodeImpl.cc#L29-L69
- Loading branch information
Showing
2 changed files
with
89 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters