Skip to content

Commit da43b73

Browse files
committed
Switch directive order.
1 parent c5cddeb commit da43b73

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/readme.graph.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,19 @@ directive:
293293
verb: Get
294294
subject: $2$1
295295
# Add AfterToJson
296+
- from: source-file-csharp
297+
where: $
298+
transform: >
299+
if (!$documentPath.match(/generated%5Capi%5CModels%5CMicrosoftGraph\w*.json.cs/gm))
300+
{
301+
return $;
302+
} else {
303+
let afterJsonDeclarationRegex = /(^\s*)(partial\s*void\s*AfterFromJson\s*\(Microsoft.Graph.PowerShell.Runtime.Json.JsonObject\s*json\s*\);$)/gm
304+
$ = $.replace(afterJsonDeclarationRegex, '$1$2\n$1partial void AfterToJson(ref Microsoft.Graph.PowerShell.Runtime.Json.JsonObject container, Microsoft.Graph.PowerShell.Runtime.SerializationMode serializationMode);\n');
305+
let afterJsonRegex = /(^\s*)(AfterToJson\(ref\s*container\s*\);$)/gm
306+
$ = $.replace(afterJsonRegex, '$1$2\n$1AfterToJson(ref container, serializationMode);\n');
307+
return $;
308+
}
296309
- from: source-file-csharp
297310
where: $
298311
transform: >
@@ -316,17 +329,4 @@ directive:
316329
}
317330
return $;
318331
}
319-
- from: source-file-csharp
320-
where: $
321-
transform: >
322-
if (!$documentPath.match(/generated%5Capi%5CModels%5CMicrosoftGraph\w*.json.cs/gm))
323-
{
324-
return $;
325-
} else {
326-
let afterJsonDeclarationRegex = /(^\s*)(partial\s*void\s*AfterFromJson\s*\(Microsoft.Graph.PowerShell.Runtime.Json.JsonObject\s*json\s*\);$)/gm
327-
$ = $.replace(afterJsonDeclarationRegex, '$1$2\n$1partial void AfterToJson(ref Microsoft.Graph.PowerShell.Runtime.Json.JsonObject container, Microsoft.Graph.PowerShell.Runtime.SerializationMode serializationMode);\n');
328-
let afterJsonRegex = /(^\s*)(AfterToJson\(ref\s*container\s*\);$)/gm
329-
$ = $.replace(afterJsonRegex, '$1$2\n$1AfterToJson(ref container, serializationMode);\n');
330-
return $;
331-
}
332332
```

0 commit comments

Comments
 (0)