OpenAPI Specification

Learn how to generate OpenAPI Specification (OAS) 2.0 and 3.0 documents from your Noir scan results. This is a powerful way to create API documentation and integrate with other security tools.

Generate OpenAPI Specification (OAS) documents from your codebase for API documentation, testing, and tool integration.

Noir supports both OAS 2.0 (Swagger) and OAS 3.0.

Usage

Generate OAS document:

OAS 3.0 (recommended):

noir -b . -f oas3

OAS 2.0:

noir -b . -f oas2

Example Output

{
  "openapi": "3.0.0",
  "info": {
    "title": "Generated by Noir",
    "version": ""
  },
  "paths": {
    "/": {
      "get": {
        "responses": {
          "200": {
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header"
          }
        ]
      }
    },
    "/query": {
      "post": {
        "responses": {
          "200": {
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "my_auth",
            "in": "query"
          },
          {
            "name": "query",
            "in": "formData"
          }
        ]
      }
    }
  }
}