-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
Allow the baseUrl of elixir APIs to be overridden #12268
Allow the baseUrl of elixir APIs to be overridden #12268
Conversation
796ed8a
to
303b028
Compare
modules/openapi-generator/src/main/resources/elixir/connection.ex.mustache
Outdated
Show resolved
Hide resolved
Awesome, thank you very much for your contribution :D! I've added a comment to your code, every thing else looks good to me 👍 (And I'm also quite unsure about my sugestion. I would simply add it for the sake of backwords compatibilty) |
A little off-topic – but I'm currently making some extra changes in my This solution is much more flexible since it allows you to use multiple URLs and also give some extra room to add some more middlewares or changing the adapter for the specific module. I'm very interested in some feedback about this practice. Nonetheless, I'm a great fan of this PR :)! |
….ex.mustache Co-authored-by: Michael Ramstein <[email protected]>
Yes, that seems a lot more flexible and a little more complicated. Having the option to override the http adapter sounds great. We'd just need to document it with some examples and a link to the tesla configuration options. If you ever decide to give it a go for the main generator, I'll gladly check it out. I'd probably change |
Tested locally and the result is good:
|
Elixir uses
config.exs
files to store most configuration values. This change allows the baseURL to be overridden withdev.exs
andprod.exs
in a project using the generated code.PR checklist
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*
.For Windows users, please run the script in Git BASH.
@mrmstn