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 <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2024-07-12 14:06:42 +02:00
parent e24367aa14
commit 04fb77efe2

View File

@ -12,4 +12,4 @@ serve: ${SWAGGER_OUT}
${SWAGGER_OUT}: ${SWAGGER_OUT}:
# generate doesn't remove file on error # generate doesn't remove file on error
rm -f ${SWAGGER_OUT} 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