Skip to content
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

feat: add BaseService.constructServiceURL method #138

Merged
merged 1 commit into from
May 27, 2021

Conversation

ajhynes7
Copy link
Contributor

This method can be used by an API to construct a service URL from a parameterized URL.

Checklist
  • npm test passes (tip: npm run lint-fix can correct most style issues)
  • tests are included
  • documentation is changed or added

@CLAassistant
Copy link

CLAassistant commented May 26, 2021

CLA assistant check
All committers have signed the CLA.

@ajhynes7 ajhynes7 requested review from padamstx and dpopp07 May 26, 2021 19:57
// If null was passed, we set the variables to an empty map.
// This results in all default variable values being used.
if (providedUrlVariables === null) {
providedUrlVariables = new Map<string, string>();
Copy link
Member

Choose a reason for hiding this comment

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

Quick initial question - is there a reason that you used Maps instead of basic objects? e.g. {}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm implementing the same method for Java and Go using a map, so I chose the Map class for consistency. The class provides some useful methods like .has(key). I also chose the Map class because the variables are intended to just have keys and values - nothing more nested than that.

Copy link
Member

Choose a reason for hiding this comment

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

That all makes sense! I asked because I don't see them used very often but they seem great for this use case 👍

Copy link
Member

@padamstx padamstx 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
Member

@dpopp07 dpopp07 left a comment

Choose a reason for hiding this comment

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

Looks good! 👍

@ajhynes7 ajhynes7 merged commit 0e73bde into main May 27, 2021
@ajhynes7 ajhynes7 deleted the support_parameterized_url branch May 27, 2021 17:47
ibm-devx-sdk pushed a commit that referenced this pull request May 27, 2021
# [2.11.0](v2.10.4...v2.11.0) (2021-05-27)

### Features

* add `BaseService.constructServiceURL` method ([#138](#138)) ([0e73bde](0e73bde))
@ibm-devx-sdk
Copy link

🎉 This PR is included in version 2.11.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants