Gin · Schema

Gin Router and Middleware Configuration

JSON Schema for Gin web framework router engine configuration and common middleware settings.

Microservices

Properties

Name Type Description
mode string Gin mode (set via GIN_MODE env var or gin.SetMode()).
redirectTrailingSlash boolean Redirect /foo/ to /foo or vice versa.
redirectFixedPath boolean Try to fix and redirect the request path.
handleMethodNotAllowed boolean Return 405 instead of 404 for mismatched methods.
forwardedByClientIP boolean Parse client IP from X-Forwarded-For / X-Real-IP.
useRawPath boolean Use url.RawPath for route matching.
unescapePathValues boolean Unescape path values for matching.
removeExtraSlash boolean Remove extra slashes from URL path.
maxMultipartMemory integer Maximum memory for multipart forms in bytes (default 32MB).
trustedPlatform string Trusted platform header (e.g., X-Forwarded-For).
trustedProxies array List of trusted proxy CIDR ranges.
middleware object Common middleware configuration.
View JSON Schema on GitHub

JSON Schema

gin-configuration.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/api-evangelist/gin/json-schema/gin-configuration.json",
  "title": "Gin Router and Middleware Configuration",
  "description": "JSON Schema for Gin web framework router engine configuration and common middleware settings.",
  "type": "object",
  "properties": {
    "mode": {
      "type": "string",
      "enum": ["debug", "release", "test"],
      "default": "debug",
      "description": "Gin mode (set via GIN_MODE env var or gin.SetMode())."
    },
    "redirectTrailingSlash": {
      "type": "boolean",
      "default": true,
      "description": "Redirect /foo/ to /foo or vice versa."
    },
    "redirectFixedPath": {
      "type": "boolean",
      "default": false,
      "description": "Try to fix and redirect the request path."
    },
    "handleMethodNotAllowed": {
      "type": "boolean",
      "default": false,
      "description": "Return 405 instead of 404 for mismatched methods."
    },
    "forwardedByClientIP": {
      "type": "boolean",
      "default": true,
      "description": "Parse client IP from X-Forwarded-For / X-Real-IP."
    },
    "useRawPath": {
      "type": "boolean",
      "default": false,
      "description": "Use url.RawPath for route matching."
    },
    "unescapePathValues": {
      "type": "boolean",
      "default": true,
      "description": "Unescape path values for matching."
    },
    "removeExtraSlash": {
      "type": "boolean",
      "default": false,
      "description": "Remove extra slashes from URL path."
    },
    "maxMultipartMemory": {
      "type": "integer",
      "default": 33554432,
      "description": "Maximum memory for multipart forms in bytes (default 32MB)."
    },
    "trustedPlatform": {
      "type": "string",
      "description": "Trusted platform header (e.g., X-Forwarded-For)."
    },
    "trustedProxies": {
      "type": "array",
      "items": { "type": "string" },
      "description": "List of trusted proxy CIDR ranges."
    },
    "middleware": {
      "type": "object",
      "properties": {
        "logger": {
          "type": "object",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": true,
              "description": "Enable request logging middleware."
            },
            "formatter": {
              "type": "string",
              "description": "Custom log format string."
            },
            "output": {
              "type": "string",
              "description": "Log output destination."
            },
            "skipPaths": {
              "type": "array",
              "items": { "type": "string" },
              "description": "Paths to skip logging."
            }
          }
        },
        "recovery": {
          "type": "object",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": true,
              "description": "Enable panic recovery middleware."
            }
          }
        },
        "cors": {
          "type": "object",
          "properties": {
            "allowOrigins": {
              "type": "array",
              "items": { "type": "string" },
              "default": ["*"],
              "description": "Allowed origins."
            },
            "allowMethods": {
              "type": "array",
              "items": { "type": "string" },
              "description": "Allowed HTTP methods."
            },
            "allowHeaders": {
              "type": "array",
              "items": { "type": "string" },
              "description": "Allowed request headers."
            },
            "exposeHeaders": {
              "type": "array",
              "items": { "type": "string" },
              "description": "Headers exposed to the client."
            },
            "allowCredentials": {
              "type": "boolean",
              "default": false,
              "description": "Allow credentials."
            },
            "maxAge": {
              "type": "integer",
              "description": "Preflight cache duration in seconds."
            }
          }
        },
        "rateLimiter": {
          "type": "object",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": false,
              "description": "Enable rate limiting middleware."
            },
            "limit": {
              "type": "integer",
              "description": "Maximum requests per period."
            },
            "period": {
              "type": "string",
              "description": "Rate limit period duration."
            }
          }
        }
      },
      "description": "Common middleware configuration."
    }
  }
}

Work with this as data

Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for schemas

4 MCP tools reach this
  • find_json_schemasBrowse and filter every JSON Schema in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/gin-configuration"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.