proxy Error TypeError: Only HTTP(S) protocols are supported
Issue:
I am getting an Error TypeError: Only HTTP(S) protocols are supported on the Proxy function for https://supervillain.herokuapp.com/api-docs/ for all the calls.
Instead, when I run the mock version, the API calls are working as expected.
I am currently running the below:
Prism version 4.10.1 node version 17.5.0 Spec https://raw.githubusercontent.com/ale-sanchez-g/villain/master/app/swagger/openapi.json Node server running on express https://github.com/ale-sanchez-g/villain
Example call:
curl --location --request POST 'http://127.0.0.1:4010/auth/gentoken' \
--header 'Authorization: test' \
--header 'Content-Type: application/json' \
--data-raw '{
"key": "brp64nlh",
"email": "[email protected]"
}'
Example response:
{
"type": "TypeError",
"title": "Only HTTP(S) protocols are supported",
"status": 500,
"detail": ""
}
hey @ale-sanchez-g - thanks for the issue. can you please share how you are setting up the proxy? if the cli, the full list of arguments would be great.
@ale-sanchez-g : I got this error when I started my prism thus:
prism proxy my-api.yaml localhost:8000 --errors
Fixed when I changed to
prism proxy my-api.yaml http://localhost:8000 --errors
we could take this as an enhancement request to return an appropriate error message when running the cli
hey @ale-sanchez-g - thanks for the issue. can you please share how you are setting up the proxy? if the cli, the full list of arguments would be great.
The cli arguments are as per the documentation after I followed @ikenna suggestion the proxy is working.
prism proxy app/swagger/openapi.json localhost:3000 --errors
The documentation has been updated. https://meta.stoplight.io/docs/prism/72d69fb629de0-validation-proxy
fantastic this is working perfectly now