Co-founder of Microcks | Director of Engineering at Postman Open Technologies
Microcks 1.9.1 release 🚀
Just two months after the previous release, we are thrilled to announce this brand-new Microcks version! Please welcome the 1.9.1
release of Microcks, the Open-source cloud-native tool for API Mocking and Testing 🙌
With no less than 30 newly resolved issues, this release is special as it is the first to have so many issues directly contributed by community users! 25 evolutions out of 30 directly come from them! Kudos to our community 👏, and see greetings along the notes below.
New Proxy features
Aside from the numerous enhancements we’ll discuss just after, this release’s main new feature is the addition of Proxy behavior, which Nikolay Afanasyev introduced in this blog post.
As stated in this post, 1.9.1
comes with two new dispatchers called PROXY
and PROXY_FALLBACK
. While PROXY
is a simple passthrough to an external backend service, PROXY_FALLBACK
handles a bit more logic and allows to call the external backend service only if Microcks doesn’t find a matching mock response at first.
One great thing is that this new proxy logic has been implemented consistently for REST, SOAP and GraphQL APIs in Microcks. Check the full blog post for more details. Thanks again, Nikolay! 🙏
Noticeable enhancements
Below is a list of noticeable enhancements and shootouts to people who contributed them without order or preference.
Templating of responses’ headers
This enhancement lets you specify response header values using Microcks specific {{ }}
template notation. The {{ }}
notation is a placeholder that can be replaced with dynamic values. You can use it to return random values (think of a UUID as a transaction or correlation identifier) or request-based values. It was, for example, used to implement OpenID Connect mocks.
headers:
'Location':
schema:
type: string
examples:
generic:
value: "{{ request.params[redirect_uri] }}?state={{ request.params[state] }}&code={{ uuid() }}"
Check #1097 for more details on this, and thanks again to Nikolay 🙏 for the initial discussion and Pull Request.
JSON pointers extended usage
This enhancement allows you to reference arrays or array elements in mock responses - still using the {{ }}
notation placeholder. Arrays or their elements will be directly serialized as JSON and integrated as such into the response body. For example, you can use this template:
{
"allBooks": {{ request.body/books }},
"firstBook": {{ request.body/0 }}
}
to get results like:
{
"allBooks": [{ "title":"Title 1", "author":"Jane Doe" },{ "title":"Title 2", "author":"John Doe" }],
"firstBook": { "title":"Title 1", "author":"Jane Doe" }
}
Check #1139 for more details on this, and thank Andreas Zöllner 🙏 for proposing and writing this enhancement.
Object query parameters support
This enhancement adds support for serializing an object’s properties as request parameters. It follows the serialization rules for style: form
parameters with explode: true
, which translates in OpenAPI by having a query parameter of object
type.
So typically, you may define a GET /users?name=Alex&age=44
endpoint where the query parameter is a User
object. How cool! 😎
Check #1143 for more details, and thanks to Samuel Antoine 🙏 for proposing and writing this enhancement.
Webapp enhancements and linting
While functional, the Microcks web app undoubtedly needs more love and enhancements as it is not the expertise field of original maintainers 😉 Thanks to community contribution, we’re now in better shape and have people still seeking improvements.
We have some noticeable improvements here:
- Selecting/deselecting operations when launching a test can now be done with a single checkbox,
- Broken unit tests have been removed from the codebase,
- Broken links to documentation have been fixed,
- Linting of application and refactoring for better standard respect has been applied,
- Analyses on how we could move to fresher dependencies or frameworks are coming.
Check #1153, #1163, #1166 and #1171 contributions by Siarhei Saroka 🙏 for more details.
More Tests
Contributing to an Open Source project is not only a matter of writing code. Starting with documentation and adding new tests is a great way to get hands-on experience. As Microcks becomes a critical tool for many organizations, increasing the coverage of our test suite is essential.
We moved from 36.8% coverage on January 1st to 48.4% as of today! This is great progress for a code base of nearly 12K lines of code, and we can still get even better!
Check #1128, #1130 and #1150 for awesome contributions on tests by Matheus Cruz 🙏
Documentation refactoring effort
We also want to take the opportunity of this release notes post to announce a significant refactoring effort on documentation. As stated above, Microcks has become critical and attracts more and more newcomers. The documentation needs to be reorganized to better assist with onboarding and help users find what they’re looking for.
We came up with a new approach to the documentation structure exposed in this GitHub thread. Our main goal is to clarify the categorization of information between Tutorials, Guides, Explanations, and Reference materials. We want to make it easier and faster for newcomers to find valuable information depending on where they are in their learning process. We also want to make it easier for community users to contribute new content easily.
For all of that, we need your help! So, if you are or would love to be a Tech Writer and want to contribute to this cool Open Source project, please join us and share your recipes and experiences to improve our documentation!
What’s coming next?
As usual, we will eagerly prioritize items according to community feedback. You can check and collaborate via our list of issues on GitHub and the project roadmap.
Remember that we are an open community, which means you, too, can jump on board to make Microcks even greater! Come and say hi! on our GitHub discussion or Discord chat 👻, send some love through GitHub stars ⭐️ or follow us on Twitter, Mastodon, LinkedIn, and our YouTube channel!
Thanks for reading and supporting us! ❤️