-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from vitorAzevedo09/add-swagger-documentation
Add swagger documentation
- Loading branch information
Showing
8 changed files
with
529 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
// Package docs Code generated by swaggo/swag. DO NOT EDIT | ||
package docs | ||
|
||
import "github.com/swaggo/swag" | ||
|
||
const docTemplate = `{ | ||
"schemes": {{ marshal .Schemes }}, | ||
"swagger": "2.0", | ||
"info": { | ||
"description": "{{escape .Description}}", | ||
"title": "{{.Title}}", | ||
"contact": {}, | ||
"version": "{{.Version}}" | ||
}, | ||
"host": "{{.Host}}", | ||
"basePath": "{{.BasePath}}", | ||
"paths": { | ||
"/event-handler": { | ||
"post": { | ||
"description": "Handles event creation, guest addition, email sending, and redirects to Google Meet link.", | ||
"consumes": [ | ||
"application/json" | ||
], | ||
"produces": [ | ||
"application/json" | ||
], | ||
"summary": "Handle event creation and interaction", | ||
"parameters": [ | ||
{ | ||
"type": "string", | ||
"description": "Name of the student", | ||
"name": "name", | ||
"in": "formData", | ||
"required": true | ||
}, | ||
{ | ||
"type": "string", | ||
"description": "Email of the student", | ||
"name": "email", | ||
"in": "formData", | ||
"required": true | ||
}, | ||
{ | ||
"type": "string", | ||
"description": "Phone number of the student", | ||
"name": "phone", | ||
"in": "formData", | ||
"required": true | ||
} | ||
], | ||
"responses": { | ||
"303": { | ||
"description": "Redirects to Google Meet link", | ||
"schema": { | ||
"type": "string" | ||
} | ||
}, | ||
"400": { | ||
"description": "No Google Meet link available or other errors", | ||
"schema": { | ||
"$ref": "#/definitions/handlers.ErrorResponse" | ||
} | ||
}, | ||
"500": { | ||
"description": "Internal server error", | ||
"schema": { | ||
"$ref": "#/definitions/handlers.ErrorResponse" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/form": { | ||
"get": { | ||
"description": "Renders the form.html page to display user information form.", | ||
"produces": [ | ||
"text/html" | ||
], | ||
"summary": "Render form page", | ||
"responses": { | ||
"200": { | ||
"description": "HTML content of the form page", | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/oauth/callback": { | ||
"get": { | ||
"description": "Exchange code for token and save it", | ||
"consumes": [ | ||
"application/json" | ||
], | ||
"produces": [ | ||
"application/json" | ||
], | ||
"summary": "Handle OAuth2 callback", | ||
"parameters": [ | ||
{ | ||
"type": "string", | ||
"description": "State token", | ||
"name": "state", | ||
"in": "query", | ||
"required": true | ||
}, | ||
{ | ||
"type": "string", | ||
"description": "Authorization code", | ||
"name": "code", | ||
"in": "query", | ||
"required": true | ||
} | ||
], | ||
"responses": { | ||
"303": { | ||
"description": "Redirects to /" | ||
}, | ||
"400": { | ||
"description": "State token doesn't match", | ||
"schema": { | ||
"$ref": "#/definitions/handlers.ErrorResponse" | ||
} | ||
}, | ||
"500": { | ||
"description": "Unable to retrieve or save token", | ||
"schema": { | ||
"$ref": "#/definitions/handlers.ErrorResponse" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"definitions": { | ||
"handlers.ErrorResponse": { | ||
"type": "object", | ||
"properties": { | ||
"error": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
}` | ||
|
||
// SwaggerInfo holds exported Swagger Info so clients can modify it | ||
var SwaggerInfo = &swag.Spec{ | ||
Version: "", | ||
Host: "", | ||
BasePath: "", | ||
Schemes: []string{}, | ||
Title: "", | ||
Description: "", | ||
InfoInstanceName: "swagger", | ||
SwaggerTemplate: docTemplate, | ||
LeftDelim: "{{", | ||
RightDelim: "}}", | ||
} | ||
|
||
func init() { | ||
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
{ | ||
"swagger": "2.0", | ||
"info": { | ||
"contact": {} | ||
}, | ||
"paths": { | ||
"/event-handler": { | ||
"post": { | ||
"description": "Handles event creation, guest addition, email sending, and redirects to Google Meet link.", | ||
"consumes": [ | ||
"application/json" | ||
], | ||
"produces": [ | ||
"application/json" | ||
], | ||
"summary": "Handle event creation and interaction", | ||
"parameters": [ | ||
{ | ||
"type": "string", | ||
"description": "Name of the student", | ||
"name": "name", | ||
"in": "formData", | ||
"required": true | ||
}, | ||
{ | ||
"type": "string", | ||
"description": "Email of the student", | ||
"name": "email", | ||
"in": "formData", | ||
"required": true | ||
}, | ||
{ | ||
"type": "string", | ||
"description": "Phone number of the student", | ||
"name": "phone", | ||
"in": "formData", | ||
"required": true | ||
} | ||
], | ||
"responses": { | ||
"303": { | ||
"description": "Redirects to Google Meet link", | ||
"schema": { | ||
"type": "string" | ||
} | ||
}, | ||
"400": { | ||
"description": "No Google Meet link available or other errors", | ||
"schema": { | ||
"$ref": "#/definitions/handlers.ErrorResponse" | ||
} | ||
}, | ||
"500": { | ||
"description": "Internal server error", | ||
"schema": { | ||
"$ref": "#/definitions/handlers.ErrorResponse" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/form": { | ||
"get": { | ||
"description": "Renders the form.html page to display user information form.", | ||
"produces": [ | ||
"text/html" | ||
], | ||
"summary": "Render form page", | ||
"responses": { | ||
"200": { | ||
"description": "HTML content of the form page", | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/oauth/callback": { | ||
"get": { | ||
"description": "Exchange code for token and save it", | ||
"consumes": [ | ||
"application/json" | ||
], | ||
"produces": [ | ||
"application/json" | ||
], | ||
"summary": "Handle OAuth2 callback", | ||
"parameters": [ | ||
{ | ||
"type": "string", | ||
"description": "State token", | ||
"name": "state", | ||
"in": "query", | ||
"required": true | ||
}, | ||
{ | ||
"type": "string", | ||
"description": "Authorization code", | ||
"name": "code", | ||
"in": "query", | ||
"required": true | ||
} | ||
], | ||
"responses": { | ||
"303": { | ||
"description": "Redirects to /" | ||
}, | ||
"400": { | ||
"description": "State token doesn't match", | ||
"schema": { | ||
"$ref": "#/definitions/handlers.ErrorResponse" | ||
} | ||
}, | ||
"500": { | ||
"description": "Unable to retrieve or save token", | ||
"schema": { | ||
"$ref": "#/definitions/handlers.ErrorResponse" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"definitions": { | ||
"handlers.ErrorResponse": { | ||
"type": "object", | ||
"properties": { | ||
"error": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.