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

Include protocol in baseUrl for Postman collections #391

Merged
merged 4 commits into from
Jan 2, 2022

Conversation

retry19
Copy link
Contributor

@retry19 retry19 commented Dec 14, 2021

Overview

For now baseUrl not include protocol, only localhost or example.com, and in postman will be like this :

http://{{baseUrl}}/some/other

It makes difficult when we want to change baseUrl from http to https, for example in local we use http://localhost but in staging we use https://staging.example.com. So, we must change environment variable in postman, then change http to https manually.

We can't only change environment variable, because baseUrl not contains protocol (http or https). It will be helpful when we can set baseUrl is http://localhost (including protocol).

So, I'm change baseUrl contain protocol, and also remove protocol attribute on url json.

Example

Before

"variable": [
    {
        "id": "baseUrl",
        "key": "baseUrl",
        "type": "string",
        "name": "string",
        "value": "localhost"
    }
],
"url": {
    "protocol": "http",
    "host": "{{baseUrl}}",
    "path": "api/withBodyParametersAsArray",
    "query": [],
    "raw": "http://{{baseUrl}}/api/withBodyParametersAsArray"
},

Screenshot (14)

After

"variable": [
    {
        "id": "baseUrl",
        "key": "baseUrl",
        "type": "string",
        "name": "string",
        "value": "http://localhost"
    }
],
"url": {
    "host": "{{baseUrl}}",
    "path": "api/withBodyParametersAsArray",
    "query": [],
    "raw": "{{baseUrl}}/api/withBodyParametersAsArray"
},

Screenshot (13)

@shalvah
Copy link
Contributor

shalvah commented Dec 21, 2021

Nice work. However, I won't be adding a new config item. Can you update the PR to make this the default instead? I don't think there's any advantage in removing the protocol from the base URL.

@retry19
Copy link
Contributor Author

retry19 commented Dec 21, 2021

Nice work. However, I won't be adding a new config item. Can you update the PR to make this the default instead? I don't think there's any advantage in removing the protocol from the base URL.

Okay, I'll update this PR

@retry19
Copy link
Contributor Author

retry19 commented Dec 22, 2021

@shalvah I already updated

@shalvah shalvah merged commit 58110a4 into knuckleswtf:master Jan 2, 2022
@shalvah shalvah changed the title Feat: base url contain protocol Include protocol in baseUrl for Postman collections Jan 2, 2022
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.

2 participants