-
Notifications
You must be signed in to change notification settings - Fork 1
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
Raw Byte-Array values for Bodies and FormData #67
Conversation
30ed8c5
to
17959f9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, as we already discussed, we should add docs for the new feature.
Everything else looks great so far, thanks for the contribution. 🐐
pkg/goatfile/parser.go
Outdated
func (t *Parser) parseRawDescriptor() (ast.DataContent, error) { | ||
tk, varName := t.s.scanString() | ||
if tk != tokSTRING { | ||
return ast.NoContent{}, ErrInvalidFileDescriptor | ||
} | ||
rd := ast.RawDescriptor{VarName: varName} | ||
|
||
return rd, nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, it would make sense to also add the content type specification as same as with file descriptors here.
Example:
[FormData]
image = $uploadedImage:image/png
// or
[Body]
$uploadedImage:image/png
This should be relatively easy by using the same implementation from file descriptors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Added
contentType
toRawDescriptor
- Added parameter substitution for [FormData] values
- Added documentation
In this branch, the possibility to pass raw byte arrays to the [Body] and the [FormData] blocks was added.
Documentation is still missing and will be written after first Review