[
https://issues.apache.org/jira/browse/AVRO-1941?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16857667#comment-16857667
]
Olivier Smeesters commented on AVRO-1941:
-----------------------------------------
I firmly second this request. In my testing of Avro, I had to re-read the
schema from the Json file for the sole purpose of passing the ValidSchema to
DataFileWriter. Given that this schema is well known in the schema compiler, it
seems logical that it would be part of the generated code...
> avrogencpp: unlike java, c++ generated code doesn't include own schema
> ----------------------------------------------------------------------
>
> Key: AVRO-1941
> URL: https://issues.apache.org/jira/browse/AVRO-1941
> Project: Apache Avro
> Issue Type: Improvement
> Components: c++
> Affects Versions: 1.8.1
> Reporter: Alexander Moriarty
> Priority: Major
>
> All the classes generated for java include a copy of their schema. The C++
> classes do not.
> Every generated java class has getClassSchema().
> Something similar for C++ would be convenient.
> During generation, the schema is available with n->printJson(..) which can
> then be passed through boost::algorithm::erase_all() to remove whitespace and
> new lines, and then boost::algorithm::replace_all() to add escape characters
> back.
> and then given to avro::compileJsonSchemaFromString
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)