{
  "openapi": "3.0.0",
  "info": {
    "title": "Barcode API",
    "description": "Generates different barcode types",
    "version": "1.0.0",
    "contact": {
      "name": "Nicolas ARTANCE",
      "email": "nicolas.artance_ext@michelin.com"
    }
  },
  "servers": [
    {
      "url": "https://barcode.michelin.com",
      "description": "PROD"
    }
  ],
  "tags": [
    {
      "name": "Barcode API",
      "description": "Generates different barcode types"
    }
  ],
  "paths": {
    "/barcode": {
      "get": {
        "tags": ["Barcode API"],
        "summary": "Generates barcodes",
        "description": "Generates a barcode based on provided parameters.",
        "operationId": "generateBarcode",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": true,
            "description": "The text you want to code",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Type of code desired. Available types include code128, qrcode, interleaved2of5, isbn, micropdf417, and ean13 (defaults to code128).",
            "schema": {
              "type": "string",
              "enum": ["code128", "qrcode", "interleaved2of5", "isbn", "micropdf417", "ean13"],
              "default": "code128"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response with barcode image",
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error_code": {
            "type": "string"
          },
          "error_message": {
            "type": "string"
          }
        }
      }
    }
  }
}
