Skip to content

Commit

Permalink
Merge pull request #95 from ignitionrobotics/annotations
Browse files Browse the repository at this point in the history
Added support for annotation parsing during model creation
  • Loading branch information
nkoenig authored Aug 10, 2020
2 parents 9d2e18a + a230629 commit 9e5bec0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/FuelClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,14 @@ Result FuelClient::UploadModel(const std::string &_pathToModelDir,
if (!categories.empty())
form.emplace("categories", categories);

// Add annotations as metadata.
for (const auto &annotation : meta.annotations())
{
std::string formAnnotation = std::string("{\"key\":\"") +
annotation.first + "\",\"value\":\"" + annotation.second + "\"}";
form.emplace("metadata", formAnnotation);
}

// Recursively get all the files.
std::vector<std::string> files;
this->dataPtr->AllFiles(_pathToModelDir, files);
Expand Down

0 comments on commit 9e5bec0

Please sign in to comment.