ASP.NET Core Web API Interview Question #89

What is OpenAPI?

Routing, Versioning, OpenAPI/Swagger & API Documentation Mid-Level Intermediate

Quick Interview Answer

OpenAPI is a machine-readable specification for describing HTTP APIs. It can describe paths, operations, parameters, request bodies, response schemas, authentication requirements, and other contract metadata.

Detailed Explanation

OpenAPI is a machine-readable specification for describing HTTP APIs. It can describe paths, operations, parameters, request bodies, response schemas, authentication requirements, and other contract metadata.

OpenAPI documents can power interactive documentation, client generation, testing tools, gateways, and contract-review workflows.

Code Example

{
  "openapi": "3.0.1",
  "paths": {
    "/api/products/{id}": {
      "get": { }
    }
  }
}