AnWeber / httpbook

Quickly and easily send REST, Soap, GraphQL, GRPC, MQTT and WebSocket requests directly within Visual Studio Code
https://httpyac.github.io/
MIT License
57 stars 4 forks source link

Code Generation and Imported Files #72

Closed st11x closed 1 year ago

st11x commented 1 year ago

Hi,

If I have variables defined in an external file, code generation is unable to find them even though the requests works. In the screenshot below, eshost is a variable that is imported.

image

Thanks Matt

AnWeber commented 1 year ago

I was able to trigger this error on my end, but it was justified in this case. The variable was really not defined. Can you possibly make me a simple example, how I reenact it. For example, were different environments used and therefore the variable is.

GET https://httpbin.org/anything HTTP/1.1
X-Header: {{header}}
st11x commented 1 year ago

@AnWeber I have created a very small example.

example.zip

If you generate code from run.http, it will complain that the host is not defined, but if you ran the request, it works fine.

thanks Matt

AnWeber commented 1 year ago

Thx will look into it tomorrow

AnWeber commented 1 year ago

Unfortunately, I can not repeat the error. In my case the code generation was triggered correctly. generate_code

st11x commented 1 year ago

@AnWeber Thanks for checking. That is interesting. I installed both extensions from the Marketplace, not sure if there's any subtle differences there. I'll keep testing and let you know. Thanks.