Skip to content

Commit

Permalink
Merge pull request #24 from microsoft/feature/mapping-deduplication
Browse files Browse the repository at this point in the history
- adds support to deduplicate mapping in the request adapter
  • Loading branch information
baywet authored Feb 5, 2024
2 parents f4578f8 + c8996dc commit 3428499
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

## [0.13.0] - 2024-02-05

### Changed

- Added support for error mapping deduplication to reduce generated code. [#20](https://github.com/microsoft/kiota-http-ruby/issues/20)

## [0.12.0] - 2023-03-28

### Changed
Expand Down
1 change: 1 addition & 0 deletions lib/microsoft_kiota_faraday/faraday_request_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def throw_if_failed_reponse(response, errors_mapping)
error_factory = errors_mapping[status_code] unless errors_mapping.nil?
error_factory = errors_mapping['4XX'] unless !error_factory.nil? || errors_mapping.nil? || status_code > 500
error_factory = errors_mapping['5XX'] unless !error_factory.nil? || errors_mapping.nil? || status_code < 500 || status_code > 600
error_factory = errors_mapping['XXX'] unless !error_factory.nil? || errors_mapping.nil? || status_code < 400 || status_code > 600
raise MicrosoftKiotaAbstractions::ApiError, 'The server returned an unexpected status code and no error factory is registered for this code:' + status_code.to_s if error_factory.nil?
root_node = self.get_root_parse_node(response)
error = root_node.get_object_value(error_factory) unless root_node.nil?
Expand Down
2 changes: 1 addition & 1 deletion lib/microsoft_kiota_faraday/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module MicrosoftKiotaFaraday
VERSION = '0.12.0'
VERSION = '0.13.0'
end

0 comments on commit 3428499

Please sign in to comment.