Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

- adds support to deduplicate mapping in the request adapter #24

Merged
merged 1 commit into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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