From ebe98eb7b4c4d28052960bd5908f481f1c7485d6 Mon Sep 17 00:00:00 2001 From: Auto Gen Date: Fri, 20 Dec 2024 16:15:02 -0800 Subject: [PATCH 1/3] Add Tutorial 17 on using a limit extension --- tutorials/README.md | 1 + tutorials/Tutorial17_UseALimitExtension.md | 284 +++++++++++++++++ tutorials/projects/Tutorial17/Program.g.cs | 285 ++++++++++++++++++ .../projects/Tutorial17/Tutorial17.csproj | 12 + tutorials/projects/Tutorial17/expect.txt | 9 + tutorials/projects/Tutorials.sln | 6 + 6 files changed, 597 insertions(+) create mode 100644 tutorials/Tutorial17_UseALimitExtension.md create mode 100644 tutorials/projects/Tutorial17/Program.g.cs create mode 100644 tutorials/projects/Tutorial17/Tutorial17.csproj create mode 100644 tutorials/projects/Tutorial17/expect.txt diff --git a/tutorials/README.md b/tutorials/README.md index 2b2d99e3..e1562783 100644 --- a/tutorials/README.md +++ b/tutorials/README.md @@ -23,3 +23,4 @@ * [Validate data against schema definitions](./Tutorial14_ValidateDataAgainstSchemaDefinitions.md) * [Set limit on allowed DTDL version](./Tutorial15_SetLimitOnAllowedDtdlVersion.md) * [Validate and inspect a contextually incomplete model](./Tutorial16_ValidateAndInspectAContextuallyIncompleteModel.md) +* [Use a limit extension](./Tutorial17_UseALimitExtension.md) diff --git a/tutorials/Tutorial17_UseALimitExtension.md b/tutorials/Tutorial17_UseALimitExtension.md new file mode 100644 index 00000000..d4549a8b --- /dev/null +++ b/tutorials/Tutorial17_UseALimitExtension.md @@ -0,0 +1,284 @@ +# Use a limit extension + +The `ModelParser` class is used to determine whether one or more DTDL models are valid, to identify specific modeling errors, and to enable inspection of model contents. +This tutorial walks through an aspect of the first use: determining model validity for applications wherein models can exceed the standard limits of the DTDL language. + +## Create a ModelParser + +To parse a DTDL model, you need to instantiate a `ModelParser`. +No arguments are required. + +```C# Snippet:DtdlParserTutorial17_CreateModelParser +var modelParser = new ModelParser(); +``` + +## Obtain the JSON text of a DTDL model that exceeds the standard limits + +The DTDL language is syntactically JSON. +The `ModelParser` expects a single string or an enumeration of strings. +The single string or each value in the enumeration is JSON text of a DTDL model. +The following model defines a 10-dimensional Array, which is beyond the maximum schema depth permitted in DTDL v4. + +```C# Snippet:DtdlParserTutorial17_ObtainDtdlText +string jsonText = +@"{ + ""@context"": ""dtmi:dtdl:context;4"", + ""@id"": ""dtmi:example:anInterface;1"", + ""@type"": ""Interface"", + ""schemas"": [ + { + ""@id"": ""dtmi:example:deepArray;1"", + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": ""double"" + } + } + } + } + } + } + } + } + } + } + ] +}"; +``` + +This is not a very useful model, but it is sufficient to illustrate the point of this tutorial. + +## Submit the JSON text to the ModelParser + +The main synchronous method on the `ModelParser` is `Parse()`. +One argument is required, which can be either a string or an enumeration of strings containing the JSON text to parse as DTDL. +If the submitted model is invalid, a `ParsingException` will be thrown. + +```C# Snippet:DtdlParserTutorial17_CallParse +try +{ + var objectModel = modelParser.Parse(jsonText); + Console.WriteLine($"DTDL model is valid!"); +} +catch (ResolutionException ex) +{ + Console.WriteLine($"DTDL model is referentially incomplete: {ex}"); +} +catch (ParsingException ex) +{ + Console.WriteLine("DTDL model is invalid:"); + foreach (ParsingError err in ex.Errors) + { + Console.WriteLine(err); + } +} +``` + +## Observe parsing errors + +The `ParsingException` has a property named `Errors` that is a collection of `ParsingError` objects, each of which provides details about one error in the submitted model. +This class also overrides the `ToString()` method to provide a human-readable description of the error. + +For the JSON text above, the code snippet above will display the following: + +```Console +DTDL model is invalid: +dtmi:example:deepArray;1 has 'elementSchema' value which is at the root of a hierarchy that exceeds 8 levels -- element is at level 9. Change the value of one or more properties of elements in the hierarchy to reduce the nesting depth. +dtmi:example:deepArray;1 is at the root of a hierarchy that exceeds 8 levels -- element is at level 9. Change the value of one or more properties of elements in the hierarchy to reduce the nesting depth. +``` + +The schema definition "dtmi:example:deepArray;1" contains 10 levels of nested schema definitions. +This exceeds the DTDL v4 standard limit of 8 nested levels of schema definitions, so it is flagged as an error by the parser. + +A 10-level nested definition contains a 9-level nested definition, which in turn contains an 8-level definition, and so on. +The 9-level nested definition also exceeds the DTDL v4 standard limit, so this definition is also flagged as an error. +The definition is the value of the "elementSchema" property of "dtmi:example:deepArray;1". + +## Specify the Onvif limit extension and resubmit + +Beginning with DTDL v4, a model is able to specify a *limit extension* to indicate the set of limits the model is written against. +Limit extensions define increased values for one or more numerical limits on DTDL property values. +In particular, the Onvif limit extension increases the maximum nested schema depth to 24 levels, which is far beyond the schema depth permitted by the standard DTDL v4 limits. + +To use a limit extension, a model includes the context specfier for the extension, which for the Onvif extension is "dtmi:dtdl:limits:onvif;1". +However, the model must not also indicate the standard DTDL limits, which are defined by the DTDL language definitions that are referenced by the DTDL context, such as "dtmi:dtdl:context;4" for DTDL v4. +Instead, the model should reference the subset of the DTDL language definitions that do not define any limits. +This is done by appending an IRI fragment to the DTDL context specifier to indicate the "limitless" subset of the DTDL language. +This is then followed by the context specifier for the limit extension, as shown below. + +```C# Snippet:DtdlParserTutorial17_AddOnvifContext +jsonText = +@"{ + ""@context"": [ + ""dtmi:dtdl:context;4#limitless"", + ""dtmi:dtdl:limits:onvif;1"" + ], + ""@id"": ""dtmi:example:anInterface;1"", + ""@type"": ""Interface"", + ""schemas"": [ + { + ""@id"": ""dtmi:example:deepArray;1"", + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": ""double"" + } + } + } + } + } + } + } + } + } + } + ] +}"; +``` + +[repeat]: # (Snippet:DtdlParserTutorial17_CallParse) + +When this revised JSON text is submitted via the code snippet above, it displays: + +```Console +DTDL model is invalid: +@context specifier 'dtmi:dtdl:limits:onvif;1' is not an acceptable limit extension. Replace the @context specifier with an acceptable limit context value: "dtmi:dtdl:context;4#limits". +``` + +## Specify the standard DTDL limits via a limit context and resubmit + +At this point, the parser is not complaining that the model exceeds a limit. +The parser is complaining that the model specifies a limit extension that is not acceptable. +The error message indicates the limit extension values that would be acceptable, of which there is exactly one: "dtmi:dtdl:context;4#limits". +This is the context specifier for the subset of the DTDL language that defines the standard limits, as indicated by the IRI fragment "limits" at the end of the context DTMI. + +Let's see what happens if we replace the limit context "dtmi:dtdl:limits:onvif;1" with "dtmi:dtdl:context;4#limits", per the recommendation in the error message: + +```C# Snippet:DtdlParserTutorial17_StandardLimitContext +jsonText = +@"{ + ""@context"": [ + ""dtmi:dtdl:context;4#limitless"", + ""dtmi:dtdl:context;4#limits"" + ], + ""@id"": ""dtmi:example:anInterface;1"", + ""@type"": ""Interface"", + ""schemas"": [ + { + ""@id"": ""dtmi:example:deepArray;1"", + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": ""double"" + } + } + } + } + } + } + } + } + } + } + ] +}"; +``` + +[repeat]: # (Snippet:DtdlParserTutorial17_CallParse) + +When we submit this to the code snippet above, the output is: + +```Console +DTDL model is invalid: +dtmi:example:deepArray;1 has 'elementSchema' value which is at the root of a hierarchy that exceeds 8 levels -- element is at level 9. Change the value of one or more properties of elements in the hierarchy to reduce the nesting depth. +dtmi:example:deepArray;1 is at the root of a hierarchy that exceeds 8 levels -- element is at level 9. Change the value of one or more properties of elements in the hierarchy to reduce the nesting depth. +``` + +This is the same error message we saw before, when the context was "dtmi:dtdl:context;4". +This is because the contexts "dtmi:dtdl:context;4#limitless" and "dtmi:dtdl:context;4#limits", taken together, say to include the limitles subset of the DTDL v4 language and the limits subset of the DTDL v4 language. +When combined, these two subsets comprise the entire DTDL language, so this is equivalent to the context "dtmi:dtdl:context;4". + +## Configure the parser to accept the Onvif limit extension and resubmit + +The problem we saw above when using the Onvif limit context was not really in the model. +The error message said the model was invalid, but it was only invalid by virtue of the parser's configuration. +In common scenarios, model authors will not have access to the parser directly but will instead be using a service or tool that employs the parser with a pre-set configuration. +In such scenarios, the error message accurately conveys to the model author that the model is not valid for the given service or tool, and it lists the limit contexts that are acceptable, which by default includes only the standard DTDL limits. + +If the maintainer of a service or tool has validated that higher limits will not pose a problem, the maintainer can configure the parser to accept limit extensions whose defined limits are tolerable to the service or tool. +This is done via tha `ParsingOptions` class, which is used to set options for `ModelParser` behavior. + +The following snippet instantiates an instance of the `ParsingOptions` class, adds a DTMI for the Onvif limit extension to the `ExtensionLimitContexts` property, and instantiates a new `ModelParser` with the configured options: + +```C# Snippet:DtdlParserTutorial17_NewParserWithOptions +ParsingOptions parsingOptions = new ParsingOptions(); +parsingOptions.ExtensionLimitContexts.Add(new Dtmi("dtmi:dtdl:limits:onvif")); +modelParser = new ModelParser(parsingOptions); +``` + +The DTMI that is added to `ExtensionLimitContexts` is "dtmi:dtdl:limits:onvif", which is a versionless form of the Onvif limit extension context "dtmi:dtdl:limits:onvif;1". +When an `ExtensionLimitContexts` value has no version suffix, this indicates that all major/minor versions of the indicated limit extension are acceptable. +In the above case, the parser would accept not only "dtmi:dtdl:limits:onvif;1", but also "dtmi:dtdl:limits:onvif;2", "dtmi:dtdl:limits:onvif;3", or "dtmi:dtdl:limits:onvif;3.14" if the given version has been defined. + +When an `ExtensionLimitContexts` value has a version suffix, the parser will accept the indicated major version and all equal or greater minor versions. +For example, a value of "dtmi:dtdl:limits:onvif;2.2" would accept "dtmi:dtdl:limits:onvif;2.2", "dtmi:dtdl:limits:onvif;2.3", or "dtmi:dtdl:limits:onvif;3", if the given version has been defined, but not "dtmi:dtdl:limits:onvif;1", "dtmi:dtdl:limits:onvif;2", or "dtmi:dtdl:limits:onvif;2.1". + +Now, we can resumbit the DTDL model with the Onvif context to the parser. + +[repeat]: # (Snippet:DtdlParserTutorial17_AddOnvifContext) + +[repeat]: # (Snippet:DtdlParserTutorial17_CallParse) + +The Onvif extension is acceptable to the parser because of the `ExtensionLimitContexts` addition, and the model does not exceed the Onvif limits, so the code snippet above will display: + +```Console +DTDL model is valid! +``` diff --git a/tutorials/projects/Tutorial17/Program.g.cs b/tutorials/projects/Tutorial17/Program.g.cs new file mode 100644 index 00000000..4d6667f6 --- /dev/null +++ b/tutorials/projects/Tutorial17/Program.g.cs @@ -0,0 +1,285 @@ +/* This file was automatically generated from code snippets embedded in file Tutorial17_UseALimitExtension.md */ +/* The associated project file Tutorial17.csproj and expected output file expect.txt were also automatically generated. */ + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using DTDLParser; +using DTDLParser.Models; + +namespace Tutorial17 +{ + class Program + { + static void Main(string[] args) + { + #region Snippet:DtdlParserTutorial17_CreateModelParser + var modelParser = new ModelParser(); + #endregion + + #region Snippet:DtdlParserTutorial17_ObtainDtdlText + string jsonText = + @"{ + ""@context"": ""dtmi:dtdl:context;4"", + ""@id"": ""dtmi:example:anInterface;1"", + ""@type"": ""Interface"", + ""schemas"": [ + { + ""@id"": ""dtmi:example:deepArray;1"", + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": ""double"" + } + } + } + } + } + } + } + } + } + } + ] + }"; + #endregion + + #region Snippet:DtdlParserTutorial17_CallParse + try + { + var objectModel = modelParser.Parse(jsonText); + Console.WriteLine($"DTDL model is valid!"); + } + catch (ResolutionException ex) + { + Console.WriteLine($"DTDL model is referentially incomplete: {ex}"); + } + catch (ParsingException ex) + { + Console.WriteLine("DTDL model is invalid:"); + foreach (ParsingError err in ex.Errors) + { + Console.WriteLine(err); + } + } + #endregion + + #region Snippet:DtdlParserTutorial17_AddOnvifContext + jsonText = + @"{ + ""@context"": [ + ""dtmi:dtdl:context;4#limitless"", + ""dtmi:dtdl:limits:onvif;1"" + ], + ""@id"": ""dtmi:example:anInterface;1"", + ""@type"": ""Interface"", + ""schemas"": [ + { + ""@id"": ""dtmi:example:deepArray;1"", + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": ""double"" + } + } + } + } + } + } + } + } + } + } + ] + }"; + #endregion + + try + { + var objectModel = modelParser.Parse(jsonText); + Console.WriteLine($"DTDL model is valid!"); + } + catch (ResolutionException ex) + { + Console.WriteLine($"DTDL model is referentially incomplete: {ex}"); + } + catch (ParsingException ex) + { + Console.WriteLine("DTDL model is invalid:"); + foreach (ParsingError err in ex.Errors) + { + Console.WriteLine(err); + } + } + + #region Snippet:DtdlParserTutorial17_StandardLimitContext + jsonText = + @"{ + ""@context"": [ + ""dtmi:dtdl:context;4#limitless"", + ""dtmi:dtdl:context;4#limits"" + ], + ""@id"": ""dtmi:example:anInterface;1"", + ""@type"": ""Interface"", + ""schemas"": [ + { + ""@id"": ""dtmi:example:deepArray;1"", + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": ""double"" + } + } + } + } + } + } + } + } + } + } + ] + }"; + #endregion + + try + { + var objectModel = modelParser.Parse(jsonText); + Console.WriteLine($"DTDL model is valid!"); + } + catch (ResolutionException ex) + { + Console.WriteLine($"DTDL model is referentially incomplete: {ex}"); + } + catch (ParsingException ex) + { + Console.WriteLine("DTDL model is invalid:"); + foreach (ParsingError err in ex.Errors) + { + Console.WriteLine(err); + } + } + + #region Snippet:DtdlParserTutorial17_NewParserWithOptions + ParsingOptions parsingOptions = new ParsingOptions(); + parsingOptions.ExtensionLimitContexts.Add(new Dtmi("dtmi:dtdl:limits:onvif")); + modelParser = new ModelParser(parsingOptions); + #endregion + + jsonText = + @"{ + ""@context"": [ + ""dtmi:dtdl:context;4#limitless"", + ""dtmi:dtdl:limits:onvif;1"" + ], + ""@id"": ""dtmi:example:anInterface;1"", + ""@type"": ""Interface"", + ""schemas"": [ + { + ""@id"": ""dtmi:example:deepArray;1"", + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": { + ""@type"": ""Array"", + ""elementSchema"": ""double"" + } + } + } + } + } + } + } + } + } + } + ] + }"; + + try + { + var objectModel = modelParser.Parse(jsonText); + Console.WriteLine($"DTDL model is valid!"); + } + catch (ResolutionException ex) + { + Console.WriteLine($"DTDL model is referentially incomplete: {ex}"); + } + catch (ParsingException ex) + { + Console.WriteLine("DTDL model is invalid:"); + foreach (ParsingError err in ex.Errors) + { + Console.WriteLine(err); + } + } + } + } +} diff --git a/tutorials/projects/Tutorial17/Tutorial17.csproj b/tutorials/projects/Tutorial17/Tutorial17.csproj new file mode 100644 index 00000000..0eeb0dcc --- /dev/null +++ b/tutorials/projects/Tutorial17/Tutorial17.csproj @@ -0,0 +1,12 @@ + + + + Exe + net8.0 + + + + + + + diff --git a/tutorials/projects/Tutorial17/expect.txt b/tutorials/projects/Tutorial17/expect.txt new file mode 100644 index 00000000..ded40cab --- /dev/null +++ b/tutorials/projects/Tutorial17/expect.txt @@ -0,0 +1,9 @@ +DTDL model is invalid: +dtmi:example:deepArray;1 has 'elementSchema' value which is at the root of a hierarchy that exceeds 8 levels -- element is at level 9. Change the value of one or more properties of elements in the hierarchy to reduce the nesting depth. +dtmi:example:deepArray;1 is at the root of a hierarchy that exceeds 8 levels -- element is at level 9. Change the value of one or more properties of elements in the hierarchy to reduce the nesting depth. +DTDL model is invalid: +@context specifier 'dtmi:dtdl:limits:onvif;1' is not an acceptable limit extension. Replace the @context specifier with an acceptable limit context value: "dtmi:dtdl:context;4#limits". +DTDL model is invalid: +dtmi:example:deepArray;1 has 'elementSchema' value which is at the root of a hierarchy that exceeds 8 levels -- element is at level 9. Change the value of one or more properties of elements in the hierarchy to reduce the nesting depth. +dtmi:example:deepArray;1 is at the root of a hierarchy that exceeds 8 levels -- element is at level 9. Change the value of one or more properties of elements in the hierarchy to reduce the nesting depth. +DTDL model is valid! diff --git a/tutorials/projects/Tutorials.sln b/tutorials/projects/Tutorials.sln index 99b3b43e..9d9a52de 100644 --- a/tutorials/projects/Tutorials.sln +++ b/tutorials/projects/Tutorials.sln @@ -47,6 +47,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tutorial15", "Tutorial15\Tu EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tutorial16", "Tutorial16\Tutorial16.csproj", "{75E27C0F-B591-4D48-9ACA-AB9C9A85BE6B}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tutorial17", "Tutorial17\Tutorial17.csproj", "{9F171531-6429-42E6-AAEB-C9E6C320B8F5}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -149,6 +151,10 @@ Global {75E27C0F-B591-4D48-9ACA-AB9C9A85BE6B}.Debug|Any CPU.Build.0 = Debug|Any CPU {75E27C0F-B591-4D48-9ACA-AB9C9A85BE6B}.Release|Any CPU.ActiveCfg = Release|Any CPU {75E27C0F-B591-4D48-9ACA-AB9C9A85BE6B}.Release|Any CPU.Build.0 = Release|Any CPU + {9F171531-6429-42E6-AAEB-C9E6C320B8F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9F171531-6429-42E6-AAEB-C9E6C320B8F5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9F171531-6429-42E6-AAEB-C9E6C320B8F5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9F171531-6429-42E6-AAEB-C9E6C320B8F5}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From 85c79f10c7456f7d638ba4174ffb413178d5db51 Mon Sep 17 00:00:00 2001 From: Auto Gen Date: Thu, 26 Dec 2024 13:54:21 -0800 Subject: [PATCH 2/3] bump test framework version --- dotnet/tests/ParserUnitTest/ParserUnitTest.csproj | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/dotnet/tests/ParserUnitTest/ParserUnitTest.csproj b/dotnet/tests/ParserUnitTest/ParserUnitTest.csproj index 27107c8a..24a1662c 100644 --- a/dotnet/tests/ParserUnitTest/ParserUnitTest.csproj +++ b/dotnet/tests/ParserUnitTest/ParserUnitTest.csproj @@ -1,15 +1,11 @@  - net48;net6.0 + net8.0 8.0 false - - - - From 9f698307de21f22f409dc774506337f9742a5f4b Mon Sep 17 00:00:00 2001 From: Auto Gen Date: Thu, 26 Dec 2024 14:09:37 -0800 Subject: [PATCH 3/3] minor corrections --- tutorials/Tutorial17_UseALimitExtension.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tutorials/Tutorial17_UseALimitExtension.md b/tutorials/Tutorial17_UseALimitExtension.md index d4549a8b..e676c26b 100644 --- a/tutorials/Tutorial17_UseALimitExtension.md +++ b/tutorials/Tutorial17_UseALimitExtension.md @@ -243,7 +243,7 @@ dtmi:example:deepArray;1 is at the root of a hierarchy that exceeds 8 levels -- ``` This is the same error message we saw before, when the context was "dtmi:dtdl:context;4". -This is because the contexts "dtmi:dtdl:context;4#limitless" and "dtmi:dtdl:context;4#limits", taken together, say to include the limitles subset of the DTDL v4 language and the limits subset of the DTDL v4 language. +This is because the contexts "dtmi:dtdl:context;4#limitless" and "dtmi:dtdl:context;4#limits", taken together, say to include the limitless subset of the DTDL v4 language and the limits subset of the DTDL v4 language. When combined, these two subsets comprise the entire DTDL language, so this is equivalent to the context "dtmi:dtdl:context;4". ## Configure the parser to accept the Onvif limit extension and resubmit @@ -269,7 +269,7 @@ When an `ExtensionLimitContexts` value has no version suffix, this indicates tha In the above case, the parser would accept not only "dtmi:dtdl:limits:onvif;1", but also "dtmi:dtdl:limits:onvif;2", "dtmi:dtdl:limits:onvif;3", or "dtmi:dtdl:limits:onvif;3.14" if the given version has been defined. When an `ExtensionLimitContexts` value has a version suffix, the parser will accept the indicated major version and all equal or greater minor versions. -For example, a value of "dtmi:dtdl:limits:onvif;2.2" would accept "dtmi:dtdl:limits:onvif;2.2", "dtmi:dtdl:limits:onvif;2.3", or "dtmi:dtdl:limits:onvif;3", if the given version has been defined, but not "dtmi:dtdl:limits:onvif;1", "dtmi:dtdl:limits:onvif;2", or "dtmi:dtdl:limits:onvif;2.1". +For example, a value of "dtmi:dtdl:limits:onvif;2.2" would accept "dtmi:dtdl:limits:onvif;2.2", "dtmi:dtdl:limits:onvif;2.3", or "dtmi:dtdl:limits:onvif;2.17", if the given version has been defined, but not "dtmi:dtdl:limits:onvif;1" or "dtmi:dtdl:limits:onvif;3" (because the major version does not match the specified major version), nor "dtmi:dtdl:limits:onvif;2" or "dtmi:dtdl:limits:onvif;2.1" (because the minor version is less than the specified minor version). Now, we can resumbit the DTDL model with the Onvif context to the parser.