opwvhk / avro-schema-support

Extend IntelliJ, PyCharm and other JetBrains IDEs to more easily work with Avro schemata and protocols in both IDL and JSON format.
https://plugins.jetbrains.com/plugin/15728-avro-schema-support
MIT License
19 stars 2 forks source link

Question - how to I use it #18

Closed harkinj closed 2 years ago

harkinj commented 2 years ago

Hi, Excuse a simple question.I've installed the plug in and restarted intellij. I have a .avsc file as part of my project. I double click it in Intellij and it is viewed as one big line of text (as it wss before plug in installation). How do I enable/use the plug in to make it easier to work with .avsc file?. Thanks for all info. John

opwvhk commented 2 years ago

This plugin was built for IDL (.avdl) files, but also provides some support for schema (.avsc) & protocol (.avpr) files. Technically, this plugin defines languages for them as an extension to JSON with the corresponding JSON schema.

In practice, this means:

  1. .avsc and .avpr files are recognized as Avro files, but displayed as JSON
  2. IntelliJ uses the provided JSON schema for code completion and some warnings

The easiest way to get started, especially if you're looking at a non-pretty printed JSON (as you are, by your description), is to open a file and (re)format it.

I also encourage you to check out the Refactor menu, convert the schema to IDL (.avdl), and see what you can do with that. IDL files can be converted back to .avsc/.avpr via the same menu, but also using the Avro tools idl or idl2schemata or during the build (using Maven or SBT, for example).

opwvhk commented 2 years ago

I've added a "getting started" section and custom page to the plugin detailing this as well.

harkinj commented 2 years ago

Thanks for the info and the quick support.