Skip to content

[PHP] Separate host accessor into some parts #7036

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

ackintosh
Copy link
Contributor

@ackintosh ackintosh commented Nov 23, 2017

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: 3.0.0 branch for changes related to OpenAPI spec 3.0. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

#5841

Not only host but also scheme and basePath are managed by Configuration::setHost(), Configuration::getHost().

I think that it is better to match API definition key(scheme, host, basePath) and Configuration class interface(setXXX(), getXXX()) to prevent developers from getting confused.

  • Changed host accessor manages only host.
  • Added accessor for scheme basePath.
  • Added baseUrl().

@ackintosh
Copy link
Contributor Author

@wing328 wing328 changed the base branch from master to 2.4.0 January 14, 2018 10:37
@wing328 wing328 added this to the v2.4.0 milestone Jan 14, 2018
@wing328
Copy link
Contributor

wing328 commented Jan 14, 2018

@ackintosh thanks for the PR. Ruby API client actually follows this approach but the majority of the generators use the current PHP approach.

I'm not sure which one is better for PHP developers but personally I feel comfortable with the current approach even though I worked on the Ruby generator more (I didn't come up with the current Ruby implementation. It was already implemented that way when I started working on this project)

@wing328 wing328 closed this Jan 22, 2018
@wing328 wing328 changed the base branch from 2.4.0 to master January 22, 2018 07:31
@wing328 wing328 reopened this Jan 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants