AnWeber / vscode-httpyac

Quickly and easily send REST, Soap, GraphQL, GRPC, MQTT and WebSocket requests directly within Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=anweber.vscode-httpyac
MIT License
222 stars 20 forks source link

Input unexpected behavior #247

Closed Gxmadix closed 6 months ago

Gxmadix commented 6 months ago

Hello, I am facing an unexpected behavior with an optional input field, like explained below.

### SignIn
@email = {{ $input email value? }}
@password = {{ $password password! }}
@account = {{ $input optional select the wanted profile }}
POST {{AuthUrl}}/signin HTTP/{{httpVersion}}

{
  "email": "{{email}}",
  "password": "{{password}}",
  "account": "{{account}}"
}

When I leave @account empty, I receive this

## Received
{
  email: 'email@stuff.com',
  password: 'ThePassword',
  account: '{{account}}'
}

But logically this shouln'd be filled, I am expecting something more like this.

####
## Expected
{
  email: 'email@stuff.com',
  password: 'ThePassword'
}

or 

{
  email: 'email@stuff.com',
  password: 'ThePassword',
  account: ''
}
AnWeber commented 6 months ago

default error of mine. undefined !== "" in line https://github.com/AnWeber/httpyac/blob/main/src/plugins/core/replacer/showInputBoxVariableReplacer.ts#L44C5-L44C5 I will fix it.

AnWeber commented 6 months ago

fixed with next release