fortnox-api 0.8.1 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7d28f8cb3667dac63023e514d6c5203ba795a8c1c2598bbf538e49f58528cbc1
4
- data.tar.gz: 127841e8b5d6a64d2b37408960e9659da918fcc9135d821098d281d508e337ca
3
+ metadata.gz: 345228c827e624083ca2557504b5c426f3e4719a9252e35bb31d87e44fe9f7f7
4
+ data.tar.gz: 3b9fc903f0f5dc8b7e98ae5610af503dd09c6cc218af6c7339e197de23c39e08
5
5
  SHA512:
6
- metadata.gz: 4a9557fb4ecacf5d545c26d8894953793268b37a3c8a603a8095e239536d97871712140a6c3bc1f0596708913f369584633fee7e903a3f8ae4be99c47297418d
7
- data.tar.gz: 244727089a11d031ec9e8afafa93d80c4b3ee87d1eb9c7f6ff57a8d26751d78304bc34073c095328f61edc580abeff44dba3f275e28346dea024b292e114126a
6
+ metadata.gz: 8f74bbe0e82253b3addac22a96fc2cde1892ff8b2d0a48bab032b3b7306bb6e215646b2e365622f9671eeecc90167531b7fa9dc92227b83e4dfd6aaefe04f202
7
+ data.tar.gz: 0f1f3b7a1702950973bdd23d4bda90fdfb03ac2532031067f15f84d4abf6d2f629a7bda54cc2a405e868629627785a722c4f32dd5d719f3f6f36d5593cbc39da
data/CHANGELOG.md CHANGED
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
6
6
  and this project adheres to
7
7
  [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
8
8
 
9
+ ## [0.8.2]
10
+
11
+ ### Fixed
12
+ - Restored undocumented support for string keys in model attributes,
13
+ which was inadvertently removed in `v0.8.1`.
14
+
9
15
  ## [0.8.1]
10
16
 
11
17
  ### Fixed
@@ -74,6 +80,7 @@ and this project adheres to
74
80
 
75
81
  - Model attribute `url` is no longer null
76
82
 
83
+ [0.8.2]: https://github.com/accodeing/fortnox-api/compare/v0.8.1...v0.8.2
77
84
  [0.8.1]: https://github.com/accodeing/fortnox-api/compare/v0.8.0...v0.8.1
78
85
  [0.8.0]: https://github.com/accodeing/fortnox-api/compare/v0.7.2...v0.8.0
79
86
  [0.7.2]: https://github.com/accodeing/fortnox-api/compare/v0.7.1...v0.7.2
@@ -5,6 +5,7 @@ module Fortnox
5
5
  module Types
6
6
  class Model < Dry::Struct
7
7
  transform_types(&:omittable)
8
+ transform_keys(&:to_sym)
8
9
 
9
10
  def initialize(input_attributes)
10
11
  if (missing_key = first_missing_required_key(input_attributes))
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Fortnox
4
4
  module API
5
- VERSION = '0.8.1'
5
+ VERSION = '0.8.2'
6
6
  end
7
7
  end
@@ -50,4 +50,24 @@ RSpec.describe Fortnox::API::Types::Model do
50
50
  it { is_expected.to be nil }
51
51
  end
52
52
  end
53
+
54
+ context 'with required keys' do
55
+ before do
56
+ stub_const('Types::Age', Dry::Types['strict.integer'].constrained(gt: 18).is(:required))
57
+
58
+ test_class = Class.new(Fortnox::API::Types::Model) do
59
+ attribute :age, Types::Age
60
+ end
61
+
62
+ stub_const('Model', test_class)
63
+ end
64
+
65
+ it 'does not raise error' do
66
+ expect { Model.new(age: 20) }.not_to raise_error
67
+ end
68
+
69
+ it 'supports string keys' do
70
+ expect { Model.new('age' => 20) }.not_to raise_error
71
+ end
72
+ end
53
73
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fortnox-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Schubert Erlandsson
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2024-01-23 00:00:00.000000000 Z
14
+ date: 2024-01-24 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: countries