C# protecting Swagger endpoints

What if we do not want to open our OpenAPI schema to the world? We can choose some paths: Basic authorization, OpenId Connect authorization using identity server. In this article, I am going to show the second path.

How to Maintain API Documentation by Swagger with Express API in Node

Learn how to maintain thorough API documentation by using Swagger with an Express API in Node. We’re going to explore Swagger usage along with an Express API. Swagger is an open source set of tools that enable you to design, build, document, and use RESTful web services.

Hiding Endpoints From Swagger Documentation in Spring Boot

Hiding Endpoints From Swagger Documentation in Spring Boot. Let's have a look at how we can hide endpoints from Swagger API documentation.

How to Turn Off Swagger-ui in Production

The Swagger UI can be very helpful during development, but may be a security risk in production. We look at how to ensure it isn't left accidentally available.

How to Turn Off Swagger-ui in Production

How to Turn Off Swagger-ui in Production. The Swagger UI can be very helpful during development, but may be a security risk in production. We look at how to ensure it isn't left accidentally available.

OpenAPI Specification v. 3+ Introduction

The OpenAPI Specification (OAS) defines a standard, language-agnostic interface to RESTful APIs which allows both humans and computers to discover and understand the capabilities of the service without access to source code, documentation, or through network traffic inspection.

Fullstack Go: Adding API Security

In a previous post, I described how I added Swagger support to my sample Go fullstack application. Here, I describe how that solution was…

JSON Schema, Schema.org, JSON-LD: What’s the Difference?

Recently, I have seen several questions like “what’s the difference between JSON-LD and JSON Schema” or “can I use JSON Schema and Schema.org”. I come from a linked data background (which is close to the world of Schema.org) but have recently started using JSON Schema a lot and I have to admit that there is no trivial answer to these questions. There is the obvious similarity in the standard names like “Schema” and “JSON”. If you compare the Schema.org page for Person to this example on the JSON Schema page, you have to admit that they kind of look alike. Combine this with the fact that Schema.org touts JSON-LD, which — by design — very much looks like regular JSON completes the confusion. So there definitely are enough reasons to write this article. JSON Schema, Schema.org, JSON-LD: What’s the Difference?

How to Effectively Split Your Swagger API and Models for Code Generation

Create multiple smaller APIs for each client to improve the development process and reduce boilerplate code. Let's learn how to effectively split your Swagger API and models for Code Generation

Setting up an Express Service Using Swagger 3.0

This is a quick tutorial on setting up a simple express service using swagger 3.0. Besides, the biggest advantage of Swagger 3.0 that we'll discover are:Request and response validation out of the box and Operation handlers to replace routers

C++ RESTful Web Service With Swagger-UI and Auto-Documented Endpoints

Building RESTful Web Service Using C++, Swagger UI And Auto-Documented Endpoints. Learn how-to-use Oat++ web framework to build your own C++ performant web-service and integrate it with Swagger-UI.

Pneumonia Detection using deep learning and swagger.

Pneumonia Detection using deep learning and swagger. In this story, we will walk through the steps of detecting pneumonia using deep learning and deploy the model using swagger.

Swagger java annotations in action

gRPC, JSON, or maybe graphQL? Each method has its advantages, a JSON RESTful API is the simplest, oldest, and most commonly used. However…

Spring Boot REST API Documentation with Swagger

In this article, I will explain Swagger and how you can use it to create documentation for your REST API built with SpringBoot.

Tools for implementing a Golang API server with auto-generated code

Let’s look at the grpc-gateway in more detail. How to make a server with gRPC, RESTful API, WebSocket and Open API from a protobuf file?

Serverless NestJS: Document your API with Swagger and AWS API Gateway

Add documentation to your API is really important for share it with your team or with your clients. Documentation with NestJS and Swagger and use your JSON file to edit it as you wish and replace it with the API Gateway Documentation, once you are done you can simply comment your Swagger code in your main.ts file and re-deploy your application or if you want deploy your Swagger-ui in production.

Can Your API Gateway Tango to Open API Spec?

Automate Programming Enroute Universal API Gateway (Standalone or Kubernetes Ingress) to OpenAPI Swagger Spec in less than a minute.

Swagger in ASP.NET Core: Tips & Tricks

Transform your swagger UI into an interactive documentation. This post contains a few tips and tricks that can help you transform your swagger UI into an interactive documentation. If you don’t yet know how to install swagger in ASP.NET Core, this post will help you <span style="color: rgb(3, 102, 214);">Get started with Swagger and ASP.NET Core</span>. ## How to change the URL of the Swagger UI By default, the Swagger UI can be found at `http://localhost:/swagger`. To change the path and set, for example, the Swagger UI at the app’s root, use: app.<span style="color: rgb(111, 66, 193);">UseSwaggerUI</span>(c <span style="color: rgb(215, 58, 73);">=></span>{ c.<span style="color: rgb(111, 66, 193);">SwaggerEndpoint</span>(<span style="color: rgb(3, 47, 98);">"/swagger/v1/swagger.json"</span>, <span style="color: rgb(3, 47, 98);">"My API V1"</span>); c.RoutePrefix <span style="color: rgb(215, 58, 73);">=</span> string.Empty;}); [view raw](https://gist.github.com/georgekosmidis/f5b4a75fc556a84fa4f7d224094b0a1d/raw/68a44d66e9d9fd79422597c3b39fbca89d0d10fa/swagger_RoutePrefix.cs) [swagger_RoutePrefix.cs](https://gist.github.com/georgekosmidis/f5b4a75fc556a84fa4f7d224094b0a1d#file-swagger_routeprefix-cs) hosted with ❤ by [GitHub](https://github.com/) ## How to revert Swagger JSON to version 2.0 By default, Swashbuckle generates and exposes Swagger JSON in version 3.0 of the specification -officially called the <span style="color: rgb(3, 102, 214);">OpenAPI Specification</span>. To support backwards compatibility, you can opt into exposing JSON in the 2.0 format instead: app.<span style="color: rgb(111, 66, 193);">UseSwagger</span>(c <span style="color: rgb(215, 58, 73);">=></span> { c.SerializeAsV2 <span style="color: rgb(215, 58, 73);">=</span> <span style="color: rgb(0, 92, 197);">true</span>; }); [view raw](https://gist.github.com/georgekosmidis/f5b4a75fc556a84fa4f7d224094b0a1d/raw/68a44d66e9d9fd79422597c3b39fbca89d0d10fa/swagger_SerializeAsV2.cs) [swagger_SerializeAsV2.cs](https://gist.github.com/georgekosmidis/f5b4a75fc556a84fa4f7d224094b0a1d#file-swagger_serializeasv2-cs) hosted with ❤ by [GitHub](https://github.com/) ## How to add author, license, and description If you want, you can pass information such as the author, license, and description, using the `OpenApiInfo` object: services.<span style="color: rgb(111, 66, 193);">AddSwaggerGen</span>(c <span style="color: rgb(215, 58, 73);">=></span>{ c.<span style="color: rgb(111, 66, 193);">SwaggerDoc</span>(<span style="color: rgb(3, 47, 98);">"v1"</span>, <span style="color: rgb(215, 58, 73);">new</span> <span style="color: rgb(111, 66, 193);">OpenApiInfo</span> { Version <span style="color: rgb(215, 58, 73);">=</span> <span style="color: rgb(3, 47, 98);">"v1"</span>, Title <span style="color: rgb(215, 58, 73);">=</span> <span style="color: rgb(3, 47, 98);">"The .NET Lab API"</span>, Description <span style="color: rgb(215, 58, 73);">=</span> <span style="color: rgb(3, 47, 98);">"An imaginary API of my blog"</span>, TermsOfService <span style="color: rgb(215, 58, 73);">=</span> <span style="color: rgb(215, 58, 73);">new</span> <span style="color: rgb(111, 66, 193);">Uri</span>(<span style="color: rgb(3, 47, 98);">"https://blog.georgekosmidis.net/privacy-policy/"</span>), Contact <span style="color: rgb(215, 58, 73);">=</span> <span style="color: rgb(215, 58, 73);">new</span> <span style="color: rgb(111, 66, 193);">OpenApiContact</span> { Name <span style="color: rgb(215, 58, 73);">=</span> <span style="color: rgb(3, 47, 98);">"George Kosmidis"</span>, Email <span style="color: rgb(215, 58, 73);">=</span> string.Empty, Url <span style="color: rgb(215, 58, 73);">=</span> <span style="color: rgb(215, 58, 73);">new</span> <span style="color: rgb(111, 66, 193);">Uri</span>(<span style="color: rgb(3, 47, 98);">"https://georgekosmidis.net"</span>), }, License <span style="color: rgb(215, 58, 73);">=</span> <span style="color: rgb(215, 58, 73);">new</span> <span style="color: rgb(111, 66, 193);">OpenApiLicense</span> { Name <span style="color: rgb(215, 58, 73);">=</span> <span style="color: rgb(3, 47, 98);">"Use under MIT"</span>, Url <span style="color: rgb(215, 58, 73);">=</span> <span style="color: rgb(215, 58, 73);">new</span> <span style="color: rgb(111, 66, 193);">Uri</span>(<span style="color: rgb(3, 47, 98);">"https://blog.georgekosmidis.net/privacy-policy/"</span>), } });});

Get started with Swagger and ASP.NET Core

Install and configure Swagger for .NET Core. This post is an overview of how to install and configure Swagger for .NET Core. If you are searching for tips & tricks, you might be interested in the article: Swagger in .NET Core: Tips & Tricks. Swagger is an open-source software framework backed by a large ecosystem of tools that helps developers design, build, document, and consume RESTful web services.

Spring Boot REST API Documentation with Swagger

Swagger is an open-source tool to develop APIs, interact with APIs, and mainly generate documentation for APIs. Let's dive into explanation about Swagger and how to use Swagger to create a documentation for your REST API built using SpringBoot.