![speccy definition speccy definition](https://all10soft.com/images/upload/5/c/speccy-windows-10-screenshot.jpg)
API developers might have constraints that do not allow them to implement the most informative status code or error message, API errors can be triggered by real-world conditions that are hard to account or test for, and sometimes ourselves, as API users, can make requests with typos or mistakes that APIs just don't know how to handle. In reality, APIs don't always work like that. In an ideal world, APIs would always return a 200 OK with just the right data that we need, or in case of a failure, it would return us the perfect status code and error message allowing us to easily understand what went wrong.
![speccy definition speccy definition](http://www.zoomtaqnia.com/wp-content/uploads/2017/02/6.png)
:)īy Heitor Tashiro Sergent on February 25, 2019.ĭebugging and troubleshooting APIs is something that any developer that works with APIs has to go through at some point. And always be kind to open-source maintainers. I would recommend using the latest version if that bug has been fixed. At the time of writing, there was a known issue with the latest version where the output flag for the resolve command was not working.
#Speccy definition install#
Note: you might have noticed that we are using a specific version of speccy, 0.8.7, in the install command. If you want to test this on a definition file that's broken up into separate files but you don't have one at the moment, you can use this example I set up using the Pet Store example: Īnd if you're curious about the way I split up this OpenAPI definition, I used this great blog post by Jack Skinner as a reference: Maintaining large design-first API specs. Next, we add the option flag -o to output the resulting definition to a new file named spec-output.yaml. It's followed by the path to the main definition file that includes references to other files you wish to merge. `resolve` is the command to merge definition files back into one.
#Speccy definition download#
You can either download it from the Node.js website, or open the terminal and run: To use speccy, first we need to have Node.js installed in our machine. Speccy is an open-source project written in Node.js, that allows the user to lint, merge, and visualize an OpenAPI definition in a human-readable format.įor our purposes, we're just going to focus on the merging aspect of it. Now, you might ask yourself, why would someone want to merge an OpenAPI definition file back together? Isn't the point of separating it into multiple files to have better organization? Well, merging a definition file back together into a single one can be useful if you have tooling that doesn't support definition files with references and requires a single one to be uploaded, whether that is for documentation tooling, a UI definition editor, or maybe for API Gateway support. I recently saw a Twitter thread that started with a simple question: how to combine multiple OpenAPI 3 definition files back together? One of the answers on that Twitter thread came from Mike Ralphson, and he pointed out that speccy, an open-source project, could help with that.