-
Notifications
You must be signed in to change notification settings - Fork 6
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
Improve rbs and docs #160
Improve rbs and docs #160
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice - docs seem a lot more useful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
...en/smithy-ruby-codegen/src/main/java/software/amazon/smithy/ruby/codegen/RubyCodeWriter.java
Show resolved
Hide resolved
...by-codegen/src/main/java/software/amazon/smithy/ruby/codegen/generators/ClientGenerator.java
Outdated
Show resolved
Hide resolved
...uby-codegen/src/main/java/software/amazon/smithy/ruby/codegen/generators/UnionGenerator.java
Outdated
Show resolved
Hide resolved
@@ -35,6 +35,8 @@ def add(interceptor) | |||
|
|||
alias << add | |||
|
|||
# TODO: remove this from public api |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? I think it must be part of the public API if its part of Config? (unless we move away from using the List classes and uses some of List of Type validation?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Open to ideas but I don't think this should be publicly callable in a public API (List)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah - I see what you mean. The functionality could be moved into a utilility in... middleware maybe?
I'm also still a bit on the fence about having a class for this list in the ifrst place. It seems like we should just have a List and add better validation utilities (which we now have the ability to do in codegen).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the InterceptorList makes sense. We could possible do this code in the Interceptor module (api private). I will investigate in a follow up PR - I have a list of small follow ups that I found during this.
codegen/projections/high_score_service/sig/high_score_service/config.rbs
Show resolved
Hide resolved
@@ -37,6 +37,7 @@ public static Middleware build(GenerationContext context) { | |||
ClientConfig disableHostPrefix = ClientConfig.builder() | |||
.name("disable_host_prefix") | |||
.type("Boolean") | |||
.rbsType("bool") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have some special logic around the "Boolean" "type" already - I wonder if its worth adding a special case in the builder for this to just automatically set the rbsType?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe? Can think about other improvements too.. we definitely need an override for this anyway. Arguably we should have .type("TrueClass, FalseClass") (it could even be documented this way in Yard) and also "Boolean" as docType.
...-codegen/src/main/java/software/amazon/smithy/ruby/codegen/middleware/MiddlewareBuilder.java
Show resolved
Hide resolved
codegen/smithy-ruby-codegen-test/model/component-test/paginators.smithy
Outdated
Show resolved
Hide resolved
...by-codegen/src/main/java/software/amazon/smithy/ruby/codegen/generators/ClientGenerator.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 👍
Done: