Include raw file contents in file object data
Stewart Southern
Currently when mapping a GitLab file type you receive the following data:
{
"file_name": "file.yaml",
"file_path": "file.yaml",
"size": 123,
"encoding": "base64",
"content_sha256": "<some hash>",
"ref": "main",
"blob_id": "<blob_id>",
"commit_id": "<current_commit_id_of_repo>",
"last_commit_id": "<latest_commit_to_file>",
"execute_filemode": false,
"content": {
foo: {
bar: "abc"
}
}
}
This parses the yaml, which is great for many use cases, but it looses the comments. There are some usecases where the comments may also be useful. For example, IntelliJ IDEA lets you specify a jsonschema to use for validation as a comment. Being able to extract the version being used could be useful in Port.
Could a content_raw field be added?
{
"file_name": "file.yaml",
"file_path": "file.yaml",
"size": 123,
"encoding": "base64",
"content_sha256": "<some hash>",
"ref": "main",
"blob_id": "<blob_id>",
"commit_id": "<current_commit_id_of_repo>",
"last_commit_id": "<latest_commit_to_file>",
"execute_filemode": false,
"content": {
foo: {
bar: "abc"
}
}
"content_raw": "# $schema: http://some-json-schema\nfoo: {\n bar: \"abc\"\n}"
}