No extra grief when working with pesky openapi.yaml recordsdata
I not too long ago found the IDE plugin Indent Rainbow while attempting to unravel a frustration I’d been experiencing when working with
With one in all my purchasers, I’m working with a big
openapi.yaml file. This file defines our API and describes every of our endpoints in minute element – request parameters, our bodies, anticipated responses, and many others. Although I at all times discovered pasting code into this file was a mildly irritating expertise.
Having the right indentation is essential in YAML recordsdata, which means that to stick the code in the appropriate place, I used to be having to both rely the variety of indentation pointers from the left or observe a particular line down with my cursor. Neither of those is nice! Additionally, my IDE (Goland) at all times appears to mess up the indentation at any time when I paste, however that’s a special story!
So I wished to discover a plugin that will make this a bit simpler. And Indent Rainbow appeared to suit the invoice. Indent Rainbow is a plugin for IDEs (e.g. JetBrains products and VS Code) that colours every of your indentation ‘steps’. And this, in flip, makes the indentation simpler to learn.
So, for instance, that is how one of many recordsdata I’m engaged on as a part of a side project seems to be like in my IDE:
Nevertheless, Indent Rainbow is, by default, disabled on recordsdata with over 1000 strains. This setting might be overruled, although I had beforehand discovered it to be extremely sluggish when engaged on an
openapi file of virtually 6000 strains. And this meant that, frustratingly, I’d have to depart the plugin disabled for big recordsdata and thus my authentic downside would stay.
Nevertheless, as of the time of writing, it might appear this has been fastened as working with massive recordsdata is not deathly sluggish. Whoop! Now I believe I’m going to depart this plugin enabled on a regular basis — even for big recordsdata 💯