-
Notifications
You must be signed in to change notification settings - Fork 134
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
could not find implicit value for parameter ev #1502
Comments
@djm1329 Thanks, I'm glad you're liking it! In your first example, it seems as though a type alias is getting lost, and it's falling back to the bare I can't look at this immediately, but the place where we should be doing this lookup is here, with the If you're interested in poking around you can test out generating a client directly from guardrail's sbt console via:
(replacing It's even useful to disable the guardrail plugin and Setting expectations, this shouldn't be more than a few lines change, or even just identifying an edge case where we Thanks for the report! |
Ah, one follow-up -- in your second example, what would you expect to happen? What does it mean to put a I know OpenAPI 3.x introduces specific field encodings to denote that a QS parameter should be a url-encoded JSON blob, but I don't see that directive as part of your example. I'd like to make sure I understand fully here, thanks in advance! |
@blast-hardcheese Thanks so much for the detailed suggestions. I am going to try to take a look at this tomorrow unless you beat me to it. For the second example, you raise an excellent point I did not even think about. I am trying to consume a 3rd party spec so pretty sure the 3rd party didn't think about it either. I assume a URL-encoded JSON blob is what's intended. Looking at the OpenAPI 3.0.x specs it seems the default encoding would be "form", but I could very well be reading it incorrectly. Do you happen to know what setting is needed for JSON blob? Again, thanks for this library and speedy and helpful responses! |
So, this part of the spec includes both However, do your question,
presumably it'd just be something like parameters:
- name: bar
in: query
content:
application/json:
schema:
$ref: '#/components/schemas/Bar' but that's not currently supported by guardrail, you'd have to just use |
@blast-hardcheese thanks for the guidance on specifying Json blob, it makes sense. Now I'm thinking the I have been tracing through the code following your suggestions. Now I realize I am not sure what the expected result should be for the first example. In the |
Definitely the latter, I would have expected that the We used to emit and manage type aliases, but it was actually really unpleasant ergonomically. It may have been just the way it was done, trying to render everything into a single As for the I think implementation-wise, I'd have to poke around a bit more before giving advice, but I'm leaning in the way of throwing something similar to |
There's definitely a Could the problem be in guardrail/modules/core/src/main/scala/dev/guardrail/generators/ProtocolGenerator.scala Line 527 in 1ea36ab
StringSchema handled in there, but tbh I am not super clear yet on what I am looking at.
For the |
You're spot on. The problem is that here, we match the case where ... and since that'll never be true, we always So, just looking at the callers to that I opened #1503 to test just using the standard The only addition I'd make is to expand |
Awesome @blast-hardcheese! Thank you! |
Alright. sbt-guardrail 0.72.0 is out with this fix (plus a few more). If you have scala-steward applying your upgrades for you, you should also get a scalafix rule that rewrites
should patch things up for you. When you learn back about the encoding for that query parameter, I'd appreciate a new issue, optionally referencing this one, to avoid this issue just being left open. Thanks! |
Perfect, thanks @blast-hardcheese, I will definitely come back on the query parameter. Really appreciate your work on this! |
Awesome library, thank you so much! I am encountering a couple of issues using the latest version.
addSbtPlugin("dev.guardrail" % "sbt-guardrail" % "0.71.0")
Generated client code for Akka HTTP does not compile for the following:
gives error
Similar for
gives error
The text was updated successfully, but these errors were encountered: