File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
src/dashboard/Synapse.Dashboard/Services Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ namespace Synapse.Dashboard.Services;
23
23
public class SpecificationSchemaManager ( IYamlSerializer yamlSerializer , HttpClient httpClient )
24
24
{
25
25
26
- Dictionary < string , string > _knownSchemas = new Dictionary < string , string > ( ) ;
26
+ readonly Dictionary < string , string > _knownSchemas = [ ] ;
27
27
28
28
string ? _latestVersion = null ;
29
29
@@ -56,7 +56,7 @@ public async Task<string> GetLatestVersion()
56
56
/// <returns>A awaitable task</returns>
57
57
public async Task < string > GetSchema ( string version )
58
58
{
59
- if ( this . _knownSchemas . ContainsKey ( version ) ) return this . _knownSchemas [ version ] ;
59
+ if ( _knownSchemas . TryGetValue ( version , out string ? value ) ) return value ;
60
60
var address = $ "https://raw.githubusercontent.com/serverlessworkflow/specification/{ version } /schema/workflow.yaml";
61
61
var yamlSchema = await this . HttpClient . GetStringAsync ( address ) ;
62
62
this . _knownSchemas . Add ( version , this . YamlSerializer . ConvertToJson ( yamlSchema ) ) ;
You can’t perform that action at this time.
0 commit comments