Comments (6)
It's been released in https://github.com/ImFlog/schema-registry-plugin/releases/tag/v1.13.0
Thank you again for your contribution 🙇
from schema-registry-plugin.
As a suggested solution, the best way that I can see to support this would be to add an optional prettyOutput: boolean
flag to the global configuration so as to not pollute the subject
and subjectPattern
signatures. This would output formatted files for the json
and avro
schema formats and be a no-op for protobuf
(unless there is an obvious way to support that use case that I'm not seeing - I'm not very familiar with protobuf
).
from schema-registry-plugin.
Hello @filpano,
That's a good point. I think we should definitely support this.
The flag seems to be a good way to do this, I think I saw somewhere that on the confluentinc schema-registry library we could use specify a way to pretty print instead of doing the toString (formattedString for instance ? An issue about formatting was opened in the past => confluentinc/schema-registry#876 (comment)).
Might be worth to check their API before bringing a formatting library or doing it ourselves in the plugin.
We can check later for protobuf (not using it either).
I'll be glad to assist you on this PR, feel free to start tinkering and push something even if not finished (with the allow edits from maintainer) so I can step up to help when you need ;)
from schema-registry-plugin.
Thanks for the quick reply. I had a much deeper look at that whole thread than I would've liked to :) but it doesn't seem like that'll work for this use case:
- (Undocumented) support for the
format
query param was added only for the/schemas/ids/{id}
endpoint. From the discussion it seems that this is the intended operation for "retrieve a raw schema". - The
io.confluent.kafka.schemaregistry.rest.resources.SubjectVersionsResource#getSchemaOnly
resource which allows retrieving the raw schema for a subject-version pair via/subjects/{subject}/versions/{version}/schema
does not offer this support at this time. I wouldn't mind opening a PR for this in https://github.com/confluentinc/schema-registry, but... - ...going off the the linked discussion, it doesn't seem like the Confluent team wishes to support a formatting option on
/subjects/{subject}/versions/{version}/schema
as the schema parsing is pluggable to provide generic support for Avro/JsonSR/Protobuf. @rayokota may be able to provide some insight on whether this is actually the case or if I've misinterpreted. - Lastly, the
schema-registry-plugin
(this project) uses the/subjects/{subject}/versions/{version}
endpoint viaschemaRegistryClient#getSchemaMetadata
, which is also probably the correct one for the use cases it applies to. I don't think it makes sense to both open a PR to add pretty-print formatting in SR and another one here to use the/schemas/ids/{id}
endpoint instead (which would be a significant rework and not at all justified for this issue).
So I think either the schema registry needs support for format
/pretty
in /subjects/{subject}/versions/{version}/schema
(unlikely from what I've read so far), or we'd have to parse and format it ourselves here, as initially thought - though I'd prefer the former. If the latter is OK for you, I can get started on a PR.
What do you think?
from schema-registry-plugin.
I think we should add support on our side for now while opening an issue on the confluent repository (and linking to this issue).
We have less inertia than the confluent project and thus we can have something pretty quickly. But as you said it makes more sense to put this on the schema-registry directly.
from schema-registry-plugin.
I have a small issue with the plugin publishing (an error on Gradle side it seems) but I didn't forget to release this.
from schema-registry-plugin.
Related Issues (20)
- Support for attaching @Nullable annotation on nullable fields HOT 2
- SchemaParseException during testSchemasTask HOT 2
- Dependency "com.github.ImFlog.avro:avro:1.11.2" not resolvable HOT 1
- Fat jar all the thing ? HOT 1
- Support Gradle 8.X.X
- DownloadTask should download all referenced schemas HOT 7
- NoSuchMethodError with openapi generator since 1.12.0 HOT 12
- Support for IDL language(`.avdl`) HOT 1
- Update forked avro plugin HOT 1
- Issues registering schema via gradle 8.2.1 HOT 3
- Recursively download schema references
- Configure registry client with a map HOT 2
- Does the "name" argument to "addReference" and "addLocalReference" do anything when using Avro schemas? HOT 2
- Add new Kafka versions to the test matrix in Github Action
- Support for AVDL HOT 1
- Support custom root dir for Protobuf local references
- downloadSchemasTask is always executed even when inputs don't change HOT 2
- Unable to reuse subjects HOT 1
- Test Schema Compatibility in JSON Format using kotlin objects HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from schema-registry-plugin.