mirror of https://github.com/grafana/grafana.git
				
				
				
			API: Fix swagger generation (#50071)
* API: Fix Swagger generation using docker * Unset SWAGGER_GENERATE_EXTENSION for Mac
This commit is contained in:
		
							parent
							
								
									573e121a67
								
							
						
					
					
						commit
						a165b40e56
					
				
							
								
								
									
										3
									
								
								Makefile
								
								
								
								
							
							
						
						
									
										3
									
								
								Makefile
								
								
								
								
							| 
						 | 
					@ -43,6 +43,7 @@ $(SPEC_TARGET): $(API_DEFINITION_FILES) ## Generate API spec
 | 
				
			||||||
	-e SWAGGER_GENERATE_EXTENSION=false \
 | 
						-e SWAGGER_GENERATE_EXTENSION=false \
 | 
				
			||||||
	-v ${HOME}/go:/go \
 | 
						-v ${HOME}/go:/go \
 | 
				
			||||||
	-v $$(pwd):/grafana \
 | 
						-v $$(pwd):/grafana \
 | 
				
			||||||
 | 
						-v $$(pwd)/../grafana-enterprise:$$(pwd)/../grafana-enterprise \
 | 
				
			||||||
	-w $$(pwd)/pkg/api/docs quay.io/goswagger/swagger:$(SWAGGER_TAG) \
 | 
						-w $$(pwd)/pkg/api/docs quay.io/goswagger/swagger:$(SWAGGER_TAG) \
 | 
				
			||||||
	generate spec -m -o /grafana/public/api-spec.json \
 | 
						generate spec -m -o /grafana/public/api-spec.json \
 | 
				
			||||||
	-w /grafana/pkg/server \
 | 
						-w /grafana/pkg/server \
 | 
				
			||||||
| 
						 | 
					@ -62,7 +63,7 @@ ensure_go-swagger_mac:
 | 
				
			||||||
	@hash swagger &>/dev/null || (brew tap go-swagger/go-swagger && brew install go-swagger)
 | 
						@hash swagger &>/dev/null || (brew tap go-swagger/go-swagger && brew install go-swagger)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
--swagger-api-spec-mac: ensure_go-swagger_mac $(API_DEFINITION_FILES)  ## Generate API spec (for M1 Mac)
 | 
					--swagger-api-spec-mac: ensure_go-swagger_mac $(API_DEFINITION_FILES)  ## Generate API spec (for M1 Mac)
 | 
				
			||||||
	swagger generate spec -m -w pkg/server -o public/api-spec.json \
 | 
						SWAGGER_GENERATE_EXTENSION=false swagger generate spec -m -w pkg/server -o public/api-spec.json \
 | 
				
			||||||
	-x "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" \
 | 
						-x "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" \
 | 
				
			||||||
	-x "github.com/prometheus/alertmanager" \
 | 
						-x "github.com/prometheus/alertmanager" \
 | 
				
			||||||
	-i pkg/api/docs/tags.json
 | 
						-i pkg/api/docs/tags.json
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										3304
									
								
								public/api-spec.json
								
								
								
								
							
							
						
						
									
										3304
									
								
								public/api-spec.json
								
								
								
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
		Loading…
	
		Reference in New Issue