cog.command.openapi_schema should inform users if cog.yaml is missing.
Currently, cog.command.openapi_schema silently returns {} if cog.yaml is missing (see here).
This is undesirable in situations where cog.yaml is in fact missing, but the user thinks that it is present. In such cases, cog build will fail on openapi schema validation, but it won't be clear why.
This just happened to me!
For various questionable reasons, cog.yaml in my project root is a symlink and the target was accidentally excluded in my .dockerignore. This led to an interesting situation where cog run python -m cog.command.openapi_schema returned the correct schema, but cog build failed at schema validation because the schema returned empty.
A warning or just a note that my cog.yaml was missing would have saved me quite a bit of detective work.
cog.command.openapi_schema
should inform users ifcog.yaml
is missing.Currently,
cog.command.openapi_schema
silently returns{}
ifcog.yaml
is missing (see here).This is undesirable in situations where
cog.yaml
is in fact missing, but the user thinks that it is present. In such cases,cog build
will fail on openapi schema validation, but it won't be clear why.This just happened to me!
For various questionable reasons,
cog.yaml
in my project root is a symlink and the target was accidentally excluded in my.dockerignore
. This led to an interesting situation wherecog run python -m cog.command.openapi_schema
returned the correct schema, butcog build
failed at schema validation because the schema returned empty.A warning or just a note that my
cog.yaml
was missing would have saved me quite a bit of detective work.