feat: release 2.7.0-rc2
This commit is contained in:
+22
-4
@@ -16,10 +16,28 @@ let composeSchema: Promise<z.ZodType<ComposeSpecification>> | undefined;
|
||||
function getComposeSchema(): Promise<z.ZodType<ComposeSpecification>> {
|
||||
if (!composeSchema) {
|
||||
composeSchema = import("../schema/docker.ts")
|
||||
.then(({ default: schema }) =>
|
||||
z.fromJSONSchema(
|
||||
schema as unknown as Parameters<typeof z.fromJSONSchema>[0],
|
||||
) as z.ZodType<ComposeSpecification>,
|
||||
.then(
|
||||
({ default: schema }) =>
|
||||
z
|
||||
.fromJSONSchema(
|
||||
schema as unknown as Parameters<typeof z.fromJSONSchema>[0],
|
||||
)
|
||||
.superRefine((value, context) => {
|
||||
if (!value || typeof value !== "object" || Array.isArray(value))
|
||||
return;
|
||||
for (const key of Object.keys(value)) {
|
||||
if (
|
||||
Object.hasOwn(schema.properties, key) ||
|
||||
key.startsWith("x-")
|
||||
)
|
||||
continue;
|
||||
context.addIssue({
|
||||
code: "custom",
|
||||
path: [key],
|
||||
message: `Unrecognized Compose property: ${key}`,
|
||||
});
|
||||
}
|
||||
}) as z.ZodType<ComposeSpecification>,
|
||||
)
|
||||
.catch((error) => {
|
||||
composeSchema = undefined;
|
||||
|
||||
Reference in New Issue
Block a user