-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from bradygaster/dev
merging to master
- Loading branch information
Showing
13 changed files
with
268 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
// Use IntelliSense to find out which attributes exist for C# debugging | ||
// Use hover for the description of the existing attributes | ||
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": ".NET Core Launch (web)", | ||
"type": "coreclr", | ||
"request": "launch", | ||
"preLaunchTask": "build", | ||
// If you have changed target frameworks, make sure to update the program path. | ||
"program": "${workspaceFolder}/Start/COVIDScreeningApi/COVIDScreeningApi/bin/Debug/netcoreapp3.1/COVIDScreeningApi.dll", | ||
"args": [], | ||
"cwd": "${workspaceFolder}/Start/COVIDScreeningApi/COVIDScreeningApi", | ||
"stopAtEntry": false, | ||
// Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser | ||
"serverReadyAction": { | ||
"action": "openExternally", | ||
"pattern": "^\\s*Now listening on:\\s+(https?://\\S+)" | ||
}, | ||
"env": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
}, | ||
"sourceFileMap": { | ||
"/Views": "${workspaceFolder}/Views" | ||
} | ||
}, | ||
{ | ||
"name": ".NET Core Attach", | ||
"type": "coreclr", | ||
"request": "attach", | ||
"processId": "${command:pickProcess}" | ||
} | ||
] | ||
} |
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,42 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "build", | ||
"command": "dotnet", | ||
"type": "process", | ||
"args": [ | ||
"build", | ||
"${workspaceFolder}/Start/COVIDScreeningApi/COVIDScreeningApi/COVIDScreeningApi.csproj", | ||
"/property:GenerateFullPaths=true", | ||
"/consoleloggerparameters:NoSummary" | ||
], | ||
"problemMatcher": "$msCompile" | ||
}, | ||
{ | ||
"label": "publish", | ||
"command": "dotnet", | ||
"type": "process", | ||
"args": [ | ||
"publish", | ||
"${workspaceFolder}/Start/COVIDScreeningApi/COVIDScreeningApi/COVIDScreeningApi.csproj", | ||
"/property:GenerateFullPaths=true", | ||
"/consoleloggerparameters:NoSummary" | ||
], | ||
"problemMatcher": "$msCompile" | ||
}, | ||
{ | ||
"label": "watch", | ||
"command": "dotnet", | ||
"type": "process", | ||
"args": [ | ||
"watch", | ||
"run", | ||
"${workspaceFolder}/Start/COVIDScreeningApi/COVIDScreeningApi/COVIDScreeningApi.csproj", | ||
"/property:GenerateFullPaths=true", | ||
"/consoleloggerparameters:NoSummary" | ||
], | ||
"problemMatcher": "$msCompile" | ||
} | ||
] | ||
} |
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
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
87 changes: 87 additions & 0 deletions
87
Start/COVIDScreeningApi/COVIDScreeningApi/Directory.Build.props
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,87 @@ | ||
<Project> | ||
|
||
<PropertyGroup> | ||
<!-- variable to persist if the customer has custom tools already --> | ||
<ToolManifestExists>false</ToolManifestExists> | ||
<!-- | ||
The docs reflect "v1" so most customers getting started with | ||
Swashbuckle use "v1" as their "document name" and their version. | ||
Swashbuckle will soon update the middlware to stop requiring the | ||
OpenApiInfo parameter, and will default the document name and version | ||
to "v1." | ||
Customers will *always* be able to change this, so if possible, | ||
we should interrogate the Startup.cs file. A sample from a | ||
Startup.cs is below, with the value we'd need to pass into | ||
DefaultSwaggerDocName highlighted. | ||
services.AddSwaggerGen(config => | ||
{ | ||
config.SwaggerDoc("v1", // THIS PARAMETER SHOULD BE USED AS THE DefaultSwaggerDocName VALUE | ||
new OpenApiInfo | ||
{ | ||
Title = "COVIDScreeningApi", | ||
Version = "v1" | ||
}); | ||
}); | ||
For now we've given them an escape hatch in the form of the OpenApiDocumentName | ||
property. In this project, the OpenApiDocumentName is used in the .csproj file | ||
to define the Open API doc's doc name. This way, a customer can change the value we | ||
pass to the Swashbuckle CLI. | ||
In the case where they don't do this, we have a target in this file that informs | ||
the customer what to do. | ||
--> | ||
<DefaultSwaggerDocName>v1</DefaultSwaggerDocName> | ||
<OpenApiDocumentName>v1</OpenApiDocumentName> | ||
</PropertyGroup> | ||
|
||
<!-- ascertain if the customer already has any custom tools --> | ||
<Target Name="CheckForManifestFile" AfterTargets="Build"> | ||
<CreateProperty Value="true" Condition="Exists('.config/dotnet-tools.json')"> | ||
<Output TaskParameter="Value" PropertyName="ToolManifestExists"/> | ||
</CreateProperty> | ||
</Target> | ||
|
||
<!-- adds the Swashbuckle CLI so we can use it to build the Swagger file --> | ||
<Target Name="InstallSwashbuckleCli" AfterTargets="CheckForManifestFile"> | ||
<!-- create the tool manifest if it doesn't exist already --> | ||
<Exec Command="dotnet new tool-manifest > swagger-log.txt" Condition="!$(ToolManifestExists)"/> | ||
<!-- install the tool into the project tool manifest --> | ||
<Exec Command="dotnet tool install Swashbuckle.AspNetCore.Cli >> swagger-log.txt"/> | ||
</Target> | ||
|
||
<!-- creates the swagger file --> | ||
<Target Name="CreateSwaggerFile" | ||
AfterTargets="InstallSwashbuckleCli"> | ||
<!-- create the swagger file --> | ||
<Exec Command="dotnet swagger tofile --output $(OutputPath)swagger.json $(OutputPath)/$(MSBuildProjectName).dll $(DefaultSwaggerDocName) >> swagger-log.txt" | ||
Condition="'$(DefaultSwaggerDocName)' == '$(OpenApiDocumentName)'" /> | ||
<Exec Command="dotnet swagger tofile --output $(OutputPath)swagger.json $(OutputPath)/$(MSBuildProjectName).dll $(OpenApiDocumentName) >> swagger-log.txt" | ||
Condition="'$(DefaultSwaggerDocName)' != '$(OpenApiDocumentName)'" /> | ||
<OnError ExecuteTargets="InformCustomerHowToOverrideSwaggerDocName"/> | ||
</Target> | ||
|
||
<!-- | ||
In the case that the customer isn't using "v1" as the Open API doc, | ||
we need to tell them how to mitigate it. | ||
--> | ||
<Target Name="InformCustomerHowToOverrideSwaggerDocName"> | ||
<Message Importance="High" | ||
Text="Tell the customers how to unbreak themselves here by setting the 'OpenApiDocumentName' property in their .csproj file to override the default."/> | ||
<CallTarget Targets="CleanUpAfterSwaggerGeneration"/> | ||
</Target> | ||
|
||
<!-- cleanup the Swashbuckle CLI dependencies --> | ||
<Target Name="CleanUpAfterSwaggerGeneration" AfterTargets="CreateSwaggerFile"> | ||
<!-- uninstall the Swashbuckle CLI, as it is no longer needed --> | ||
<Exec Command="dotnet tool uninstall Swashbuckle.AspNetCore.Cli >> swagger-log.txt" /> | ||
<!-- delete the log file of our swagger-file-creation process --> | ||
<Delete Files="swagger-log.txt" /> | ||
<!-- remove the tool manifest if we created it --> | ||
<RemoveDir Directories=".config" Condition="!$(ToolManifestExists)"/> | ||
</Target> | ||
|
||
</Project> |
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
12 changes: 12 additions & 0 deletions
12
Start/COVIDScreeningApi/COVIDScreeningApi/Properties/serviceDependencies.json
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 @@ | ||
{ | ||
"dependencies": { | ||
"secrets1": { | ||
"type": "secrets", | ||
"connectionId": "VaultUri" | ||
}, | ||
"cosmosdb1": { | ||
"type": "cosmosdb", | ||
"connectionId": "covid-screening-db" | ||
} | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
Start/COVIDScreeningApi/COVIDScreeningApi/Properties/serviceDependencies.local.json
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,16 @@ | ||
{ | ||
"dependencies": { | ||
"secrets1": { | ||
"resourceId": "/subscriptions/[parameters('subscriptionId')]/resourceGroups/[parameters('resourceGroup')]/providers/Microsoft.KeyVault/vaults/covid-api-vault", | ||
"type": "secrets.keyVault", | ||
"connectionId": "VaultUri", | ||
"secretStore": null | ||
}, | ||
"cosmosdb1": { | ||
"resourceId": "/subscriptions/[parameters('subscriptionId')]/resourceGroups/[parameters('resourceGroup')]/providers/Microsoft.DocumentDB/databaseAccounts/covid-screening-data", | ||
"type": "cosmosdb.azure", | ||
"connectionId": "covid-screening-db", | ||
"secretStore": "AzureKeyVault" | ||
} | ||
} | ||
} |
Oops, something went wrong.