Aug 09

Swagger Codegen can be used to create client and server stubs in various languages for testing APIs as they are being developed. Swagger Codegen is a Java application and, evidently, requires Java 8 to run.

Once generated, server stubs can be run to provide the means of testing the API under development through the Swagger Codegen UI interface, which replicates the Swagger Editor API testing pane.

The article referred to in this post walks the reader through the process of creating a Swagger Codegen environment in Windows 10’s Windows Subsystem for Linux 2 Alpine Linux distribution. The environment includes the “automatic” stub generation script for NodeJS API stub server code and a stub server executor that re-generates and re-starts the stub server whenever the API under development is changed on disk. See https://github.com/mwczapski/Swagger_Codegen_3_Docker_Container/blob/master/create_swagger_codegen_in_wsl_alpine.md for the article.

Jul 19

It is possible to develop locally-hosted openapi Specifications using the on-line [Swagger Editor](https://editor.swagger.io/). The on-line Swagger Editor allows a specification to be uploaded from the browser’s host, edited and saved to the browser’s host.

It is also possible, and quite easy, to stand up a locally-hosted Swagger Editor, and eliminate the need to be on-line for this work.

The document referred to in this post describes the resources needed to create a locally-hosted Swagger Editor as a Docker Container, and describes the workflow, with illustrations.

See https://github.com/mwczapski/api_development_with_private_swagger_editor  for package artefacts.

Jul 19

Among other activities, I design and implement RESTful APIs. I use the VSCode, the Swagger Editor, the Swagger UI and the Swagger Codegen, or a combination, as needed. I also use Docker for containerisation as much as possible because I dislike burdening my host machine with all manner of software and the resulting need to manage versions, version conflicts, etc..

The document referred to in this post addresses the topic of creating and using an openapi-based API development and testing environment which uses complimentary Swagger Editor and Swagger Codegen Docker Containers.

Commands shown in the document pull the required Docker Images from the docker hub and create containers that use them.

Once the environment is up and running, API development and testing can be undertaken as required, and containers stopped and remove once the task is over. See https://github.com/mwczapski/Swagger_Development_Workflow for package artefacts.

preload preload preload