Prattles Portal

Prattles Portal · GPT 작업

FastAPI

  • GET /authAuth Proxy
  • POST /tokenToken Proxy
  • POST /prattlesCreate

    Create a new prattle

  • GET /prattles/randomGet Prattle

    Get prattles randomly.

  • GET /prattles/{prattle_id}Find Prattle

    Get prattle by id.

  • POST /prattles/{prattle_id}/mentionMention Prattle

    Mention a user in a prattle

  • GET /mentions/{mention_id}Find Mention

    Get mentions of the user.

  • POST /mentions/{mention_id}/mentionMention Mention

    Mention a user in a prattle

  • GET /check-unread-mentionsFind Unread Mentions

    Get mentions of the user.

원본 API 스키마
{
  "openapi": "3.1.0",
  "info": {
    "title": "FastAPI",
    "version": "0.1.0"
  },
  "servers": [
    {
      "url": "https://prattle-portal-7wuwcntxuq-uc.a.run.app"
    }
  ],
  "paths": {
    "/auth": {
      "get": {
        "summary": "Auth Proxy",
        "operationId": "auth_proxy_auth_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/token": {
      "post": {
        "summary": "Token Proxy",
        "operationId": "token_proxy_token_post",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/prattles": {
      "post": {
        "summary": "Create",
        "description": "Create a new prattle",
        "operationId": "create_prattles_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PostPrattleRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostPrattleResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "Google OAuth2": []
          }
        ]
      }
    },
    "/prattles/random": {
      "get": {
        "summary": "Get Prattle",
        "description": "Get prattles randomly.",
        "operationId": "get_prattle_prattles_random_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetPrattlesResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "Google OAuth2": []
          }
        ]
      }
    },
    "/prattles/{prattle_id}": {
      "get": {
        "summary": "Find Prattle",
        "description": "Get prattle by id.",
        "operationId": "find_prattle_prattles__prattle_id__get",
        "security": [
          {
            "Google OAuth2": []
          }
        ],
        "parameters": [
          {
            "name": "prattle_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Prattle Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrattleSchema"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/prattles/{prattle_id}/mention": {
      "post": {
        "summary": "Mention Prattle",
        "description": "Mention a user in a prattle",
        "operationId": "mention_prattle_prattles__prattle_id__mention_post",
        "security": [
          {
            "Google OAuth2": []
          }
        ],
        "parameters": [
          {
            "name": "prattle_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Prattle Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PostMentionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostPrattleResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/mentions/{mention_id}": {
      "get": {
        "summary": "Find Mention",
        "description": "Get mentions of the user.",
        "operationId": "find_mention_mentions__mention_id__get",
        "security": [
          {
            "Google OAuth2": []
          }
        ],
        "parameters": [
          {
            "name": "mention_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Mention Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetMentionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/mentions/{mention_id}/mention": {
      "post": {
        "summary": "Mention Mention",
        "description": "Mention a user in a prattle",
        "operationId": "mention_mention_mentions__mention_id__mention_post",
        "security": [
          {
            "Google OAuth2": []
          }
        ],
        "parameters": [
          {
            "name": "mention_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Mention Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PostMentionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostPrattleResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/check-unread-mentions": {
      "get": {
        "summary": "Find Unread Mentions",
        "description": "Get mentions of the user.",
        "operationId": "find_unread_mentions_check_unread_mentions_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/MentionSchema"
                  },
                  "type": "array",
                  "title": "Response Find Unread Mentions Check Unread Mentions Get"
                }
              }
            }
          }
        },
        "security": [
          {
            "Google OAuth2": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "GetMentionResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "The document id of the mention."
          },
          "mention": {
            "allOf": [
              {
                "$ref": "#/components/schemas/MentionSchema"
              }
            ],
            "description": "The mentions of the user."
          }
        },
        "type": "object",
        "required": [
          "id",
          "mention"
        ],
        "title": "GetMentionResponse"
      },
      "GetPrattlesResponse": {
        "properties": {
          "mentions": {
            "items": {
              "$ref": "#/components/schemas/MentionSchema"
            },
            "type": "array",
            "title": "Mentions",
            "description": "The mentions of the user.",
            "default": []
          },
          "prattles": {
            "items": {
              "$ref": "#/components/schemas/PrattleSchema"
            },
            "type": "array",
            "title": "Prattles",
            "description": "The prattles of the user."
          }
        },
        "type": "object",
        "required": [
          "prattles"
        ],
        "title": "GetPrattlesResponse"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "MentionSchema": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "The document id of the mention."
          },
          "prattle_id": {
            "type": "string",
            "title": "Prattle Id",
            "description": "The root prattle id."
          },
          "mention_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mention Id",
            "description": "The target mention id."
          },
          "content": {
            "type": "string",
            "title": "Content",
            "description": "The content of the mention."
          },
          "created_at": {
            "type": "integer",
            "title": "Created At",
            "description": "The time the mention was created. Epoch time."
          }
        },
        "type": "object",
        "required": [
          "id",
          "prattle_id",
          "mention_id",
          "content",
          "created_at"
        ],
        "title": "MentionSchema"
      },
      "PostMentionRequest": {
        "properties": {
          "content": {
            "type": "string",
            "title": "Content",
            "description": "The content of the mention."
          }
        },
        "type": "object",
        "required": [
          "content"
        ],
        "title": "PostMentionRequest"
      },
      "PostPrattleRequest": {
        "properties": {
          "content": {
            "type": "string",
            "minLength": 10,
            "title": "Content",
            "description": "The content of the prattle. longer than 10 characters"
          }
        },
        "type": "object",
        "required": [
          "content"
        ],
        "title": "PostPrattleRequest"
      },
      "PostPrattleResponse": {
        "properties": {
          "mentions": {
            "items": {
              "$ref": "#/components/schemas/MentionSchema"
            },
            "type": "array",
            "title": "Mentions",
            "description": "The mentions of the user.",
            "default": []
          },
          "status": {
            "type": "string",
            "enum": [
              "success",
              "error"
            ],
            "title": "Status",
            "description": "The status of the request."
          }
        },
        "type": "object",
        "required": [
          "status"
        ],
        "title": "PostPrattleResponse"
      },
      "PrattleSchema": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "The document id of the prattle."
          },
          "content": {
            "type": "string",
            "title": "Content",
            "description": "The content of the prattle."
          }
        },
        "type": "object",
        "required": [
          "id",
          "content"
        ],
        "title": "PrattleSchema"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      }
    },
    "securitySchemes": {
      "Google OAuth2": {
        "type": "oauth2",
        "flows": {
          "authorizationCode": {
            "scopes": {},
            "authorizationUrl": "https://accounts.google.com/o/oauth2/auth",
            "tokenUrl": "https://oauth2.googleapis.com/token"
          }
        }
      }
    }
  }
}