File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
src/Microsoft.OpenApi.Workbench Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 11
11
using Microsoft . OpenApi . Extensions ;
12
12
using Microsoft . OpenApi . Models ;
13
13
using Microsoft . OpenApi . Reader ;
14
+ using Microsoft . OpenApi . Readers ;
14
15
using Microsoft . OpenApi . Services ;
15
16
using Microsoft . OpenApi . Validations ;
16
17
@@ -158,6 +159,7 @@ public OpenApiSpecVersion Version
158
159
_version = value ;
159
160
OnPropertyChanged ( nameof ( IsV2_0 ) ) ;
160
161
OnPropertyChanged ( nameof ( IsV3_0 ) ) ;
162
+ OnPropertyChanged ( nameof ( IsV3_1 ) ) ;
161
163
}
162
164
}
163
165
@@ -185,6 +187,12 @@ public bool IsV3_0
185
187
set => Version = OpenApiSpecVersion . OpenApi3_0 ;
186
188
}
187
189
190
+ public bool IsV3_1
191
+ {
192
+ get => Version == OpenApiSpecVersion . OpenApi3_1 ;
193
+ set => Version = OpenApiSpecVersion . OpenApi3_1 ;
194
+ }
195
+
188
196
/// <summary>
189
197
/// Handling method when the property with given name has changed.
190
198
/// </summary>
@@ -203,6 +211,9 @@ protected void OnPropertyChanged(string propertyName)
203
211
/// </summary>
204
212
internal async Task ParseDocumentAsync ( )
205
213
{
214
+ OpenApiReaderRegistry . RegisterReader ( OpenApiConstants . Yaml , new OpenApiYamlReader ( ) ) ;
215
+ OpenApiReaderRegistry . RegisterReader ( OpenApiConstants . Yml , new OpenApiYamlReader ( ) ) ;
216
+
206
217
Stream stream = null ;
207
218
try
208
219
{
Original file line number Diff line number Diff line change 40
40
</StackPanel >
41
41
<StackPanel Orientation =" Horizontal" VerticalAlignment =" Center" >
42
42
<Label >Version:</Label >
43
+ <RadioButton GroupName =" Format" Content =" V3.1.0" Padding =" 5" Height =" 24" VerticalAlignment =" Top" IsChecked =" {Binding IsV3_1}" />
43
44
<RadioButton GroupName =" Format" Content =" V3.0.1" Padding =" 5" Height =" 24" VerticalAlignment =" Top" IsChecked =" {Binding IsV3_0}" />
44
45
<RadioButton GroupName =" Format" Content =" V2.0" Padding =" 5" Height =" 24" VerticalAlignment =" Top" IsChecked =" {Binding IsV2_0}" />
45
46
</StackPanel >
You can’t perform that action at this time.
0 commit comments