import * as JSONSchema from "@effect/schema/JSONSchema";
import * as S from "@effect/schema/Schema";
import { describe, test } from "vitest";
describe("Given a user schema", () => {
test("When converting to json schema Then it should produce the proper output", () => {
JSONSchema.make(
S.struct({
name: S.string.pipe(
S.identifier("Name"),
S.minLength(1, {
message: () => `Name can't be empty.`,
jsonSchema: { minLength: 1 },
}),
),
}),
);
});
});
import * as JSONSchema from "@effect/schema/JSONSchema";
import * as S from "@effect/schema/Schema";
import { describe, test } from "vitest";
describe("Given a user schema", () => {
test("When converting to json schema Then it should produce the proper output", () => {
JSONSchema.make(
S.struct({
name: S.string.pipe(
S.identifier("Name"),
S.minLength(1, {
message: () => `Name can't be empty.`,
jsonSchema: { minLength: 1 },
}),
),
}),
);
});
});