LoopBack is a powerful framework. As we know, “with great framework power comes great framework documentation.” When you know what you’re looking for in the docs, it’s easy to find. But  discovering what’s available can be a challenge for a tool as “featureful” as LoopBack. What if there were a tool that could push the documentation to you while you code? With such a tool, you could avoid typos, find configuration errors early, and discover features or options you may not have known about.

Enter the LoopBack 3 JSON Schemas Extension for VS Code!

What does it do? Let’s take a look:

Code Hints

The plugin prompts you as you type. Hit enter to accept a suggestion, or use the up/down arrows to select one from a list of options.

Announcing Open Source LoopBack JSONSchemas VS Code Extension: demo of code hinting

Green Squiggles

If you have a mismatched type or missing property, you’ll get a green squiggle underline. Great for locating typos!

Announcing Open Source LoopBack JSONSchemas VS Code Extension: demo of green squiggles on problems

Ctrl+Space

Hit ctrl+space to be shown available properties

Announcing Open Source LoopBack JSONSchemas VS Code Extension: ctrl+space demo

…as well as  values for those properties that have a finite set of acceptable options:

Announcing Open Source LoopBack JSONSchemas VS Code Extension: ctrl+space demo for enumerated type

Some documentation is right inline, but in places where configuration can be more complex you’ll be offered a link to click through to the full documentation:

Announcing Open Source LoopBack JSONSchemas VS Code Extension: clicking links from tooltip

Give it a Try

The project is open source, so if you’d like to contribute or need to file a bug, you can do so on github:

  • The JSONSchemas repository holds the schemas themselves, which is the bulk of the project. If you find an problem with a schema, this is where to file an issue. Note that the schemas can be used with any tool that supports JSONSchemas. You don’t have to use the VS Code extension, it’s the easiest way.
  • The  VS Code Extension repository hosts “the extension” which is little more than some configuration settings for VS Code that say “when the users opens a file called (e.g.) server/middleware.json, load the following JSONSchema and validate against it.” File an issue here if you’re having a problem with the plugin itself.

If you have any questions or feedback, you can file an issue or ask me about it online. Happy coding!