fredo-dedup / JSONSchema.jl

JSON Schema validation package for Julia
Other
31 stars 12 forks source link

Order of arguments for `validate` is unexpected #31

Closed helgee closed 3 years ago

helgee commented 3 years ago

IMHO the argument order of validate differs from idiomatic Julia style.

The "fixed" argument (what would be the object instance in a single dispatch language, e.g. schema.validate(data)) is usually put first, e.g. push!(array, 1) or print(io, "something"). Thus, I feel that validate(schema, data) would be more idiomatic than validate(data, schema).

Not a big deal but I get it wrong everytime the way it is 🙈

odow commented 3 years ago

Feel free to open a PR with the alternate order.