Skip to content

Commit 2ad7a7d

Browse files
author
Matt Muller
committed
Handle renaming of shapes
1 parent 9452ed1 commit 2ad7a7d

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

gems/smithy/lib/smithy/views/client/schema.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def shape_name_from_type(type)
174174
def shape_name_from_id(id)
175175
return PRELUDE_SHAPES_MAP[id] if PRELUDE_SHAPES_MAP.key?(id)
176176

177-
Model::Shape.name(id).camelize
177+
@service['rename'][id] || Model::Shape.name(id).camelize
178178
end
179179

180180
# @api private

gems/smithy/lib/smithy/views/client/types.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@ def types
2020
.new(@model)
2121
.shapes_for(@plan.service)
2222
.select { |_key, shape| %w[structure union].include?(shape['type']) }
23-
.map { |id, shape| Type.new(@model, id, shape) }
23+
.map { |id, shape| Type.new(@plan.service, @model, id, shape) }
2424
end
2525

2626
# @api private
2727
class Type
28-
def initialize(model, id, shape)
28+
def initialize(service, model, id, shape)
29+
_, @service = service.first
2930
@model = model
3031
@id = id
3132
@shape = shape
@@ -47,7 +48,7 @@ def attribute_docstrings
4748
end
4849

4950
def name
50-
Model::Shape.name(@id).camelize
51+
@service['rename'][@id] || Model::Shape.name(@id).camelize
5152
end
5253

5354
def member_names

0 commit comments

Comments
 (0)