55from pydantic import ValidationError
66import logging
77
8+ from flasgger import swag_from
89github_bp = Blueprint ("github" , __name__ )
910logger = logging .getLogger (__name__ )
1011
1112@github_bp .route ("/auth/github" )
13+ @swag_from ("../specs/github/auth_github_specs.yml" )
1214def github_login_route ():
1315 try :
1416 auth_url = github_login ()
@@ -18,6 +20,7 @@ def github_login_route():
1820 return jsonify (GithubErrorResponse (error = str (e )).dict ()), 400
1921
2022@github_bp .route ("/auth/github/callback" )
23+ @swag_from ("../specs/github/auth_github_callback_specs.yml" )
2124def github_callback_route ():
2225 try :
2326 code = request .args .get ("code" )
@@ -32,6 +35,7 @@ def github_callback_route():
3235
3336@github_bp .route ("/github/repos" , methods = ["GET" ])
3437@jwt_required ()
38+ @swag_from ("../specs/github/github_repos_specs.yml" )
3539def get_github_repos_route ():
3640 try :
3741 user_id = get_jwt_identity ()
@@ -46,6 +50,7 @@ def get_github_repos_route():
4650
4751@github_bp .route ("/github/validate-token" , methods = ["POST" ])
4852@jwt_required ()
53+ @swag_from ("../specs/github/github_validate_token_specs.yml" )
4954def validate_github_token_route ():
5055 try :
5156 user_id = get_jwt_identity ()
@@ -64,6 +69,7 @@ def validate_github_token_route():
6469
6570@github_bp .route ("/github/save-repos" , methods = ["POST" ])
6671@jwt_required ()
72+ @swag_from ("../specs/github/github_save_repos_specs.yml" )
6773def save_selected_repos_route ():
6874 try :
6975 user_id = get_jwt_identity ()
@@ -88,6 +94,7 @@ def save_selected_repos_route():
8894
8995@github_bp .route ("/github/repo-configs" , methods = ["GET" ])
9096@jwt_required ()
97+ @swag_from ("../specs/github/github_repo_configs_specs.yml" )
9198def get_repo_configs_route ():
9299 try :
93100 user_id = get_jwt_identity ()
0 commit comments