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

http language file format support #5

Open
sassman opened this issue Oct 18, 2022 · 0 comments
Open

http language file format support #5

sassman opened this issue Oct 18, 2022 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@sassman
Copy link
Member

sassman commented Oct 18, 2022

support for the http language file format used by the

Note: It might be good to go with one or the other as a bookmark file format.

Examples

  • normal request with an accept header
    ### GET request with a header
    GET https://httpbin.org/ip
    Accept: application/json
    
  • request with environment variables
    ### GET request with environment variables
    GET {{host}}/get?show_env={{show_env}}
    Accept: application/json
    

Breaks down into

@sassman sassman changed the title stabilizing the bookmark file format rest client plugin http language file format support Nov 3, 2022
sassman added a commit that referenced this issue Dec 16, 2022
implements #5

done:
- [x] add `HttpVersion` to `HttpRequest`
- [x] implement http template file body parsing + test

todos:
- [ ] implement http body to curl parameter mapping
- [ ] implement external file enum behavior
- [ ] implement templating on body content

Signed-off-by: Sven Kanoldt <sven@d34dl0ck.me>
sassman added a commit that referenced this issue Jan 7, 2023
implements #5

done:
- [x] add `HttpVersion` to `HttpRequest`
- [x] implement http template file body parsing + test
- [x] implement http body to curl parameter mapping

todos:
- [ ] implement external file enum behavior
- [ ] implement templating on body content

Signed-off-by: Sven Kanoldt <sven@d34dl0ck.me>
@sassman sassman changed the title rest client plugin http language file format support http language file format support Jan 7, 2023
@sassman sassman added this to the http language milestone Jan 7, 2023
@sassman sassman added the enhancement New feature or request label Jan 7, 2023
sassman added a commit that referenced this issue Feb 1, 2023
## CAUTION! This is an experiment

The whole reason for this experiment is to get closer to the http plugin template syntax as linked in #5

There the vscode plugin [has this concept of system variables](https://marketplace.visualstudio.com/items?itemName=humao.rest-client#system-variables) that follow the syntax of a mix of expression and function e.g.

- {{$randomInt min max}}: Returns a random integer between min (included) and max (excluded)
- {{$dotenv [%]variableName}}: Returns the environment value stored in the .env file which exists in the same directory of your .http file.

Both examples show that `$<ident>` is similar to a function name and then a variable argument list is passed without any braces like `()`.

This experiment focuses on the ability to register functions for this very system variable syntax at compile time in an extensible fashion.

done so far:
- lexing and parsing of very basic templates with an expression `{{ var }}`
- basic runtime to interpret the ast
- some tests added
- design of a Visitor pattern for the AST

yet open
- [ ] tests for unhappy path are to less
- [ ] runtime is very incomplete yet, `SysVar` hooked functions are missing e.g. `hello {{ $processEnv HOME }}`

Signed-off-by: Sven Kanoldt <sven@d34dl0ck.me>
sassman added a commit that referenced this issue Feb 1, 2023
## CAUTION! This is an experiment

The whole reason for this experiment is to get closer to the http plugin template syntax as linked in #5

There the vscode plugin [has this concept of system variables](https://marketplace.visualstudio.com/items?itemName=humao.rest-client#system-variables) that follow the syntax of a mix of expression and function e.g.

- {{$randomInt min max}}: Returns a random integer between min (included) and max (excluded)
- {{$dotenv [%]variableName}}: Returns the environment value stored in the .env file which exists in the same directory of your .http file.

Both examples show that `$<ident>` is similar to a function name and then a variable argument list is passed without any braces like `()`.

This experiment focuses on the ability to register functions for this very system variable syntax at compile time in an extensible fashion.

done so far:
- lexing and parsing of very basic templates with an expression `{{ var }}`
- basic runtime to interpret the AST
- some tests added
- design of a Visitor pattern for the AST

yet open
- [ ] tests for unhappy path are to less
- [ ] runtime is very incomplete yet, `SysVar` hooked functions are missing e.g. `hello {{ $processEnv HOME }}`

Signed-off-by: Sven Kanoldt <sven@d34dl0ck.me>
sassman added a commit that referenced this issue Feb 9, 2023
## CAUTION! This is an experiment

The whole reason for this experiment is to get closer to the http plugin template syntax as linked in #5

There the vscode plugin [has this concept of system variables](https://marketplace.visualstudio.com/items?itemName=humao.rest-client#system-variables) that follow the syntax of a mix of expression and function e.g.

- {{$randomInt min max}}: Returns a random integer between min (included) and max (excluded)
- {{$dotenv [%]variableName}}: Returns the environment value stored in the .env file which exists in the same directory of your .http file.

Both examples show that `$<ident>` is similar to a function name and then a variable argument list is passed without any braces like `()`.

This experiment focuses on the ability to register functions for this very system variable syntax at compile time in an extensible fashion.

done so far:
- lexing and parsing of very basic templates with an expression `{{ var }}`
- basic runtime to interpret the AST
- some tests added
- design of a Visitor pattern for the AST

yet open
- [ ] tests for unhappy path are to less
- [ ] runtime is very incomplete yet, `SysVar` hooked functions are missing e.g. `hello {{ $processEnv HOME }}`

Signed-off-by: Sven Kanoldt <sven@d34dl0ck.me>
sassman added a commit that referenced this issue Feb 28, 2023
The whole reason for this experiment is to get closer to the http plugin template syntax as linked in #5
There the vscode plugin [has this concept of system variables](https://marketplace.visualstudio.com/items?itemName=humao.rest-client#system-variables) that follow the syntax of a mix of expression and function e.g.

- {{$randomInt min max}}: Returns a random integer between min (included) and max (excluded)
- {{$dotenv [%]variableName}}: Returns the environment value stored in the .env file which exists in the same directory of your .http file.

Both examples show that `$<ident>` is similar to a function name and then a variable argument list is passed without any braces like `()`.

This experiment focuses on the ability to register functions for this very system variable syntax at compile time in an extensible fashion.

done so far:
- lexing and parsing of very basic templates with an expression `{{ var }}`
- basic runtime to interpret the AST
- some tests added
- design of a Visitor pattern for the AST

yet open
- [ ] tests for unhappy path are to less
- [ ] runtime is very incomplete yet, `SysVar` hooked functions are missing e.g. `hello {{ $processEnv HOME }}`
sassman added a commit that referenced this issue Feb 28, 2023
The whole reason for this experiment is to get closer to the http plugin template syntax as linked in #5
There the vscode plugin [has this concept of system variables](https://marketplace.visualstudio.com/items?itemName=humao.rest-client#system-variables) that follow the syntax of a mix of expression and function e.g.

- {{$randomInt min max}}: Returns a random integer between min (included) and max (excluded)
- {{$dotenv [%]variableName}}: Returns the environment value stored in the .env file which exists in the same directory of your .http file.

Both examples show that `$<ident>` is similar to a function name and then a variable argument list is passed without any braces like `()`.

This experiment focuses on the ability to register functions for this very system variable syntax at compile time in an extensible fashion.

done so far:
- lexing and parsing of very basic templates with an expression `{{ var }}`
- basic runtime to interpret the AST
- some tests added
- design of a Visitor pattern for the AST

yet open
- [ ] tests for unhappy path are to less
- [ ] runtime is very incomplete yet, `SysVar` hooked functions are missing e.g. `hello {{ $processEnv HOME }}`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant