Files
go-omni/examples/userService/internal/handler/openapiGen.go

14 lines
61 KiB
Go

// Code generated by go-omni api. DO NOT EDIT.
package handler
import (
"git.yuntuo.hk/k2safe/go-omni/httpx"
"net/http"
)
const OpenAPIDocument = "{\n \"components\": {\n \"securitySchemes\": {\n \"AdminAuth\": {\n \"description\": \"Use an administrator token for writes, or a read-only token for GET requests\",\n \"scheme\": \"bearer\",\n \"type\": \"http\"\n }\n }\n },\n \"info\": {\n \"title\": \"User service reference\",\n \"version\": \"1.0.0\"\n },\n \"openapi\": \"3.0.3\",\n \"paths\": {\n \"/api/v1/users\": {\n \"get\": {\n \"operationId\": \"user_ListUsers\",\n \"parameters\": [\n {\n \"in\": \"query\",\n \"name\": \"page\",\n \"required\": false,\n \"schema\": {\n \"default\": 1,\n \"format\": \"int64\",\n \"maximum\": 1000000,\n \"minimum\": 1,\n \"type\": \"integer\"\n }\n },\n {\n \"in\": \"query\",\n \"name\": \"pageSize\",\n \"required\": false,\n \"schema\": {\n \"default\": 20,\n \"format\": \"int64\",\n \"maximum\": 100,\n \"minimum\": 1,\n \"type\": \"integer\"\n }\n }\n ],\n \"responses\": {\n \"200\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"data\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"items\": {\n \"items\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"createdAt\": {\n \"type\": \"string\"\n },\n \"email\": {\n \"type\": \"string\"\n },\n \"id\": {\n \"format\": \"int64\",\n \"type\": \"integer\"\n },\n \"name\": {\n \"type\": \"string\"\n },\n \"updatedAt\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"id\",\n \"name\",\n \"email\",\n \"createdAt\",\n \"updatedAt\"\n ],\n \"type\": \"object\"\n },\n \"type\": \"array\"\n },\n \"page\": {\n \"format\": \"int64\",\n \"type\": \"integer\"\n },\n \"pageSize\": {\n \"format\": \"int64\",\n \"type\": \"integer\"\n },\n \"total\": {\n \"format\": \"int64\",\n \"type\": \"integer\"\n }\n },\n \"required\": [\n \"items\",\n \"total\",\n \"page\",\n \"pageSize\"\n ],\n \"type\": \"object\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\",\n \"data\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"Success\"\n },\n \"400\": {\n \"content\": {\n \"application/json\": {\n \"examples\": {\n \"InvalidPage\": {\n \"summary\": \"invalid pagination\",\n \"value\": {\n \"code\": \"INVALID_PAGE\",\n \"message\": \"invalid pagination\",\n \"requestId\": \"exampleRequest\"\n }\n }\n },\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"INVALID_PAGE: invalid pagination\"\n },\n \"401\": {\n \"content\": {\n \"application/json\": {\n \"examples\": {\n \"Unauthenticated\": {\n \"summary\": \"authentication required\",\n \"value\": {\n \"code\": \"UNAUTHENTICATED\",\n \"message\": \"authentication required\",\n \"requestId\": \"exampleRequest\"\n }\n }\n },\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"UNAUTHENTICATED: authentication required\"\n },\n \"413\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"Error\"\n },\n \"415\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"Error\"\n },\n \"500\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"Error\"\n },\n \"501\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"Error\"\n }\n },\n \"security\": [\n {\n \"AdminAuth\": []\n }\n ],\n \"summary\": \"\",\n \"tags\": [\n \"user\"\n ],\n \"x-omni-errors\": [\n \"Unauthenticated\",\n \"InvalidPage\"\n ],\n \"x-omni-middleware\": [\n \"Auth\"\n ]\n },\n \"post\": {\n \"description\": \"Normalizes the email, then commits user data and audit in one transaction\",\n \"operationId\": \"user_CreateUser\",\n \"requestBody\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"email\": {\n \"format\": \"email\",\n \"maxLength\": 254,\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"name\": {\n \"maxLength\": 100,\n \"minLength\": 1,\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"name\",\n \"email\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"required\": true\n },\n \"responses\": {\n \"201\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"data\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"createdAt\": {\n \"type\": \"string\"\n },\n \"email\": {\n \"type\": \"string\"\n },\n \"id\": {\n \"format\": \"int64\",\n \"type\": \"integer\"\n },\n \"name\": {\n \"type\": \"string\"\n },\n \"updatedAt\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"id\",\n \"name\",\n \"email\",\n \"createdAt\",\n \"updatedAt\"\n ],\n \"type\": \"object\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\",\n \"data\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"Success\"\n },\n \"400\": {\n \"content\": {\n \"application/json\": {\n \"examples\": {\n \"InvalidUser\": {\n \"summary\": \"invalid user\",\n \"value\": {\n \"code\": \"INVALID_USER\",\n \"message\": \"invalid user\",\n \"requestId\": \"exampleRequest\"\n }\n }\n },\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"INVALID_USER: invalid user\"\n },\n \"401\": {\n \"content\": {\n \"application/json\": {\n \"examples\": {\n \"Unauthenticated\": {\n \"summary\": \"authentication required\",\n \"value\": {\n \"code\": \"UNAUTHENTICATED\",\n \"message\": \"authentication required\",\n \"requestId\": \"exampleRequest\"\n }\n }\n },\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"UNAUTHENTICATED: authentication required\"\n },\n \"403\": {\n \"content\": {\n \"application/json\": {\n \"examples\": {\n \"Forbidden\": {\n \"summary\": \"permission denied\",\n \"value\": {\n \"code\": \"FORBIDDEN\",\n \"message\": \"permission denied\",\n \"requestId\": \"exampleRequest\"\n }\n }\n },\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"enum\": [\n \"FORBIDDEN\"\n ],\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"FORBIDDEN: permission denied\"\n },\n \"409\": {\n \"content\": {\n \"application/json\": {\n \"examples\": {\n \"EmailTaken\": {\n \"summary\": \"email already in use\",\n \"value\": {\n \"code\": \"EMAIL_TAKEN\",\n \"message\": \"email already in use\",\n \"requestId\": \"exampleRequest\"\n }\n }\n },\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"enum\": [\n \"EMAIL_TAKEN\"\n ],\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"EMAIL_TAKEN: email already in use\"\n },\n \"413\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"Error\"\n },\n \"415\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"Error\"\n },\n \"500\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"Error\"\n },\n \"501\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"Error\"\n }\n },\n \"security\": [\n {\n \"AdminAuth\": []\n }\n ],\n \"summary\": \"Create a user\",\n \"tags\": [\n \"users\"\n ],\n \"x-omni-errors\": [\n \"Unauthenticated\",\n \"Forbidden\",\n \"InvalidUser\",\n \"EmailTaken\"\n ],\n \"x-omni-middleware\": [\n \"Auth\"\n ]\n }\n },\n \"/api/v1/users/{id}\": {\n \"delete\": {\n \"operationId\": \"user_DeleteUser\",\n \"parameters\": [\n {\n \"in\": \"path\",\n \"name\": \"id\",\n \"required\": true,\n \"schema\": {\n \"format\": \"int64\",\n \"maximum\": 9007199254740991,\n \"minimum\": 1,\n \"type\": \"integer\"\n }\n }\n ],\n \"responses\": {\n \"204\": {\n \"description\": \"Success\"\n },\n \"400\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"Error\"\n },\n \"401\": {\n \"content\": {\n \"application/json\": {\n \"examples\": {\n \"Unauthenticated\": {\n \"summary\": \"authentication required\",\n \"value\": {\n \"code\": \"UNAUTHENTICATED\",\n \"message\": \"authentication required\",\n \"requestId\": \"exampleRequest\"\n }\n }\n },\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"UNAUTHENTICATED: authentication required\"\n },\n \"403\": {\n \"content\": {\n \"application/json\": {\n \"examples\": {\n \"Forbidden\": {\n \"summary\": \"permission denied\",\n \"value\": {\n \"code\": \"FORBIDDEN\",\n \"message\": \"permission denied\",\n \"requestId\": \"exampleRequest\"\n }\n }\n },\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"enum\": [\n \"FORBIDDEN\"\n ],\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"FORBIDDEN: permission denied\"\n },\n \"404\": {\n \"content\": {\n \"application/json\": {\n \"examples\": {\n \"UserNotFound\": {\n \"summary\": \"user not found\",\n \"value\": {\n \"code\": \"USER_NOT_FOUND\",\n \"message\": \"user not found\",\n \"requestId\": \"exampleRequest\"\n }\n }\n },\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"enum\": [\n \"USER_NOT_FOUND\"\n ],\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"USER_NOT_FOUND: user not found\"\n },\n \"413\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"Error\"\n },\n \"415\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"Error\"\n },\n \"500\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"Error\"\n },\n \"501\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"Error\"\n }\n },\n \"security\": [\n {\n \"AdminAuth\": []\n }\n ],\n \"summary\": \"\",\n \"tags\": [\n \"user\"\n ],\n \"x-omni-errors\": [\n \"Unauthenticated\",\n \"Forbidden\",\n \"UserNotFound\"\n ],\n \"x-omni-middleware\": [\n \"Auth\"\n ]\n },\n \"get\": {\n \"operationId\": \"user_GetUser\",\n \"parameters\": [\n {\n \"in\": \"path\",\n \"name\": \"id\",\n \"required\": true,\n \"schema\": {\n \"format\": \"int64\",\n \"maximum\": 9007199254740991,\n \"minimum\": 1,\n \"type\": \"integer\"\n }\n }\n ],\n \"responses\": {\n \"200\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"data\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"createdAt\": {\n \"type\": \"string\"\n },\n \"email\": {\n \"type\": \"string\"\n },\n \"id\": {\n \"format\": \"int64\",\n \"type\": \"integer\"\n },\n \"name\": {\n \"type\": \"string\"\n },\n \"updatedAt\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"id\",\n \"name\",\n \"email\",\n \"createdAt\",\n \"updatedAt\"\n ],\n \"type\": \"object\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\",\n \"data\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"Success\"\n },\n \"400\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"Error\"\n },\n \"401\": {\n \"content\": {\n \"application/json\": {\n \"examples\": {\n \"Unauthenticated\": {\n \"summary\": \"authentication required\",\n \"value\": {\n \"code\": \"UNAUTHENTICATED\",\n \"message\": \"authentication required\",\n \"requestId\": \"exampleRequest\"\n }\n }\n },\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"UNAUTHENTICATED: authentication required\"\n },\n \"404\": {\n \"content\": {\n \"application/json\": {\n \"examples\": {\n \"UserNotFound\": {\n \"summary\": \"user not found\",\n \"value\": {\n \"code\": \"USER_NOT_FOUND\",\n \"message\": \"user not found\",\n \"requestId\": \"exampleRequest\"\n }\n }\n },\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"enum\": [\n \"USER_NOT_FOUND\"\n ],\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"USER_NOT_FOUND: user not found\"\n },\n \"413\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"Error\"\n },\n \"415\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"Error\"\n },\n \"500\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"Error\"\n },\n \"501\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"Error\"\n }\n },\n \"security\": [\n {\n \"AdminAuth\": []\n }\n ],\n \"summary\": \"\",\n \"tags\": [\n \"user\"\n ],\n \"x-omni-errors\": [\n \"Unauthenticated\",\n \"UserNotFound\"\n ],\n \"x-omni-middleware\": [\n \"Auth\"\n ]\n },\n \"put\": {\n \"operationId\": \"user_UpdateUser\",\n \"parameters\": [\n {\n \"in\": \"path\",\n \"name\": \"id\",\n \"required\": true,\n \"schema\": {\n \"format\": \"int64\",\n \"maximum\": 9007199254740991,\n \"minimum\": 1,\n \"type\": \"integer\"\n }\n }\n ],\n \"requestBody\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"email\": {\n \"format\": \"email\",\n \"maxLength\": 254,\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"name\": {\n \"maxLength\": 100,\n \"minLength\": 1,\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"name\",\n \"email\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"required\": true\n },\n \"responses\": {\n \"200\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"data\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"createdAt\": {\n \"type\": \"string\"\n },\n \"email\": {\n \"type\": \"string\"\n },\n \"id\": {\n \"format\": \"int64\",\n \"type\": \"integer\"\n },\n \"name\": {\n \"type\": \"string\"\n },\n \"updatedAt\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"id\",\n \"name\",\n \"email\",\n \"createdAt\",\n \"updatedAt\"\n ],\n \"type\": \"object\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\",\n \"data\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"Success\"\n },\n \"400\": {\n \"content\": {\n \"application/json\": {\n \"examples\": {\n \"InvalidUser\": {\n \"summary\": \"invalid user\",\n \"value\": {\n \"code\": \"INVALID_USER\",\n \"message\": \"invalid user\",\n \"requestId\": \"exampleRequest\"\n }\n }\n },\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"INVALID_USER: invalid user\"\n },\n \"401\": {\n \"content\": {\n \"application/json\": {\n \"examples\": {\n \"Unauthenticated\": {\n \"summary\": \"authentication required\",\n \"value\": {\n \"code\": \"UNAUTHENTICATED\",\n \"message\": \"authentication required\",\n \"requestId\": \"exampleRequest\"\n }\n }\n },\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"UNAUTHENTICATED: authentication required\"\n },\n \"403\": {\n \"content\": {\n \"application/json\": {\n \"examples\": {\n \"Forbidden\": {\n \"summary\": \"permission denied\",\n \"value\": {\n \"code\": \"FORBIDDEN\",\n \"message\": \"permission denied\",\n \"requestId\": \"exampleRequest\"\n }\n }\n },\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"enum\": [\n \"FORBIDDEN\"\n ],\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"FORBIDDEN: permission denied\"\n },\n \"404\": {\n \"content\": {\n \"application/json\": {\n \"examples\": {\n \"UserNotFound\": {\n \"summary\": \"user not found\",\n \"value\": {\n \"code\": \"USER_NOT_FOUND\",\n \"message\": \"user not found\",\n \"requestId\": \"exampleRequest\"\n }\n }\n },\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"enum\": [\n \"USER_NOT_FOUND\"\n ],\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"USER_NOT_FOUND: user not found\"\n },\n \"409\": {\n \"content\": {\n \"application/json\": {\n \"examples\": {\n \"EmailTaken\": {\n \"summary\": \"email already in use\",\n \"value\": {\n \"code\": \"EMAIL_TAKEN\",\n \"message\": \"email already in use\",\n \"requestId\": \"exampleRequest\"\n }\n }\n },\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"enum\": [\n \"EMAIL_TAKEN\"\n ],\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"EMAIL_TAKEN: email already in use\"\n },\n \"413\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"Error\"\n },\n \"415\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"Error\"\n },\n \"500\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"Error\"\n },\n \"501\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"Error\"\n }\n },\n \"security\": [\n {\n \"AdminAuth\": []\n }\n ],\n \"summary\": \"\",\n \"tags\": [\n \"user\"\n ],\n \"x-omni-errors\": [\n \"Unauthenticated\",\n \"Forbidden\",\n \"InvalidUser\",\n \"UserNotFound\",\n \"EmailTaken\"\n ],\n \"x-omni-middleware\": [\n \"Auth\"\n ]\n }\n },\n \"/api/v1/users/{id}/export\": {\n \"post\": {\n \"operationId\": \"user_ExportUser\",\n \"parameters\": [\n {\n \"in\": \"path\",\n \"name\": \"id\",\n \"required\": true,\n \"schema\": {\n \"format\": \"int64\",\n \"maximum\": 9007199254740991,\n \"minimum\": 1,\n \"type\": \"integer\"\n }\n }\n ],\n \"responses\": {\n \"200\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"data\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"downloadUrl\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"downloadUrl\"\n ],\n \"type\": \"object\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\",\n \"data\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"Success\"\n },\n \"400\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"Error\"\n },\n \"401\": {\n \"content\": {\n \"application/json\": {\n \"examples\": {\n \"Unauthenticated\": {\n \"summary\": \"authentication required\",\n \"value\": {\n \"code\": \"UNAUTHENTICATED\",\n \"message\": \"authentication required\",\n \"requestId\": \"exampleRequest\"\n }\n }\n },\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"UNAUTHENTICATED: authentication required\"\n },\n \"403\": {\n \"content\": {\n \"application/json\": {\n \"examples\": {\n \"Forbidden\": {\n \"summary\": \"permission denied\",\n \"value\": {\n \"code\": \"FORBIDDEN\",\n \"message\": \"permission denied\",\n \"requestId\": \"exampleRequest\"\n }\n }\n },\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"enum\": [\n \"FORBIDDEN\"\n ],\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"FORBIDDEN: permission denied\"\n },\n \"404\": {\n \"content\": {\n \"application/json\": {\n \"examples\": {\n \"UserNotFound\": {\n \"summary\": \"user not found\",\n \"value\": {\n \"code\": \"USER_NOT_FOUND\",\n \"message\": \"user not found\",\n \"requestId\": \"exampleRequest\"\n }\n }\n },\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"enum\": [\n \"USER_NOT_FOUND\"\n ],\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"USER_NOT_FOUND: user not found\"\n },\n \"413\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"Error\"\n },\n \"415\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"Error\"\n },\n \"500\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"Error\"\n },\n \"501\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"properties\": {\n \"code\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"requestId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"code\",\n \"message\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"description\": \"Error\"\n }\n },\n \"security\": [\n {\n \"AdminAuth\": []\n }\n ],\n \"summary\": \"Export one user as a private text object with a short-lived download link\",\n \"tags\": [\n \"user\"\n ],\n \"x-omni-errors\": [\n \"Unauthenticated\",\n \"Forbidden\",\n \"UserNotFound\"\n ],\n \"x-omni-middleware\": [\n \"Auth\"\n ]\n }\n }\n },\n \"x-omni-errors\": [\n {\n \"name\": \"Unauthenticated\",\n \"status\": 401,\n \"code\": \"UNAUTHENTICATED\",\n \"message\": \"authentication required\"\n },\n {\n \"name\": \"Forbidden\",\n \"status\": 403,\n \"code\": \"FORBIDDEN\",\n \"message\": \"permission denied\"\n },\n {\n \"name\": \"UserNotFound\",\n \"status\": 404,\n \"code\": \"USER_NOT_FOUND\",\n \"message\": \"user not found\"\n },\n {\n \"name\": \"EmailTaken\",\n \"status\": 409,\n \"code\": \"EMAIL_TAKEN\",\n \"message\": \"email already in use\"\n },\n {\n \"name\": \"InvalidUser\",\n \"status\": 400,\n \"code\": \"INVALID_USER\",\n \"message\": \"invalid user\"\n },\n {\n \"name\": \"InvalidPage\",\n \"status\": 400,\n \"code\": \"INVALID_PAGE\",\n \"message\": \"invalid pagination\"\n }\n ]\n}\n"
func OpenAPI(c *httpx.Context) error {
return c.WriteResponse(200, http.Header{"Content-Type": {"application/json; charset=utf-8"}}, []byte(OpenAPIDocument))
}