mirror of
				https://codeberg.org/forgejo/forgejo.git
				synced 2025-10-31 22:41:03 +00:00 
			
		
		
		
	[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 commit9fefe3dc6a)
This commit is contained in:
		
					parent
					
						
							
								bb3048cdb2
							
						
					
				
			
			
				commit
				
					
						1e88465eed
					
				
			
		
					 3 changed files with 5 additions and 3 deletions
				
			
		
							
								
								
									
										2
									
								
								Makefile
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								Makefile
									
										
									
									
									
								
							|  | @ -159,6 +159,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_EXCLUDE := code.gitea.io/sdk | ||||
| SWAGGER_NEWLINE_COMMAND := -e '$$a\' | ||||
| SWAGGER_SPEC_BRANDING := s|Gitea API|Forgejo API|g | ||||
| 
 | ||||
| TEST_MYSQL_HOST ?= mysql:3306 | ||||
| TEST_MYSQL_DBNAME ?= testgitea | ||||
|  | @ -333,6 +334,7 @@ $(SWAGGER_SPEC): $(GO_SOURCES_NO_BINDATA) | |||
| 	$(GO) run $(SWAGGER_PACKAGE) generate spec -x "$(SWAGGER_EXCLUDE)" -o './$(SWAGGER_SPEC)' | ||||
| 	$(SED_INPLACE) '$(SWAGGER_SPEC_S_TMPL)' './$(SWAGGER_SPEC)' | ||||
| 	$(SED_INPLACE) $(SWAGGER_NEWLINE_COMMAND) './$(SWAGGER_SPEC)' | ||||
| 	$(SED_INPLACE) '$(SWAGGER_SPEC_BRANDING)' './$(SWAGGER_SPEC)' | ||||
| 
 | ||||
| .PHONY: swagger-check | ||||
| swagger-check: generate-swagger | ||||
|  |  | |||
|  | @ -2,7 +2,7 @@ | |||
| <html lang="en"> | ||||
| 	<head> | ||||
| 		<meta charset="UTF-8"> | ||||
| 		<title>Gitea API</title> | ||||
| 		<title>Forgejo API</title> | ||||
| 		<link href="{{AssetUrlPrefix}}/css/swagger.css?v={{AssetVersion}}" rel="stylesheet"> | ||||
| 	</head> | ||||
| 	<body> | ||||
|  |  | |||
|  | @ -13,8 +13,8 @@ | |||
|   ], | ||||
|   "swagger": "2.0", | ||||
|   "info": { | ||||
|     "description": "This documentation describes the Gitea API.", | ||||
|     "title": "Gitea API.", | ||||
|     "description": "This documentation describes the Forgejo API.", | ||||
|     "title": "Forgejo API.", | ||||
|     "license": { | ||||
|       "name": "MIT", | ||||
|       "url": "http://opensource.org/licenses/MIT" | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue