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
If I include examples in a schema, validation fails:
examples
{ "type": "string", "format": "date-time", "examples": [ "2024-01-09T08:00:00Z" ] }
1> {ok, Bin} = file:read_file("date-time.json"). {ok,<<"{\n\t\"type\": \"string\",\n\t\"format\": \"date-time\",\n\t\"examples\": [\n\t\t\"2024-01-09T08:00:00Z\"\n\t]\n}\n">>} 2> Schema1 = json:decode(Bin). #{<<"examples">> => [<<"2024-01-09T08:00:00Z">>], <<"format">> => <<"date-time">>,<<"type">> => <<"string">>} 3> jesse:add_schema("test1", Schema1). ok 4> jesse:validate("test", <<"2024-01-09T08:00:00Z">>). {error,[{data_invalid,#{<<"$id">> => <<"file:///Users/vances/cgf.build/shell/test">>, <<"examples">> => [<<"2024-01-09T08:00:00Z">>], <<"format">> => <<"date-time">>,<<"type">> => <<"string">>}, not_array,<<"2024-01-09T08:00:00Z">>,[]}]}
Removing examples allows validation to succeed:
5> Schema2 = maps:remove(<<"examples">>, Schema1). #{<<"format">> => <<"date-time">>,<<"type">> => <<"string">>} 6> jesse:add_schema("test2", Schema2). ok 7> jesse:validate("test2", <<"2024-01-09T08:00:00Z">>). {ok,<<"2024-01-09T08:00:00Z">>}
The text was updated successfully, but these errors were encountered:
No branches or pull requests
If I include
examples
in a schema, validation fails:Removing
examples
allows validation to succeed:The text was updated successfully, but these errors were encountered: