jonasschmidt / ex_json_schema

An Elixir JSON Schema validator
MIT License
366 stars 98 forks source link

Deprecation warnings fixed #48

Closed the-guitarman closed 5 years ago

the-guitarman commented 5 years ago

I'm using elixir 1.9.1 and I have a lot of deprecation warnings in my log:

warning: Map.take/2 with an Enumerable of keys that is not a list is deprecated.  Use a list of keys instead.
  (elixir) lib/map.ex:395: Map.take/2
  (ex_json_schema) lib/ex_json_schema/validator/properties.ex:16: ExJsonSchema.Validator.Properties.validate/3
  (elixir) lib/enum.ex:1053: anonymous fn/3 in Enum.flat_map/2
  (stdlib) maps.erl:232: :maps.fold_1/3
  (elixir) lib/enum.ex:1964: Enum.flat_map/2
  (ex_json_schema) lib/ex_json_schema/validator.ex:62: ExJsonSchema.Validator.validation_errors/4
  (ex_json_schema) lib/ex_json_schema/validator.ex:34: ExJsonSchema.Validator.validate_fragment/4
  (ex_json_schema) lib/ex_json_schema/schema.ex:78: ExJsonSchema.Schema.assert_valid_schema/1
  (ex_json_schema) lib/ex_json_schema/schema.ex:67: ExJsonSchema.Schema.resolve_root/1

and

warning: Map.size/1 is deprecated. Use Kernel.map_size/1 instead
Found at 4 locations:
  lib/ex_json_schema/validator.ex:182
  lib/ex_json_schema/validator.ex:189
  lib/ex_json_schema/validator.ex:197
  lib/ex_json_schema/validator.ex:204

I fixed the warnings, but mix test crashes in general at my machine with and without my changes.

I did: git clone ... mix dips.get mix test

I'm using MacOS 10.14.5 with

Erlang/OTP 22 [erts-10.4.4] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe] [dtrace]

Interactive Elixir (1.9.1) - press Ctrl+C to exit (type h() ENTER for help)

Please check my changes and the test issue.

Regards

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 98.661% when pulling cf52e0f392847b83715737a49f28cceeb4230a03 on the-guitarman:master into fd808676f1ecbd52d874fb3eca180bc476d20440 on jonasschmidt:master.

ayrat555 commented 5 years ago

@jonasschmidt ping

jonasschmidt commented 5 years ago

Sorry for the long delay. I was on sabbatical and had my GitHub email still set to the company address, so I never got the notifications for the open issues. The PR has been merged and released in version 0.6.2. Thank you for taking care of this 🙇