Scott Hanselman

Using the Blockly visual programming editor to call a .NET Core WebAPI

June 24, 2020 Comment on this post [7] Posted in ASP.NET | ASP.NET Web API | Open Source
Sponsored By

I like to showcase interesting and cool open source projects that need more attention! Go give our friend a star on GitHub! NetCoreBlockly on GitHub is clever and fun!

Blockly is a JavaScript library for building visual programming editors. If you've used languages like Scratch you've seen block-style programming environments. The picture below shows you a demo of calling a .NET Core WebAPI using Blockly code!

Remember that once you have a WebAPI you can make it available in a number of ways. The "projection" of the methods that the WebAPI makes available can be presented visually, as Swagger/OData/GraphQL, however you like. Another project is WebAPI2CLI that lets you call WebAPI endpoints easily from a CLI (Command Line Interface) that is more high fidelity than curl or wget.

.NET Core as a Blockly Editor

What .NET Core Blockly is doing is looking at the projection/interface of your WebAPI and generating Blockly blocks! That means that anyone (business users, student, tester, whatever) could try out your WebAPI with a simple drag and drop interface in their browser!

You can pull in Swagger, OData, or GraphQL interfaces.

I love seeing fun projects like this that make the web (and .NET code) easier to use! Go give them some stars and get involved!


Sponsor: Upgrade from file systems and SQLite to Actian Zen Edge Data Management. Higher Performance, Scalable, Secure, Embeddable in most any programming language, OS, on 64-bit ARM/Intel Platform.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Hosting By
Hosted in an Azure App Service
June 25, 2020 12:55
This project looks interesting and easy to use for the testing team in our company.
Would it only work with .NET core API's or with any OData or Swagger documented WebAPI interfaces?
June 25, 2020 13:34
Hello Sven

It will work with any Swagger or OData or GraphQL ( this is work in progress, though) - if you pin to the right url.

You can test it at https://netcoreblockly.herokuapp.com/ - see Swaggers and OData categories from blocks .

The code is :

app.UseBlocklySwagger("petstore", "https://petstore.swagger.io/v2/swagger.json");

app.UseBlocklyOData("OdataV4", "https://services.odata.org/TripPinRESTierService/");





June 25, 2020 14:28
Awesome!
Will definitely give this a try.

Thanks, Ignat Anderei
June 28, 2020 10:29
This project are very help and easy to use . Know the confirmation about it will be used on any webapi.
July 01, 2020 8:52
The learning time for this tool, risk of blocking bugs during first product release cycle, and ongoing maintenance costs will be orders of magnitude larger than the hours saved by using this tool for any QA tests in production systems.

I ask when the developer team brings such a tool up for consideration:

"How much does it cost?"
"How much time will it save us for this release?"
"Has it been updated with meaningful changes and not just a look and feel reskin in the last year?"
"How many developers work on it?"
"How many commits have been made to its code base in the last 6 months?"
"Is there commercial support available?"
"What is the time needed for a new developer/QA tech to learn the product and write one test case?"
"Will it add custom build steps to our pipeline?"
"Will it send its output to our build pipeline?"
"Does it require any other software to be installed which we do not already have installed?"
"Can I hire developers with experience in the tool?"
"Does it require yet another language to be learned?" Custom scripting language, language to do queries when SQL would work better.
"To use it, do I have to create many extensible custom code modules?"

These are all TCO from a software business perspective and intrinsic to having well run computer systems.

Software systems are like cars, you do not just add modifications to them or install parts built by one guy in his garage bought off ebay. This should be self-evident for such complex systems as software solutions.

Our company has multiple development teams; each team picks its on set of pet tools and over time we have 50+ different development tools being used. One or more of those tools is end of lifed, no longer supported, obsolete due to Visual Studio upgrade at all times

We do not have time nor budget to fire fight the continual battle against each team using tools which will become broken maintenance problems in 2 years.

Inherit a few existing large systems code base before responding.
July 01, 2020 19:10
Very interesting project. Looks like visual programming is getting better with every year.
July 05, 2020 15:25
very good. thank you... hd bilişim

Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.