[BRANDING] Replace branding in Swagger
- "Gitea" is automatically being determined in Swagger and cannot be overridden, therefor we override it after `swagger generate spec` is run. - Resolves https://codeberg.org/forgejo/forgejo/issues/226 (cherry picked from commit0b45380765
) [BRANDING] Change Swagger title to Forgejo API (cherry picked from commit79f6a70b53
) (cherry picked from commit6cd47afe33
) (cherry picked from commita7ae2e4c09
) (cherry picked from commit59f837e466
) (cherry picked from commitc1c3d1f0e6
) (cherry picked from commit4b088713fb
) (cherry picked from commit3df1d21371
) (cherry picked from commita4a5fdbde4
) (cherry picked from commit57aa9ed710
) (cherry picked from commit948b49bf94
) (cherry picked from commitbe4929ab6a
) (cherry picked from commit9ecb507457
) Conflicts: templates/swagger/ui.tmpl (cherry picked from commit8e57e68863
) (cherry picked from commitf0b3f621e3
) (cherry picked from commit5b0a6d093e
) (cherry picked from commit2e0f6b5de8
) (cherry picked from commitbb08076f5c
) (cherry picked from commit5c9360e38a
) (cherry picked from commit2f27756148
) (cherry picked from commit6fce7eeb51
) (cherry picked from commit8d27e7bebd
) (cherry picked from commitfda2ee2aae
) (cherry picked from commitfe0489a4d8
) (cherry picked from commitfe9479b357
) (cherry picked from commit1deadb2f35
) (cherry picked from commitd1cb84b2f2
) (cherry picked from commit9de15d49f8
) (cherry picked from commit461fbe219c
) (cherry picked from commitf39bf3ba5b
)
This commit is contained in:
parent
a92f044ea9
commit
b3f31c2f7b
3 changed files with 5 additions and 3 deletions
2
Makefile
2
Makefile
|
@ -150,6 +150,7 @@ SWAGGER_SPEC_S_TMPL := s|"basePath": *"/api/v1"|"basePath": "{{AppSubUrl \| JSEs
|
||||||
SWAGGER_SPEC_S_JSON := s|"basePath": *"{{AppSubUrl \| JSEscape \| Safe}}/api/v1"|"basePath": "/api/v1"|g
|
SWAGGER_SPEC_S_JSON := s|"basePath": *"{{AppSubUrl \| JSEscape \| Safe}}/api/v1"|"basePath": "/api/v1"|g
|
||||||
SWAGGER_EXCLUDE := code.gitea.io/sdk
|
SWAGGER_EXCLUDE := code.gitea.io/sdk
|
||||||
SWAGGER_NEWLINE_COMMAND := -e '$$a\'
|
SWAGGER_NEWLINE_COMMAND := -e '$$a\'
|
||||||
|
SWAGGER_SPEC_BRANDING := s|Gitea API|Forgejo API|g
|
||||||
|
|
||||||
TEST_MYSQL_HOST ?= mysql:3306
|
TEST_MYSQL_HOST ?= mysql:3306
|
||||||
TEST_MYSQL_DBNAME ?= testgitea
|
TEST_MYSQL_DBNAME ?= testgitea
|
||||||
|
@ -339,6 +340,7 @@ $(SWAGGER_SPEC): $(GO_SOURCES_NO_BINDATA)
|
||||||
$(GO) run $(SWAGGER_PACKAGE) generate spec -x "$(SWAGGER_EXCLUDE)" -o './$(SWAGGER_SPEC)'
|
$(GO) run $(SWAGGER_PACKAGE) generate spec -x "$(SWAGGER_EXCLUDE)" -o './$(SWAGGER_SPEC)'
|
||||||
$(SED_INPLACE) '$(SWAGGER_SPEC_S_TMPL)' './$(SWAGGER_SPEC)'
|
$(SED_INPLACE) '$(SWAGGER_SPEC_S_TMPL)' './$(SWAGGER_SPEC)'
|
||||||
$(SED_INPLACE) $(SWAGGER_NEWLINE_COMMAND) './$(SWAGGER_SPEC)'
|
$(SED_INPLACE) $(SWAGGER_NEWLINE_COMMAND) './$(SWAGGER_SPEC)'
|
||||||
|
$(SED_INPLACE) '$(SWAGGER_SPEC_BRANDING)' './$(SWAGGER_SPEC)'
|
||||||
|
|
||||||
.PHONY: swagger-check
|
.PHONY: swagger-check
|
||||||
swagger-check: generate-swagger
|
swagger-check: generate-swagger
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>Gitea API</title>
|
<title>Forgejo API</title>
|
||||||
<link href="{{AssetUrlPrefix}}/css/swagger.css?v={{AssetVersion}}" rel="stylesheet">
|
<link href="{{AssetUrlPrefix}}/css/swagger.css?v={{AssetVersion}}" rel="stylesheet">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
4
templates/swagger/v1_json.tmpl
generated
4
templates/swagger/v1_json.tmpl
generated
|
@ -13,8 +13,8 @@
|
||||||
],
|
],
|
||||||
"swagger": "2.0",
|
"swagger": "2.0",
|
||||||
"info": {
|
"info": {
|
||||||
"description": "This documentation describes the Gitea API.",
|
"description": "This documentation describes the Forgejo API.",
|
||||||
"title": "Gitea API.",
|
"title": "Forgejo API.",
|
||||||
"license": {
|
"license": {
|
||||||
"name": "MIT",
|
"name": "MIT",
|
||||||
"url": "http://opensource.org/licenses/MIT"
|
"url": "http://opensource.org/licenses/MIT"
|
||||||
|
|
Loading…
Reference in a new issue