Skip to content

Conversation

@hmac
Copy link

@hmac hmac commented Dec 22, 2018

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: master, 3.4.x, 4.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

This change adds a new option to the Elm generator: enableCustomHeaders. When enabled, the generated request functions will allow you to set your own headers (e.g. for authorisation). It's very similar to the basePath option. I would really like to make this change without introducing another option or breaking existing code, but Elm's records don't support optional fields or default values, so this is the best I could do.

Very interested to hear feedback if there's a better approach here!

cc @trenneman

@hmac hmac force-pushed the elm-custom-headers branch from 42e58bb to c3d6a8d Compare December 22, 2018 17:00
@hmac
Copy link
Author

hmac commented Dec 23, 2018

Just seen this is a duplicate of #1704 - will close this for now on the assumption that that gets merged.

@hmac hmac closed this Dec 23, 2018
@hmac hmac deleted the elm-custom-headers branch December 23, 2018 08:11
@hmac hmac restored the elm-custom-headers branch December 23, 2018 08:12
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.

1 participant