Random Joke Generator

Random Joke Generator · GPT-Aktionen

JokeAPI

An API for retrieving random jokes.

  • GET /joke/{category}GetRandomJoke

    Get a random joke from a specific category

Ursprüngliches API-Schema
{
  "openapi": "3.1.0",
  "info": {
    "title": "JokeAPI",
    "description": "An API for retrieving random jokes.",
    "version": "v1.0.0"
  },
  "servers": [
    {
      "url": "https://v2.jokeapi.dev"
    }
  ],
  "paths": {
    "/joke/{category}": {
      "get": {
        "description": "Get a random joke from a specific category",
        "operationId": "GetRandomJoke",
        "parameters": [
          {
            "name": "category",
            "in": "path",
            "description": "Category of the joke (e.g., Any, Programming, Misc, Dark, Pun, Spooky, Christmas)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "description": "Type of joke to return (single, twopart)",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lang",
            "in": "query",
            "description": "Language in which to return the joke (e.g., en, de, es)",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response with a joke",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JokeResponse"
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "components": {
    "schemas": {
      "JokeResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "boolean"
          },
          "category": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "joke": {
            "type": "string",
            "nullable": true
          },
          "setup": {
            "type": "string",
            "nullable": true
          },
          "delivery": {
            "type": "string",
            "nullable": true
          },
          "flags": {
            "$ref": "#/components/schemas/Flags"
          },
          "id": {
            "type": "integer"
          },
          "safe": {
            "type": "boolean"
          },
          "lang": {
            "type": "string"
          }
        }
      },
      "Flags": {
        "type": "object",
        "properties": {
          "nsfw": {
            "type": "boolean"
          },
          "religious": {
            "type": "boolean"
          },
          "political": {
            "type": "boolean"
          },
          "racist": {
            "type": "boolean"
          },
          "sexist": {
            "type": "boolean"
          },
          "explicit": {
            "type": "boolean"
          }
        }
      }
    }
  }
}