This file contains hidden or 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
| import "@cadl-lang/rest"; | |
| import "@cadl-lang/openapi3"; | |
| using Cadl.Http; | |
| @serviceTitle("ConferenceService") | |
| namespace ConferenceApi { | |
| alias Error = NotFound | InternalServerError; |
This file contains hidden or 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
| openapi "3.0.1" | |
| info { | |
| title "This is interesting" | |
| version "1.0.0" | |
| } | |
| paths { | |
| /foo/{id} { | |
| get { | |
| parameters { | |
| parameter name="id" { |
This file contains hidden or 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
| Install-Module Microsoft.Graph | |
| Connect-MgGraph | |
| $Message = @{ | |
| "subject" = "Yo" | |
| "body" = @{ | |
| "content" = "Here is my message" | |
| } | |
| "toRecipients" = @( | |
| @{ |
This file contains hidden or 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
| # updated to remove my really ugly first attempt, based on awesome feedback provided. | |
| $web = @{ | |
| RedirectUris = "https://localhost:5001/signin-oidc" | |
| ImplicitGrantSettings = @{ EnableIdTokenIssuance = $true } | |
| } | |
| $createAppParams = @{ | |
| DisplayName = "AspNetWebApp" | |
| Web = $web |
This file contains hidden or 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
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| AsyncMain().GetAwaiter().GetResult(); | |
| Console.Read(); | |
| } | |
| static async Task AsyncMain() |
This file contains hidden or 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
| openapi: 3.0.0 | |
| info: | |
| title: OpenAPI Introspection API | |
| version: 1.0 | |
| paths: | |
| /tags: | |
| get: | |
| responses: | |
| 2XX: | |
| description: List of tags used in the API |
This file contains hidden or 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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Net.Http; | |
| using System.Net.Http.Headers; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| namespace ConsoleApp10 | |
| { |
This file contains hidden or 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
| IEnumerable<JServiceResponse> responseObject; | |
| using (var responseJsonStream = await client.GetStreamAsync("http://jservice.io/api/random/?count=3")) | |
| { | |
| JsonTextReader reader = new JsonTextReader(new StreamReader(responseJsonStream)); | |
| responseObject = JsonSerializer.CreateDefault().Deserialize<IEnumerable<JServiceResponse>>(reader); | |
| } |
This file contains hidden or 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
| [Fact] | |
| public void ExampleObjectShouldBeSerializable() | |
| { | |
| // Arrange | |
| var response = new OpenApiResponse() | |
| { | |
| Content = new Dictionary<string, OpenApiMediaType> | |
| { | |
| ["application/json"] = new OpenApiMediaType | |
| { |
This file contains hidden or 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
| <policies> | |
| <inbound> | |
| <base/> | |
| <rewrite-uri template="@{ | |
| var lat = 45.4272878; | |
| var lng = -73.871513; | |
| var time = "2017-04-03T19:00:00"; | |
| return $"forecast/{{forecast-key}}/{lat},{lng},{time}/?exclude=minutely,hourly,daily,flags,alerts&units=us";}"/> | |
| <set-backend-service base-url="https://api.darksky.net/"/> | |
| </inbound> |
NewerOlder