Having record builder using JSON schema
See original GitHub issueI am trying to build a generic record from JSON schema dynamically using SchemaBuilder and RecordBuilder. Below is the code snippet
` val recordBuilder = SchemaBuilder.record(“testJson”)
recordBuilder.field("eventType").type(SchemaType.STRING)
val si: SchemaInfo = recordBuilder.build(SchemaType.JSON)
val pulsarSchema = org.apache.pulsar.client.api.Schema.generic(si)
val builder: GenericRecordBuilder = pulsarSchema.newRecordBuilder()
builder.set("eventType", "test")
val pulsarGenericRecord: GenericRecord = builder.build()`
And got this exeception (Pulsar version 2.6.1)
Json Schema doesn't support record builder yet java.lang.UnsupportedOperationException: Json Schema doesn't support record builder yet at org.apache.pulsar.client.impl.schema.generic.GenericJsonSchema.newRecordBuilder(GenericJsonSchema.java:78)
Is there other way to build this generic record from JSON schema other than using static POJO ?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6 (5 by maintainers)
Top Results From Across the Web
SchemaBuilder (Apache Avro Java 1.7.6 API)
A fluent interface for building Schema instances. The flow of the API is designed to mimic the Avro Schema Specification. For example, the...
Read more >Using JSON Schema to Save Lives - YouTube
Find out how to save lives by replacing a life-critical legacy healthcare system with a data-first approach.Come hear how we leverage a JSON...
Read more >JSON Schema Serializer and Deserializer
Plug the KafkaJsonSchemaSerializer into KafkaProducer to send messages of JSON Schema type to Kafka. Assuming you have a Java class that is decorated...
Read more >Create forms using the JSON Schema Form component
This guide walks you through building an app and form using JSON Schema Form. You can fill in the form to create a...
Read more >JSON Schema Examples Tutorial - MongoDB
The schema that we have used in the above section is a basic outline. Lets build on it by adding an id field...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@codelipenghui thanks for confirmation. Is there other way I can build record dynamically using json schema ?
The issue had no activity for 30 days, mark with Stale label.