Synergex/HarmonyCore

Generated Postman POST tests don't work

mattl91 opened this issue · 2 comments

The json for POST tests added to PostMan_ODataTests.postman_collection.json when you select the “Enable POST endpoints” and “Enable Postman test generation” options in the GUI tool doesn't work. For example, when you use the "POST Create customer (auto-assign key)" in https://github.com/Synergex/HarmonyCore/wiki/Tutorial-02-15-Adding-Create-Endpoints, you end up with the following (copied from the Postman console):

POST odata.v1.https://localhost:8086/Customers
Error: Invalid protocol: odata.v1.https:

Here’s the json code in PostMan_ODataTests.postman_collection.json that creates this url:

                "url": {
                    "raw": "{{ServerBaseUri}}/{{ODataPath}}/v{{ApiVersion}}/Customers",
                    "host": [
                        "{{ODataPath}}",
                        "v{{ApiVersion}}",
                        "{{ServerBaseUri}}"
                    ],
                    "path": [
                        "Customers"
                    ]
                }
                },

The following, however, does seem to work. So maybe the above code should be generated to be something like this:

                "url": {
                    "raw": "{{ServerBaseUri}}/{{ODataPath}}/v{{ApiVersion}}/Customers",
                    "host": [
                        "{{ServerBaseUri}}"
                    ],
                    "path": [
                        "{{ODataPath}}",
                        "v{{ApiVersion}}",
                        "Customers"
                    ]
                }
                }, 

Which results in this (from the Postman console):

POST https://localhost:8086/odata/v1/Customers

Matt, I fixed this yesterday and Jeff has a pull request for it.

I just saw that. Apologies. I'll close this as a duplicate. Thanks.