Skip to content

Commit

Permalink
patch swagger file to allow download of intel pdf report
Browse files Browse the repository at this point in the history
  • Loading branch information
isimluk committed Oct 14, 2021
1 parent 20892cb commit 5ec7efc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ build:

clean-generate: remove-generated generate

generate: specs/swagger-download-patch.json
generate: specs/swagger-pdf-download-patch.json
$(GO) run github.com/go-swagger/go-swagger/cmd/swagger generate client --skip-validation -f $^ -t falcon

.PHONY: build generate remove-generated
Expand All @@ -28,6 +28,10 @@ specs/swagger-download-patch.json: specs/swagger-stripped-oauth.json
# We add missing binary response body spec to the swagger
jq '.definitions."domain.DownloadItem"."type"="string" | .definitions."domain.DownloadItem"."format"="binary"' $< > $@

specs/swagger-pdf-download-patch.json: specs/swagger-download-patch.json
# We add missing binary response body spec to the swagger
jq '.paths."/intel/entities/report-files/v1"."get"."responses"."200"."schema"={"$$ref": "#/definitions/domain.DownloadItem"}' $< > $@

specs/swagger.json:
@echo "Sorry swagger.json needs to be obtained manually at this moment"
@exit 1

0 comments on commit 5ec7efc

Please sign in to comment.