Blogs On Programming

Swagger

Swagger

by Vibrant Publishers on May 22, 2022
Introduction   In this world of constantly changing specifications and requirements, it’s not an easy task to be updated with your web services. Meticulous planning and documentation is a must to win the race. There are a few tools in the market that will help you do the job. We will discuss one such tool Swagger – an API documentation and development toolset.     Swagger Swagger is not just a platform, but a set of tools that will help you in the process of documenting and developing APIs. All these APIs follow the Open API specification standard. Their official website (www.swagger.io) describes three different toolsets:   Swagger Editor Swagger UI Swagger Codegen     Let us have a detailed look into these toolsets: Swagger Editor The swagger editor is responsible for designing and creating APIs based on the Open API specification. This editor can be installed on your computer and you can use it by logging into your swagger account. The editor has an intelligent auto-completion feature and has a visual editor feature where you can interact with the API during its creation time itself. Below is the screenshot from the swagger editor.         Swagger UI The swagger UI is another tool that will allow you to visually see and interact with the APIs. These APIs can be created by Swagger Editor or there is provision for uploading other APIs as well. Once the API is given for the tool, it will automatically generate the visual schema of your API. One of the very useful features of this tool is that it will also create documentation for your API. This is very useful while implementing the API in the back end or at the client-side. You can execute the APIs from there itself and test its functionality as well.     Swagger Codegen The Codegen tool takes care of defining the servers and client-side SDKs for the API that you are building. In this way you don’t need to worry about those aspects while developing and API. It supports over 20 programming languages and the creation of these stubs and SDKs are quite an easy task in Codgen. This will help you to focus only on developing APIs than thinking about the client and server implementations.     Opening an account in Swagger An account in Swagger is quite easy to start. Just visit the website www.swagger.io and sign up for an account by providing some basic details. You can also open an account providing your Github credentials. Once you create an account, you will be taken into the swagger hub dashboard. Below is the screenshot of the same.         From the dashboard, you can create or import your APIs. These APIs can be public or private according to your requirement. If you need other teams from swagger to see and collaborate on the API development, then they have to be public.   Once you are working on your APIs, the view will be changed to something as shown below:         Here, you have access to all the tools, the editor, UI, API docs and Codegen. This will make working with the entire process a seamless experience. Once the API is created, there will be an option to download the corresponding server stub and client SDK.     The default account is free which limits the use only to one user per team. If you need more paid options available. Summary Swagger is a set of tools that is targeted towards API development and documentation. The visual editor and codegen tools are some of the compelling features of this platform. As an API developer, it is worth trying swagger for your use cases.
POSTMAN

POSTMAN

by Vibrant Publishers on May 22, 2022
Introduction   APIs are the heart of every web service. When we deal with enterprise web services, there will be requirements for building thousands of APIs and it is not a simple task for the developer to create all of them manually. To resolve this problem there are many API tools available which will handle the complete lifecycle of an API. In this article, we will discuss such a tool called POSTMAN.   POSTMAN According to the official website (www.postman.com), postman is a collaboration platform for API development. Yes, it allows multiple people to come together and work on creating APIs for their applications. Apart from this, it’s a platform that will take care of all the processes involved in an API creation and management.   Use of POSTMAN in the API world As mentioned above the platform takes care of all requirements in API development. Let us take a look at some of the features the postman offers:   Accessibility: The platform is a hosted service and all you need to start using it is an account in postman. You can either use the browser to login to postman or use their desktop app and start working.   Organized: The APIs that you create with postman can be organized well with the feature called collections. They can be placed in folders and subfolders based on your projects.   Monitoring: Another exciting feature of the postman is the power to monitor the APIs that you have created. This will make your life much easier due to the instant notification of failures in any of your API services.   Testing: Nothing is solid unless you test it thoroughly. Postman offers both manual and automated testing of your APIs. You can define test cases and discuss with your team over the platform itself and put the tests into action. Also, these tests can be integrated into your CI/CD pipeline.   Versioning: You might want to provide APIs for different customers that utilize your services. Or there can be different releases of the same API whenever your application releases new versions. In these cases versioning your API is important. The postman platform offers better tagging and versioning provisions that you and your team can utilize effectively.   Getting started with POSTMAN Inorder to use postman, you need to sign up for an account first. Below is the login/signup screen of the postman.         Once you have an account you can download the postman application and start building your APIs, Test cases, etc.   In postman you have the choice of selecting different plans based on your requirement and pricing. Initially you will be provided with a Free Plan where there are certain limitations on the number of API that you can create and manage. When your requirements are high and there is a team working with you, then it’s good to choose a Team, Business or Enterprise plan as per your convenience. Below is the screenshot of different plans that Postman offers.        Using POSTMAN After successfully creating an account in postman, you can download the client application on your desktop and start working with it.   Once you login to your postman application, the dashboard will look like the one below.         Here you can create your APIs, put them into collections and you can perform monitoring, testing, etc. on your APIs. The UI is very intuitive and can be learned quite quickly.   You can create APIs based on JSON or YAML schema formats. Also, there is support for Open API, GraphQL and RAML schemas.   There is a very detailed tutorial on how to use postman on their official website: https://learning.postman.com. You must pay a visit here if you want to learn about the platform in detail.   Summary Postman is a platform to create and manage the lifecycle of  APIs. It is versatile and has a lot of features including team collaboration and monitoring etc. Using postman for your project will not only save time but will provide a clean and neat way of managing your APIs as well.