@@ -87,7 +87,7 @@ private static void PatchRequestParameters(ApiEndpoint endpoint)
8787 private static void PatchOfficialSpec ( JObject original , string jsonFile )
8888 {
8989 var directory = Path . GetDirectoryName ( jsonFile ) ;
90- var patchFile = Path . Combine ( directory , ".." , "_Patches" , Path . GetFileNameWithoutExtension ( jsonFile ) ) + ".patch.json" ;
90+ var patchFile = Path . Combine ( directory ! , ".." , "_Patches" , Path . GetFileNameWithoutExtension ( jsonFile ) ) + ".patch.json" ;
9191 if ( ! File . Exists ( patchFile ) ) return ;
9292
9393 var patchedJson = JObject . Parse ( File . ReadAllText ( patchFile ) ) ;
@@ -103,9 +103,7 @@ private static void PatchOfficialSpec(JObject original, string jsonFile)
103103
104104 var methodsOverride = patchedJson . SelectToken ( "*.methods" ) ;
105105 if ( methodsOverride != null )
106- {
107106 original . SelectToken ( "*.methods" ) . Replace ( methodsOverride ) ;
108- }
109107
110108 var paramsOverride = patchedJson . SelectToken ( "*.params" ) ;
111109 var originalParams = original . SelectToken ( "*.url.params" ) as JObject ;
@@ -179,7 +177,7 @@ private static void TransformNewSpecStructureToOld(JObject original)
179177
180178 var newUrl = new JObject
181179 {
182- [ "paths" ] = new JArray ( paths . ToArray ( ) ) ,
180+ [ "paths" ] = new JArray ( paths . Cast < object > ( ) . ToArray ( ) ) ,
183181 } ;
184182
185183 if ( spec . ContainsKey ( "params" ) )
@@ -192,10 +190,10 @@ private static void TransformNewSpecStructureToOld(JObject original)
192190 newUrl [ "parts" ] = parts ;
193191
194192 if ( deprecatedPaths . Any ( ) )
195- newUrl [ "deprecated_paths" ] = new JArray ( deprecatedPaths . ToArray ( ) ) ;
193+ newUrl [ "deprecated_paths" ] = new JArray ( deprecatedPaths . Cast < object > ( ) . ToArray ( ) ) ;
196194
197195 spec [ "url" ] = newUrl ;
198- spec [ "methods" ] = new JArray ( methods . ToArray ( ) ) ;
196+ spec [ "methods" ] = new JArray ( methods . Cast < object > ( ) . ToArray ( ) ) ;
199197 }
200198 }
201199}
0 commit comments