openapi: 3.0.3 info: title: {{.Project}} API version: 0.1.0 description: >- An explicit OpenAPI contract generated by gin-kit. Endpoints that accept a body reply 422 with the ErrorEnvelope schema (code validation_failed and per-field details) when validation fails. servers: - url: http://localhost:8080 paths: /api/v1/ping: get: summary: Check API availability responses: "200": description: The API is available content: application/json: schema: type: object properties: data: type: object {{if .OAuth}} /auth/oauth/{provider}: get: summary: Start OAuth sign-in parameters: - in: path name: provider required: true schema: type: string enum: [google, github] responses: "302": description: Redirect to the selected OAuth provider or the configured failure path /auth/oauth/{provider}/callback: get: summary: Complete OAuth sign-in parameters: - in: path name: provider required: true schema: type: string enum: [google, github] responses: "302": description: Redirect to the configured success or failure path /api/v1/auth/csrf: get: summary: Issue a CSRF token for cookie-authenticated API requests responses: "204": description: Token is returned in the X-CSRF-Token response header headers: X-CSRF-Token: schema: type: string {{end}}{{if .Auth}} /api/v1/auth/tokens: get: summary: List personal API tokens security: - bearerAuth: [] responses: "200": description: Tokens owned by the authenticated user post: summary: Create a personal API token security: - bearerAuth: [] responses: "201": description: Token created; plaintext is returned once /api/v1/auth/tokens/{id}: delete: summary: Revoke a personal API token security: - bearerAuth: [] parameters: - in: path name: id required: true schema: type: string responses: "204": description: Token revoked {{end}} components: {{if .Auth}} securitySchemes: bearerAuth: type: http scheme: bearer {{end}} schemas: ErrorEnvelope: type: object properties: error: type: object properties: code: type: string message: type: string details: type: object request_id: type: string