Announcing MantisSharp, a .NET client for using the MantisBT REST API
I've released a new open source project named MantisSharp, a simple .NET client for working with the recently introduced REST API for Mantis Bug Tracker.
The library is just getting started and is missing various functions (hello documentation!) but it seems to be usable - as well as the WinForms sample browser that I was using for development testing, I also tested it in an ASP.NET MVC application, both locally and then remotely using the development version of cyotek.com.
It's probably not ready for prime time, I need to add docs, samples and finally get serious about using await/async, plus get a .NET Standard build done. But I think it's getting off to a good start.
The GitHub repository can be found at https://github.com/cyotek/MantisSharp - the readme has lots of extra details so I'm not going to repeat it here.
Why create this library?
Originally I wanted to use the MantisBT REST API to automatically generate the product roadmaps on cyotek.com - currently these are manual, and looking at the last modification dates on the content entries shows the latest update was in 2015. Ouch. As I've been properly planning releases in our MantisBT instance, it made sense to use that data. However, I don't want to open access (anonymous or otherwise) to the MantisBT instance itself, hence deciding to use the new API they added recently.
I wasn't planning create a full blown library, I thought I'd
just load the JSON into a
dynamic and grab what I needed that
way. But that untyped code offended me so much (and oddly enough
there didn't seem to be another client out there from a very
brief check of NuGet) that in the end it was inevitable.
Assuming more than just me uses this library I'd love to hear your feedback.
As well as the source, you can grab precompiled binaries via a NuGet package
The package includes builds for .NET 3.5, 4.0, 4.5 and 4.6. 4.7 will follow when I pave my machine and get the Creators Update, .NET Standard will follow as soon as I actually add it as a target and resolve any API issues.
Then just create an instance of the
MantisClient, passing the
base URI where your MantisBT installation is hosted, along with
an API key. Also note that by default the REST API is disabled
and needs to be explicitly switched on for external access.
(There's a wiki page which tells you how).
There's still outstanding work to do, some of which is detailed in the readme. I also haven't done much testing yet, and our MantisBT database is currently quite small, so I don't know how the library will perform under bigger databases.
- 2017-07-10 - First published
- 2020-11-22 - Updated formatting
Like what you're reading? Perhaps you like to buy us a coffee?
# Richard Moss