Skip to content

Failing to check that schemas are valid #7

@wfvining

Description

@wfvining

The following succeeds when it should not. The value for <<"required">> must be a list.

SchemaArr =
    jiffy:encode(
      #{<<"$id">> => <<"arr">>,
        <<"type">> => <<"object">>,
        <<"definitions">> =>
            #{<<"Element">> =>
                  #{<<"type">> => <<"object">>,
                    <<"properties">> => #{<<"x">> => #{<<"type">> => <<"integer">>}},
                    <<"required">> => [<<"x">>]}},
        <<"properties">> =>
            #{<<"arr">> => #{<<"type">> => <<"array">>,
                             <<"items">> => #{<<"$ref">> => <<"#/definitions/Element">>},
                             <<"minItems">> => 1}},
       <<"required">> => <<"arr">>}),
jerk:add_schema(SchemaArr)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions