@@ -133,8 +133,16 @@ pub enum RecognizedSchemaVersion {
133133 /// Represents `v3` schema folder.
134134 #[ default]
135135 V3 ,
136+ /// Represents the `v3.1` schema folder.
137+ V3_1 ,
138+ /// Represents the `v3.1.0` schema folder.
139+ V3_1_0 ,
136140 /// Represents the `v3.0` schema folder.
137141 V3_0 ,
142+ /// Represents the `v3.0.2` schema folder.
143+ V3_0_2 ,
144+ /// Represents the `v3.0.1` schema folder.
145+ V3_0_1 ,
138146 /// Represents the `v3.0.0` schema folder.
139147 V3_0_0 ,
140148}
@@ -143,7 +151,11 @@ impl std::fmt::Display for RecognizedSchemaVersion {
143151 fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
144152 match self {
145153 Self :: V3 => write ! ( f, "v3" ) ,
154+ Self :: V3_1 => write ! ( f, "v3.1" ) ,
155+ Self :: V3_1_0 => write ! ( f, "v3.1.0" ) ,
146156 Self :: V3_0 => write ! ( f, "v3.0" ) ,
157+ Self :: V3_0_2 => write ! ( f, "v3.0.2" ) ,
158+ Self :: V3_0_1 => write ! ( f, "v3.0.1" ) ,
147159 Self :: V3_0_0 => write ! ( f, "v3.0.0" ) ,
148160 }
149161 }
@@ -155,21 +167,25 @@ impl RecognizedSchemaVersion {
155167 pub fn all ( ) -> Vec < RecognizedSchemaVersion > {
156168 vec ! [
157169 Self :: V3 ,
170+ Self :: V3_1 ,
171+ Self :: V3_1_0 ,
158172 Self :: V3_0 ,
173+ Self :: V3_0_2 ,
174+ Self :: V3_0_1 ,
159175 Self :: V3_0_0 ,
160176 ]
161177 }
162178
163179 //// Returns the latest version with major, minor, and patch segments, like `3.0.0`.
164180 #[ must_use]
165181 pub fn latest ( ) -> RecognizedSchemaVersion {
166- Self :: V3_0_0
182+ Self :: V3_1_0
167183 }
168184
169185 /// Returns the latest minor version for the latest major version, like `3.0`.
170186 #[ must_use]
171187 pub fn latest_minor ( ) -> RecognizedSchemaVersion {
172- Self :: V3_0
188+ Self :: V3_1
173189 }
174190
175191 /// Returns the latest major version, like `3`
@@ -519,22 +535,46 @@ mod test {
519535 fn test_get_recognized_schema_uris ( ) {
520536 let expected: Vec < String > = vec ! [
521537 "https://aka.ms/dsc/schemas/v3/bundled/config/document.json" . to_string( ) ,
538+ "https://aka.ms/dsc/schemas/v3.1/bundled/config/document.json" . to_string( ) ,
539+ "https://aka.ms/dsc/schemas/v3.1.0/bundled/config/document.json" . to_string( ) ,
522540 "https://aka.ms/dsc/schemas/v3.0/bundled/config/document.json" . to_string( ) ,
541+ "https://aka.ms/dsc/schemas/v3.0.2/bundled/config/document.json" . to_string( ) ,
542+ "https://aka.ms/dsc/schemas/v3.0.1/bundled/config/document.json" . to_string( ) ,
523543 "https://aka.ms/dsc/schemas/v3.0.0/bundled/config/document.json" . to_string( ) ,
524544 "https://aka.ms/dsc/schemas/v3/bundled/config/document.vscode.json" . to_string( ) ,
545+ "https://aka.ms/dsc/schemas/v3.1/bundled/config/document.vscode.json" . to_string( ) ,
546+ "https://aka.ms/dsc/schemas/v3.1.0/bundled/config/document.vscode.json" . to_string( ) ,
525547 "https://aka.ms/dsc/schemas/v3.0/bundled/config/document.vscode.json" . to_string( ) ,
548+ "https://aka.ms/dsc/schemas/v3.0.2/bundled/config/document.vscode.json" . to_string( ) ,
549+ "https://aka.ms/dsc/schemas/v3.0.1/bundled/config/document.vscode.json" . to_string( ) ,
526550 "https://aka.ms/dsc/schemas/v3.0.0/bundled/config/document.vscode.json" . to_string( ) ,
527551 "https://aka.ms/dsc/schemas/v3/config/document.json" . to_string( ) ,
552+ "https://aka.ms/dsc/schemas/v3.1/config/document.json" . to_string( ) ,
553+ "https://aka.ms/dsc/schemas/v3.1.0/config/document.json" . to_string( ) ,
528554 "https://aka.ms/dsc/schemas/v3.0/config/document.json" . to_string( ) ,
555+ "https://aka.ms/dsc/schemas/v3.0.2/config/document.json" . to_string( ) ,
556+ "https://aka.ms/dsc/schemas/v3.0.1/config/document.json" . to_string( ) ,
529557 "https://aka.ms/dsc/schemas/v3.0.0/config/document.json" . to_string( ) ,
530558 "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/config/document.json" . to_string( ) ,
559+ "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.1/bundled/config/document.json" . to_string( ) ,
560+ "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.1.0/bundled/config/document.json" . to_string( ) ,
531561 "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/config/document.json" . to_string( ) ,
562+ "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.2/bundled/config/document.json" . to_string( ) ,
563+ "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.1/bundled/config/document.json" . to_string( ) ,
532564 "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/config/document.json" . to_string( ) ,
533565 "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/config/document.vscode.json" . to_string( ) ,
566+ "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.1/bundled/config/document.vscode.json" . to_string( ) ,
567+ "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.1.0/bundled/config/document.vscode.json" . to_string( ) ,
534568 "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/config/document.vscode.json" . to_string( ) ,
569+ "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.2/bundled/config/document.vscode.json" . to_string( ) ,
570+ "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.1/bundled/config/document.vscode.json" . to_string( ) ,
535571 "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/config/document.vscode.json" . to_string( ) ,
536572 "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/config/document.json" . to_string( ) ,
573+ "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.1/config/document.json" . to_string( ) ,
574+ "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.1.0/config/document.json" . to_string( ) ,
537575 "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/config/document.json" . to_string( ) ,
576+ "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.2/config/document.json" . to_string( ) ,
577+ "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.1/config/document.json" . to_string( ) ,
538578 "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.json" . to_string( ) ,
539579 ] ;
540580
@@ -544,7 +584,10 @@ mod test {
544584 true
545585 ) ;
546586
547- assert_eq ! ( expected, actual)
587+ for ( index, expected_uri) in expected. iter ( ) . enumerate ( ) {
588+ assert_eq ! ( * expected_uri, actual[ index] ) ;
589+ }
590+ // assert_eq!(expected, actual)
548591 }
549592
550593 #[ test]
0 commit comments