Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix Issue 7924 - Allow host and base path to be changed independently #7996

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
alango wants to merge 8 commits into swagger-api:master
base: master
Choose a base branch
Loading
from alango:issue_7924

Conversation

@alango
Copy link

@alango alango commented Apr 10, 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: 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.

@bbdouglas @JFCote @sreeshas @jfiala @lukoyanov @cbornet @jeff9finger

Description of the PR

Fixes #7924
Separate the hostname and the base path so that they can be changed independently of one another

Copy link
Author

alango commented Apr 13, 2018

Tests seem to pass, so not sure what I've done to make the CI fail now... Is there anything else I need to do to move this forward? (not sure who to tag, @jeff9finger?)

Copy link

I like the concept. However, I think this would be more useful to provide more granularity here. Combining the schema, host and port into a property named "host" is a bit misleading. I'd like to see separate properties for schema, host, and port (or at least schema and host with the port combined with the host). An alternative would be to rename the property to something besides "host".

What does the community think?

Copy link
Author

alango commented Apr 17, 2018

Was erring on the side of making small changes, but agree it would make sense to split out the scheme as well and am happy to do that 🙂. (Alternatively, if there's already some precedent for this in swagger-codegen, then I'm also happy to follow that.)

Copy link
Author

alango commented Apr 17, 2018

Separated out the scheme, let me know if there's anything else you want from me.

public class ApiClient {
private String basePath = "{{{basePath}}}";
private String scheme = "{{scheme}}";
Copy link

@jeff9finger jeff9finger Apr 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this provide a default for "http" in a similar way that host does with "localhost"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand how this works correctly, then I believe this defaults to https if a scheme isn't specified (https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java#L98).

Copy link

@jeff9finger jeff9finger Apr 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. that is correct. Thanks for pointing that out.

Copy link

Also, this seems useful for all the java client libraries. Would you consider adding it to the other Java client libraries?

Copy link
Author

alango commented Apr 18, 2018

My project happens to use this library so that's what I've been testing with. I'd rather not edit the other Java client libraries since there are at least some where it looks my change won't easily apply, and I don't want to touch more code that I don't have time to test right now!

Copy link

@jeff9finger jeff9finger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Copy link

@alango I understand your time constraints. Thanks for the contribution.

@wing328 Can we put this request out to the community and see if someone else has time to add this to the other Java client libraries?

Copy link
Author

alango commented Apr 24, 2018

@jeff9finger Do you know if this is going to be merged soon, or are you planning to wait for the other libraries to be updated?

Copy link

@wing328 Can we go ahead and get this merged?

Copy link
Author

alango commented Jun 1, 2018

@wing328 bump?

Copy link

Any updates?

gschrader and catmorte reacted with thumbs up emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer

@jeff9finger jeff9finger jeff9finger approved these changes

Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /