-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Parsing arrays when parameter is of type array, style simple, explode false #59
Comments
Today I learned: so much. Thank you for sharing this. The Parameter Serialization page you linked, and its 3.1.0 counterpart, show a few different variations of path parameter encoding I wasn't aware of. In the short term, you're doing the best thing: users of the generated function should pre-join the list of IDs. In the long term, the generator should have all of the information necessary to make better choices for these parameters. I'll get to work on that. In the meantime, do you have an example specification that uses this type of path parameter? I'd love to add it to the list of examples I use to check for regressions. |
Started some exploration in #62. |
@aj-foster sorry for the delayed response! is the following what you mean for an example spec?
|
Hi AJ, thank you for making this codegen for Elixir! I was running into a problem and was wondering if you could help/provide advice?
In my project OpenAPI spec, I am using a GET parameter specified like this:
When I code generate, the typespec of the module says that the type listOfIds is of
[String.t()]
which is correct, however the generated module is like the following:If
listOfIds = [AAAA, BBBB, CCCC, DDDD]
, I expect that url should parse to /listOfIds/AAAA,BBBB,CCCC,DDDD according to the OpenAPI Spec. However, what I actually get is /listOfIds/AAAABBBBCCCCDDDD (no comma seperation).My current work around is to pre-join (
Enum.join(listOfIds, ",")
) my listOfIds before passing it into the module, but was wondering if there is way for the codegen to join array parameters, given that the typespec is aware that listOfIds is an arrayThe text was updated successfully, but these errors were encountered: