Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Raajheer1 committed Apr 4, 2024
1 parent bbdee21 commit 3b5f290
Show file tree
Hide file tree
Showing 5 changed files with 183 additions and 30 deletions.
77 changes: 68 additions & 9 deletions internal/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -3846,6 +3846,37 @@ const docTemplate = `{
}
}
},
"constants.ATCRating": {
"type": "integer",
"enum": [
-1,
0,
1,
2,
3,
4,
5,
7,
8,
10,
11,
12
],
"x-enum-varnames": [
"InactiveRating",
"SuspendedRating",
"ObserverRating",
"Student1Rating",
"Student2Rating",
"Student3Rating",
"ControllerRating",
"SeniorControllerRating",
"InstructorRating",
"SeniorInstructorRating",
"SupervisorRating",
"AdministratorRating"
]
},
"constants.FacilityID": {
"type": "string",
"enum": [
Expand Down Expand Up @@ -4351,7 +4382,11 @@ const docTemplate = `{
"example": 1293257
},
"controller_rating": {
"type": "integer",
"allOf": [
{
"$ref": "#/definitions/constants.ATCRating"
}
],
"example": 1
},
"created_at": {
Expand Down Expand Up @@ -4641,11 +4676,19 @@ const docTemplate = `{
"example": "1293257"
},
"new_rating": {
"type": "integer",
"allOf": [
{
"$ref": "#/definitions/constants.ATCRating"
}
],
"example": 2
},
"old_rating": {
"type": "integer",
"allOf": [
{
"$ref": "#/definitions/constants.ATCRating"
}
],
"example": 1
}
}
Expand All @@ -4670,11 +4713,19 @@ const docTemplate = `{
"example": 1
},
"new_rating": {
"type": "integer",
"allOf": [
{
"$ref": "#/definitions/constants.ATCRating"
}
],
"example": 2
},
"old_rating": {
"type": "integer",
"allOf": [
{
"$ref": "#/definitions/constants.ATCRating"
}
],
"example": 1
},
"updated_at": {
Expand Down Expand Up @@ -4926,7 +4977,11 @@ const docTemplate = `{
"example": 1293257
},
"controller_rating": {
"type": "integer",
"allOf": [
{
"$ref": "#/definitions/constants.ATCRating"
}
],
"example": 1
},
"discord_id": {
Expand Down Expand Up @@ -4971,7 +5026,11 @@ const docTemplate = `{
"example": 1293257
},
"controller_rating": {
"type": "integer",
"allOf": [
{
"$ref": "#/definitions/constants.ATCRating"
}
],
"example": 1
},
"created_at": {
Expand Down Expand Up @@ -5205,9 +5264,9 @@ const docTemplate = `{
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "0.1",
Host: "api.vatusa.local",
Host: "api.vatusa.dev",
BasePath: "/internal/v1",
Schemes: []string{"http"},
Schemes: []string{"https"},
Title: "VATUSA Internal",
Description: "VATUSAs internal API for use by other internal VATUSA services.",
InfoInstanceName: "swagger",
Expand Down
77 changes: 68 additions & 9 deletions internal/docs/swagger.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"schemes": [
"http"
"https"
],
"swagger": "2.0",
"info": {
Expand All @@ -18,7 +18,7 @@
},
"version": "0.1"
},
"host": "api.vatusa.local",
"host": "api.vatusa.dev",
"basePath": "/internal/v1",
"paths": {
"/documents": {
Expand Down Expand Up @@ -3843,6 +3843,37 @@
}
}
},
"constants.ATCRating": {
"type": "integer",
"enum": [
-1,
0,
1,
2,
3,
4,
5,
7,
8,
10,
11,
12
],
"x-enum-varnames": [
"InactiveRating",
"SuspendedRating",
"ObserverRating",
"Student1Rating",
"Student2Rating",
"Student3Rating",
"ControllerRating",
"SeniorControllerRating",
"InstructorRating",
"SeniorInstructorRating",
"SupervisorRating",
"AdministratorRating"
]
},
"constants.FacilityID": {
"type": "string",
"enum": [
Expand Down Expand Up @@ -4348,7 +4379,11 @@
"example": 1293257
},
"controller_rating": {
"type": "integer",
"allOf": [
{
"$ref": "#/definitions/constants.ATCRating"
}
],
"example": 1
},
"created_at": {
Expand Down Expand Up @@ -4638,11 +4673,19 @@
"example": "1293257"
},
"new_rating": {
"type": "integer",
"allOf": [
{
"$ref": "#/definitions/constants.ATCRating"
}
],
"example": 2
},
"old_rating": {
"type": "integer",
"allOf": [
{
"$ref": "#/definitions/constants.ATCRating"
}
],
"example": 1
}
}
Expand All @@ -4667,11 +4710,19 @@
"example": 1
},
"new_rating": {
"type": "integer",
"allOf": [
{
"$ref": "#/definitions/constants.ATCRating"
}
],
"example": 2
},
"old_rating": {
"type": "integer",
"allOf": [
{
"$ref": "#/definitions/constants.ATCRating"
}
],
"example": 1
},
"updated_at": {
Expand Down Expand Up @@ -4923,7 +4974,11 @@
"example": 1293257
},
"controller_rating": {
"type": "integer",
"allOf": [
{
"$ref": "#/definitions/constants.ATCRating"
}
],
"example": 1
},
"discord_id": {
Expand Down Expand Up @@ -4968,7 +5023,11 @@
"example": 1293257
},
"controller_rating": {
"type": "integer",
"allOf": [
{
"$ref": "#/definitions/constants.ATCRating"
}
],
"example": 1
},
"created_at": {
Expand Down
53 changes: 44 additions & 9 deletions internal/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,34 @@ definitions:
example: '''1234567'' or ''System'''
type: string
type: object
constants.ATCRating:
enum:
- -1
- 0
- 1
- 2
- 3
- 4
- 5
- 7
- 8
- 10
- 11
- 12
type: integer
x-enum-varnames:
- InactiveRating
- SuspendedRating
- ObserverRating
- Student1Rating
- Student2Rating
- Student3Rating
- ControllerRating
- SeniorControllerRating
- InstructorRating
- SeniorInstructorRating
- SupervisorRating
- AdministratorRating
constants.FacilityID:
enum:
- ZAE
Expand Down Expand Up @@ -418,8 +446,9 @@ definitions:
example: 1293257
type: integer
controller_rating:
allOf:
- $ref: '#/definitions/constants.ATCRating'
example: 1
type: integer
created_at:
example: "2021-01-01T00:00:00Z"
type: string
Expand Down Expand Up @@ -625,11 +654,13 @@ definitions:
example: "1293257"
type: string
new_rating:
allOf:
- $ref: '#/definitions/constants.ATCRating'
example: 2
type: integer
old_rating:
allOf:
- $ref: '#/definitions/constants.ATCRating'
example: 1
type: integer
required:
- created_by_cid
- new_rating
Expand All @@ -650,11 +681,13 @@ definitions:
example: 1
type: integer
new_rating:
allOf:
- $ref: '#/definitions/constants.ATCRating'
example: 2
type: integer
old_rating:
allOf:
- $ref: '#/definitions/constants.ATCRating'
example: 1
type: integer
updated_at:
example: "2021-01-01T00:00:00Z"
type: string
Expand Down Expand Up @@ -832,8 +865,9 @@ definitions:
example: 1293257
type: integer
controller_rating:
allOf:
- $ref: '#/definitions/constants.ATCRating'
example: 1
type: integer
discord_id:
example: "1234567890"
type: string
Expand Down Expand Up @@ -872,8 +906,9 @@ definitions:
example: 1293257
type: integer
controller_rating:
allOf:
- $ref: '#/definitions/constants.ATCRating'
example: 1
type: integer
created_at:
example: "2021-01-01T00:00:00Z"
type: string
Expand Down Expand Up @@ -1030,7 +1065,7 @@ definitions:
description: user-level status message
type: string
type: object
host: api.vatusa.local
host: api.vatusa.dev
info:
contact:
email: vatusa6@vatusa.net
Expand Down Expand Up @@ -3554,5 +3589,5 @@ paths:
tags:
- user-flag
schemes:
- http
- https
swagger: "2.0"
4 changes: 2 additions & 2 deletions internal/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
// @license.name Apache 2.0
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html

// @host api.vatusa.local
// @host api.vatusa.dev
// @BasePath /internal/v1
// @schemes http
// @schemes https

func Router(r chi.Router, cfg *config.Config) {
r.Route("/internal", func(r chi.Router) {
Expand Down
Loading

0 comments on commit 3b5f290

Please sign in to comment.