forked from Azure/azure-sdk-for-js
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[EventGrid] Move to Core V2 Generator (Azure#16047)
As part of the development of the new pipeline, event grid was hand ported to use the new pipeline. Now that the code generator targets the new pipeline, we can start using it to generate the code. Since EventGrid includes the `/api/events` path segment in the Endpoint, We need to do a small amount of post processing of the generated code, to ensure `/api/events` is not appended to the endpoint (we do this by setting an empty path in the operation spec, which is as things were before moving over to the generator). Fixes Azure#15823
- Loading branch information
Showing
7 changed files
with
261 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
"use strict"; | ||
const fs = require("fs"); | ||
|
||
// The "endpoint" shown in the portal and CLI for an Azure Event Grid includes the "/api/events" | ||
// path parameter. We need to ensure that we don't add another "/api/events" suffix, but there | ||
// is not a way to express this in swagger. So, we post process the generated client to ensure | ||
// that the operation spec we build has the empty string for the path to append. | ||
console.log("Updating ./scr/generate/generateClient.ts path entries"); | ||
let data = fs.readFileSync("./src/generated/generatedClient.ts", "utf8"); | ||
data = data.replace(new RegExp('path: "/api/events"', "g"), 'path: ""'); | ||
fs.writeFileSync("./src/generated/generatedClient.ts", data, "utf8"); | ||
console.log("Done Updating ./scr/generate/generateClient.ts path entries"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.