Skip to content

Commit

Permalink
Improved seat massager sample
Browse files Browse the repository at this point in the history
  • Loading branch information
ashbeitz committed Mar 1, 2024
1 parent 23f307b commit 667baf5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions dtdl-tools/src/dtdl-validator/DtdlValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,21 @@
using System.Threading;
using System.Threading.Tasks;

/// <summary>
/// The DTDL Validator app.
/// </summary>
class Program
{
// Exit codes.
private const int EXIT_SUCCESS = 0;
private const int EXIT_FAILURE = 1;

/// <summary>
/// Convert a DTDL file's path to a DTMI.
/// Convert a DTDL file's path to a Digital Twin Model Identifier (DTMI).
/// </summary>
/// <param name="dtdlFilePath">The DTDL file's full path.</param>
/// <param name="dtdlDirPath">The DTDL directory's path.</param>
/// <param name="extension">The extensin used by the DTDL files.</param>
/// <param name="extension">The extension used by the DTDL files.</param>
/// <returns>The corresponding DTMI.</returns>
static string ConvertToDTMI(string dtdlFilePath, string dtdlDirPath, string extension)
{
Expand Down Expand Up @@ -78,7 +81,7 @@ static int ValidateDtdl(DirectoryInfo dtdlDirectory, String extension)
{
string dtmi = ConvertToDTMI(file, dtdlDirectory.FullName, extension);
var model = modelRepoClient.GetModelAsync(dtmi).GetAwaiter().GetResult();
var dictParsed = parser.ParseAsync(model.Content[dtmi]).GetAwaiter().GetResult();
var modelDictionary = parser.ParseAsync(model.Content[dtmi]).GetAwaiter().GetResult();
Console.WriteLine($"{file} - ok");
}
catch (ParsingException ex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ internal static class ModelsRepositoryClientExtensions
{
/// <summary>
/// The Parser's DTMI resolver.
/// It asynchronously gets from the models repositpory the DTDL content associated witn each of the provided DTMIs.
/// </summary>
/// <param name="modelRepoClient">The model's repository client.</param>
/// <param name="modelRepoClient">The models repository client.</param>
/// <param name="dtmis"></param>
/// <param name="cancellationToken">The cancellation topken.</param>
/// <returns>The model definitions for the provided DTMIs.</returns>
Expand Down

0 comments on commit 667baf5

Please sign in to comment.