Web App Creator

Web App Creator · GPT Actions

For.io API

For.io API

  • POST /applicationscreateOrUpdateApplication

    Creates or updates an application from a given database schema as input.

原始 API 定义
{
  "openapi": "3.0.3",
  "info": {
    "title": "For.io API",
    "description": "For.io API",
    "termsOfService": "https://for.io/legal/tos",
    "contact": {
      "name": "For.io Contact",
      "url": "https://for.io/",
      "email": "contact@for.io"
    },
    "version": "1.0.1"
  },
  "servers": [
    {
      "url": "https://for.io"
    }
  ],
  "paths": {
    "/applications": {
      "post": {
        "operationId": "createOrUpdateApplication",
        "description": "Creates or updates an application from a given database schema as input.",
        "x-openai-isConsequential": false,
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DatabaseSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResultInfo"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "DatabaseSchema": {
        "type": "object",
        "properties": {
          "app_name": {
            "type": "string",
            "description": "the name of the application that will be created"
          },
          "tables": {
            "type": "array",
            "description": "a list of database tables, preferably max. 3 tables",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "columns": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "foreign_keys": {
            "type": "array",
            "description": "a list of foreign keys in the database",
            "items": {
              "$ref": "#/components/schemas/ForeignKey"
            }
          }
        }
      },
      "ForeignKey": {
        "type": "object",
        "properties": {
          "table": {
            "type": "string"
          },
          "columns": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "ref_table": {
            "type": "string"
          },
          "ref_columns": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ResultInfo": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "the URL of the newly created application"
          }
        }
      }
    }
  }
}