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

Improve rbs and docs #160

Merged
merged 24 commits into from
Aug 29, 2023
Merged

Improve rbs and docs #160

merged 24 commits into from
Aug 29, 2023

Conversation

mullermp
Copy link
Contributor

@mullermp mullermp commented Aug 25, 2023

Done:

  • waiters
  • paginators
  • client
  • errors
  • types
  • auth
  • client
  • minimal set of hearth signatures
  • generated config types

Copy link
Contributor

@alextwoods alextwoods left a 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

@mullermp mullermp marked this pull request as ready for review August 25, 2023 22:32
@mullermp mullermp marked this pull request as draft August 25, 2023 22:35
Copy link
Contributor

@alextwoods alextwoods left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

hearth/lib/hearth/http/fields.rb Show resolved Hide resolved
@@ -35,6 +35,8 @@ def add(interceptor)

alias << add

# TODO: remove this from public api
Copy link
Contributor

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?)

Copy link
Contributor Author

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)

Copy link
Contributor

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).

Copy link
Contributor Author

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.

@mullermp mullermp marked this pull request as ready for review August 29, 2023 02:20
@@ -37,6 +37,7 @@ public static Middleware build(GenerationContext context) {
ClientConfig disableHostPrefix = ClientConfig.builder()
.name("disable_host_prefix")
.type("Boolean")
.rbsType("bool")
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

@jterapin jterapin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍

@mullermp mullermp merged commit 99742ab into main Aug 29, 2023
20 checks passed
@mullermp mullermp deleted the rbs-docs branch August 29, 2023 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants