Skip to content

Commit

Permalink
Make Unknown the default Unknown untion types name
Browse files Browse the repository at this point in the history
  • Loading branch information
alextwoods committed Aug 23, 2024
1 parent e8540c2 commit c4ba0b2
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 26 deletions.
8 changes: 4 additions & 4 deletions codegen/projections/rails_json/lib/rails_json/types.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions codegen/projections/white_label/lib/white_label/types.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ private void renderParseEventMethod(
}
})
.openBlock("else")
.write("$T::Unknown.new(name: type || 'unknown', value: message)",
.write("$T::Unknown.new(name: type, value: message)",
symbolProvider.toSymbol(eventStreamUnion))
.closeBlock("end")
.closeBlock("end");
Expand Down Expand Up @@ -267,9 +267,9 @@ private void renderParseExceptionMethod(
}
})
.openBlock("else")
.write("data = $T::Unknown.new(name: type || 'unknown', value: message)",
.write("data = $T::Unknown.new(name: type, value: message)",
symbolProvider.toSymbol(eventStreamUnion))
.write("Errors::ApiError.new(error_code: type || 'unknown', "
.write("Errors::ApiError.new(error_code: type, "
+ "metadata: {data: data})")
.closeBlock("end")
.closeBlock("end");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void render() {
writer
.openBlock("class Unknown < $T", symbolProvider.toSymbol(shape))
.openBlock("def initialize(name:, value:)")
.write("super({name: name, value: value})")
.write("super({name: name || 'Unknown', value: value})")
.closeBlock("end")
.write("")
.openBlock("def to_h")
Expand Down
13 changes: 0 additions & 13 deletions hearth/sig/lib/hearth/http/api_error.rbs

This file was deleted.

0 comments on commit c4ba0b2

Please sign in to comment.