From 04fb77efe294f8b053d6a7e3562fd24944fa602f Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Fri, 12 Jul 2024 14:06:42 +0200 Subject: [PATCH] swagger: exlude new docker network types The new docker types have conflicting swagger:model names, there is both network.CreateResponse and container.CreateResponse. However both have a different fields (Warning and Warnings) and both are marked as required. The swagger generate sees both and somehow merges them but then only shows fields from one type but at the same time list all fields as required. This causes the swagger validation to fail: - "Warning" is present in required but not defined as property in definition "CreateResponse" To work around that we exlcude the netwok types from the swagger generation which makes it work again. Looking at the final type info in the browser it still shows the type onfo on the compat network endpints so it doesn't even loose any valuable information AFAICS. Signed-off-by: Paul Holzinger --- pkg/api/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/api/Makefile b/pkg/api/Makefile index 747967b1c6..b784db895e 100644 --- a/pkg/api/Makefile +++ b/pkg/api/Makefile @@ -12,4 +12,4 @@ serve: ${SWAGGER_OUT} ${SWAGGER_OUT}: # generate doesn't remove file on error rm -f ${SWAGGER_OUT} - $(SWAGGER) generate spec -x github.com/sigstore/rekor -o ${SWAGGER_OUT} -i tags.yaml -w ./ -m + $(SWAGGER) generate spec -x github.com/sigstore/rekor -x github.com/docker/docker/api/types/network -o ${SWAGGER_OUT} -i tags.yaml -w ./ -m