{
  "openapi": "3.0.3",
  "info": {
    "title": "ClearCheck Color Converter & WCAG Contrast API",
    "version": "1.0.0",
    "description": "Convertit HEX, RGB, HSL, CMYK et noms CSS courants dans tous les formats et calcule le rapport de contraste WCAG 2.x avec verdicts AA/AAA.\n\nErreurs : JSON {\"error\":{\"code\",\"message\"}}. CORS ouvert. Corps limité à 8 Ko."
  },
  "servers": [
    {
      "url": "https://clearcheck-api.pages.dev"
    }
  ],
  "paths": {
    "/v1/color/convert": {
      "get": {
        "operationId": "color_convert_get",
        "summary": "Convertir une couleur",
        "tags": [
          "ClearCheck Color Converter & WCAG Contrast API"
        ],
        "responses": {
          "200": {
            "description": "Succès (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Requête invalide",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Endpoint inconnu",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Méthode non autorisée",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Corps trop grand (8 Ko max)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Content-Type non JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Valeur invalide",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "color",
            "in": "query",
            "required": true,
            "description": "Couleur : #1e90ff, rgb(30,144,255), hsl(210,100%,56%), cmyk(88,44,0,0), navy",
            "schema": {
              "type": "string"
            },
            "example": "#1e90ff"
          }
        ]
      },
      "post": {
        "operationId": "color_convert_post",
        "summary": "Convertir une couleur",
        "tags": [
          "ClearCheck Color Converter & WCAG Contrast API"
        ],
        "responses": {
          "200": {
            "description": "Succès (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Requête invalide",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Endpoint inconnu",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Méthode non autorisée",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Corps trop grand (8 Ko max)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Content-Type non JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Valeur invalide",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "color"
                ],
                "properties": {
                  "color": {
                    "type": "string",
                    "description": "Couleur : #1e90ff, rgb(30,144,255), hsl(210,100%,56%), cmyk(88,44,0,0), navy"
                  }
                }
              },
              "example": {
                "color": "#1e90ff"
              }
            }
          }
        }
      }
    },
    "/v1/color/contrast": {
      "get": {
        "operationId": "color_contrast_get",
        "summary": "Rapport de contraste WCAG entre deux couleurs",
        "tags": [
          "ClearCheck Color Converter & WCAG Contrast API"
        ],
        "responses": {
          "200": {
            "description": "Succès (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Requête invalide",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Endpoint inconnu",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Méthode non autorisée",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Corps trop grand (8 Ko max)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Content-Type non JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Valeur invalide",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "foreground",
            "in": "query",
            "required": true,
            "description": "Couleur du texte",
            "schema": {
              "type": "string"
            },
            "example": "#767676"
          },
          {
            "name": "background",
            "in": "query",
            "required": true,
            "description": "Couleur du fond",
            "schema": {
              "type": "string"
            },
            "example": "#ffffff"
          }
        ]
      },
      "post": {
        "operationId": "color_contrast_post",
        "summary": "Rapport de contraste WCAG entre deux couleurs",
        "tags": [
          "ClearCheck Color Converter & WCAG Contrast API"
        ],
        "responses": {
          "200": {
            "description": "Succès (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Requête invalide",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Endpoint inconnu",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Méthode non autorisée",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Corps trop grand (8 Ko max)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Content-Type non JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Valeur invalide",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "foreground",
                  "background"
                ],
                "properties": {
                  "foreground": {
                    "type": "string",
                    "description": "Couleur du texte"
                  },
                  "background": {
                    "type": "string",
                    "description": "Couleur du fond"
                  }
                }
              },
              "example": {
                "foreground": "#767676",
                "background": "#ffffff"
              }
            }
          }
        }
      }
    },
    "/v1/color/suggest_text_color": {
      "get": {
        "operationId": "color_suggest_text_color_get",
        "summary": "Texte noir ou blanc le plus lisible sur un fond",
        "tags": [
          "ClearCheck Color Converter & WCAG Contrast API"
        ],
        "responses": {
          "200": {
            "description": "Succès (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Requête invalide",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Endpoint inconnu",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Méthode non autorisée",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Corps trop grand (8 Ko max)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Content-Type non JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Valeur invalide",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "background",
            "in": "query",
            "required": true,
            "description": "Couleur du fond",
            "schema": {
              "type": "string"
            },
            "example": "#1e90ff"
          }
        ]
      },
      "post": {
        "operationId": "color_suggest_text_color_post",
        "summary": "Texte noir ou blanc le plus lisible sur un fond",
        "tags": [
          "ClearCheck Color Converter & WCAG Contrast API"
        ],
        "responses": {
          "200": {
            "description": "Succès (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Requête invalide",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Endpoint inconnu",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Méthode non autorisée",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Corps trop grand (8 Ko max)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Content-Type non JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Valeur invalide",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "background"
                ],
                "properties": {
                  "background": {
                    "type": "string",
                    "description": "Couleur du fond"
                  }
                }
              },
              "example": {
                "background": "#1e90ff"
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}