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

Ignore unknown metadata and shape keys #3095

Merged
merged 2 commits into from
Aug 29, 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
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,13 @@ module AwsSdkCodeGenerator
# WARNING ABOUT GENERATED CODE
WARNING_TXT

@warnings = []

class << self
attr_reader :warnings
def warn(service, type, message)
Kernel.warn(message)
@warnings << { service: service, type: type, message: message }
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,11 @@ def metadata
value: @service.api['metadata'][key].inspect
}
elsif METADATA_KEYS[key].nil?
raise "unhandled metadata key #{key.inspect}"
AwsSdkCodeGenerator.warn(
@service.service_id,
:invalid_key,
"unhandled metadata key `#{key}`"
)
end
end
metadata
Expand Down Expand Up @@ -317,7 +321,11 @@ def shape_constructor_args(shape_name, shape)

args << "#{key}: #{value.inspect}"
elsif SHAPE_KEYS[key].nil?
raise "unhandled shape key #{key.inspect}"
AwsSdkCodeGenerator.warn(
@service.service_id,
:invalid_key,
"unhandled shape key `#{key}` on `#{shape_name}`"
)
end
end
args.join(', ')
Expand Down