Files
podman/pkg/api/Makefile
Paul Holzinger 04fb77efe2 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>
2024-07-12 14:19:37 +02:00

16 lines
448 B
Makefile

SWAGGER_OUT ?= swagger.yaml
SWAGGER ?= ../../test/tools/build/swagger
validate: ${SWAGGER_OUT}
$(SWAGGER) validate ${SWAGGER_OUT}
serve: ${SWAGGER_OUT}
$(SWAGGER) serve -F redoc -p=8080 swagger.yaml
.PHONY: ${SWAGGER_OUT}
${SWAGGER_OUT}:
# generate doesn't remove file on error
rm -f ${SWAGGER_OUT}
$(SWAGGER) generate spec -x github.com/sigstore/rekor -x github.com/docker/docker/api/types/network -o ${SWAGGER_OUT} -i tags.yaml -w ./ -m