We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What version of Ajv are you using? Does the issue happen if you use the latest version? 8.11.2: the latest version
8.11.2
Ajv options object {}
{}
Your code
import Ajv, { JTDSchemaType } from "ajv/dist/jtd"; const ajv = new Ajv(); interface TestObject { first?: string; second?: string; } const testSchema: JTDSchemaType<TestObject> = { optionalProperties: { first: { type: "string" }, second: { type: "string" }, }, }; const serialize = ajv.compileSerializer(testSchema); const parse = ajv.compileParser(testSchema); const obj = { second: "test" }; const serializedObj = serialize(obj); const parsedObj = parse(serializedObj); console.log(serializedObj); console.log(parsedObj); console.log(parse.message, parse.position);
Output
{,"second":"test"} undefined unexpected token , 1
What results did you expect? The serializer should create json code without the erroneous ,.
,
{"second":"test"}
Are you going to resolve the issue? I will look into it, but I haven't found the source of the issue yet.
The text was updated successfully, but these errors were encountered:
Related to #2171, which addresses the additionalProperties instead of optionalProperties.
additionalProperties
optionalProperties
Sorry, something went wrong.
5c72864
Successfully merging a pull request may close this issue.
What version of Ajv are you using? Does the issue happen if you use the latest version?
8.11.2
: the latest versionAjv options object
{}
Your code
Output
What results did you expect?
The serializer should create json code without the erroneous
,
.Are you going to resolve the issue?
I will look into it, but I haven't found the source of the issue yet.
The text was updated successfully, but these errors were encountered: