Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
202 commits
Select commit Hold shift + click to select a range
e4bc14a
experiements with workspace
darrelmiller Feb 7, 2018
c82c3cf
Fixed build
darrelmiller Feb 10, 2018
4b8b343
Merged with latest fixes for local references
darrelmiller Feb 10, 2018
dffad37
Skeleton code for OpenApiWorkspace
darrelmiller Feb 12, 2018
3d37908
Added comment
darrelmiller Feb 13, 2018
8c1493b
Merged latest changes from ref-overflow
darrelmiller Feb 13, 2018
b332d86
Merge remote-tracking branch 'origin/master' into dm/openapiworkspace
darrelmiller Mar 16, 2018
60ef50e
Workspace reference
darrelmiller Mar 18, 2018
d8df45b
Merge master
darrelmiller Mar 28, 2018
a5667a0
Who knows what is in here!
darrelmiller Mar 31, 2018
d42bd94
Resolved merge conflicts
darrelmiller Apr 8, 2018
e5893b6
Moved reference resolution into the OpenApi model project
darrelmiller Apr 8, 2018
af0b5fc
More workspace fixes
darrelmiller Apr 11, 2018
8b95987
Merge remote-tracking branch 'origin/master' into dm/openapiworkspace
darrelmiller Apr 17, 2018
1e735f4
Fixed merge conflict
darrelmiller May 20, 2018
24bb7f4
Merge remote-tracking branch 'origin/vnext' into dm/openapiworkspace
darrelmiller May 20, 2018
806c067
Fixed merge errors
darrelmiller May 20, 2018
78e7eee
Work on baseURL for workspace
darrelmiller May 21, 2018
2888256
Merge remote-tracking branch 'origin/master' into dm/openapiworkspace
darrelmiller May 24, 2018
f64e23e
Fixed location normalization
darrelmiller Oct 29, 2018
a09875d
Disabled smoke tests, all tests pass
darrelmiller May 17, 2020
46df7d2
Merged vnext
darrelmiller May 17, 2020
58434a8
Add literal style support for OpenApiYamlWriter
foriequal0 May 23, 2020
5ba458d
Pass extensions to request body parameter
asvishnyakov Jun 16, 2020
46c5f53
👋
philsturgeon Jun 17, 2020
44e5156
Updated version to 1.2.0
darrelmiller May 24, 2020
2697ebc
Added missing comment
darrelmiller May 25, 2020
c7ac039
Fixed build.cmd file
darrelmiller Jun 13, 2020
db1f10b
Fixed comment
darrelmiller Jun 13, 2020
7a8dfc5
Prevent breaking change on optional parameter #487
CumpsD Jun 22, 2020
b347672
Update version to 1.2.1
darrelmiller Jun 24, 2020
a291f32
fix OpenApiWriterBase default param addition
CumpsD Jun 24, 2020
4e73330
remove the default param that causes 2 identical ctors
CumpsD Jun 24, 2020
deb647e
make default parameter overloads binary compatible
CumpsD Jun 24, 2020
cb254da
Merge pull request #494 from microsoft/dm/updatefrommaster
darrelmiller Jun 25, 2020
f97df7e
Merge branch 'vnext' into patch-1
darrelmiller Jun 25, 2020
7ac9fd4
Merge branch 'vnext' into ExtensbleRequestBodyParameter
darrelmiller Jun 25, 2020
83fd6df
Merge branch 'vnext' into literal-style
darrelmiller Jun 25, 2020
7ccf916
Merge pull request #485 from asvishnyakov/ExtensbleRequestBodyParameter
darrelmiller Jun 25, 2020
90dc80c
Merge branch 'vnext' into patch-1
darrelmiller Jun 29, 2020
f8e4201
Merge pull request #488 from philsturgeon/patch-1
darrelmiller Jun 29, 2020
7c46deb
Merge branch 'vnext' into literal-style
darrelmiller Jun 29, 2020
e38c0d4
Simplify YAML WriteValue by not preserving newlines
foriequal0 Jul 2, 2020
bdf10c4
Better handling of the block chomping indicator
foriequal0 Jul 2, 2020
30d9969
Merge pull request #481 from foriequal0/literal-style
darrelmiller Jul 3, 2020
ec6cc5c
Updated OpenApiWalker to walk additional properties
darrelmiller Jul 3, 2020
15082fa
Updated OpenApiWalker to include walking encoding headers Issue #405
darrelmiller Jul 3, 2020
5b37f59
add public api surface test
CumpsD Jul 6, 2020
5d3e699
Merge pull request #499 from CumpsD/public-api
darrelmiller Jul 12, 2020
7c49b8b
Merge branch 'vnext' into dm/fixwalker
darrelmiller Jul 12, 2020
cb3c26b
Merge pull request #498 from microsoft/dm/fixwalker
darrelmiller Jul 13, 2020
d4572d5
Corrected expected ordering for skipped unit tests.
AndrewRissing Jul 26, 2020
1a2a22a
Removed copy pasted code from test.
AndrewRissing Jul 26, 2020
de49dcd
Modified IOpenApiReferenceable comparers to handle self-referencing r…
AndrewRissing Jul 26, 2020
19220ea
Fix OpenApiSchemaComparer Reference
AndrewRissing Jul 29, 2020
4e9c56a
Merge pull request #504 from AndrewRissing/CorrectSkippedUnitTests
darrelmiller Aug 29, 2020
a95718b
Merge pull request #506 from AndrewRissing/FixStackOverflow
darrelmiller Aug 29, 2020
8b51738
Updated vNext branch will all chances in 1.2.3
darrelmiller Aug 29, 2020
fb89abc
Fix public API test
darrelmiller Aug 29, 2020
2db9643
Merge pull request #517 from microsoft/dm/updatehotfix123
darrelmiller Aug 31, 2020
78bcdd4
Add validation rule (+ test) to create an error when a path parameter…
DCollart Oct 1, 2020
481d3bc
Fix other tests
DCollart Oct 1, 2020
9d8f02f
Added parameter to OpenApiString that allows its value to be written …
Oct 27, 2020
ccbef09
WIP; add OpenApiReferencableExtensions
simon-pearson-lmk Nov 8, 2020
b7c37fc
Referencable elements can resolve a reference with an empty JSON poin…
simon-pearson-lmk Nov 8, 2020
afcbce9
Resolve reference to 'schema' property on Parameter element
simon-pearson-lmk Nov 8, 2020
6c69605
Throw exception when we try to reference a type that cannot be refere…
simon-pearson-lmk Nov 8, 2020
7db3ea7
Refactoring of OpenApiReferencable units; add parameterised tests rep…
simon-pearson-lmk Nov 11, 2020
4eb1c6c
Add resolving references to child properties of a Header fragment
simon-pearson-lmk Nov 11, 2020
4b50cc5
Further unit tests covering ResolveReference method on IOpenApiRefere…
simon-pearson-lmk Nov 11, 2020
c86fd89
Resolve references to child properties of Response fragments
simon-pearson-lmk Nov 11, 2020
23c8417
Update implementation of OpenApiWorkspace.ResolveReference to support…
simon-pearson-lmk Sep 5, 2020
56f4524
Improve comments in OpenApiReferencableExtensions
simon-pearson-lmk Nov 11, 2020
e3ca80e
Refactoring in OpenApiReferencableExtensions to reduce duplicated code
simon-pearson-lmk Nov 12, 2020
dda0fe4
Change IOpenApiReferenceable.ResolveReference method to using the Jso…
simon-pearson-lmk Nov 13, 2020
62b7e63
The OpenApiStreamReader.ReadFragment method may only read fragments t…
simon-pearson-lmk Nov 13, 2020
60869f6
Merge pull request #520 from simon-pearson/feature/openapi-workspace-…
darrelmiller Nov 21, 2020
35a9fc5
Merged master
darrelmiller Nov 22, 2020
92bab8f
decimal.Parse() does not properly handle instances where scientific n…
EricWilson-BluePrism Nov 25, 2020
2ddc0a7
Updated openapiworkspace from vnext
darrelmiller Dec 19, 2020
e0658b6
I believe this will retrigger the build and pull request.
EricWilson-BluePrism Dec 21, 2020
1debbf2
Updated OpenApiWorkspaceLoader to support loading external references
darrelmiller Dec 21, 2020
18f2a11
When the style property on an OpenApiParameter is 'form' then the def…
simon-pearson-lmk Jan 21, 2021
d229688
Moved OpenAPIWorkspace to sync loading
darrelmiller Jan 30, 2021
4f4c12f
Merge pull request #1 from microsoft/vnext
irvinesunday Feb 3, 2021
a768b9d
Init OpenApiUrlSpaceNode and tests
irvinesunday Feb 4, 2021
e3ff269
Add license info.
irvinesunday Feb 4, 2021
bb600b4
Update src/Microsoft.OpenApi/Extensions/StringExtensions.cs
irvinesunday Feb 4, 2021
a659d3f
Update src/Microsoft.OpenApi/Services/OpenApiUrlSpaceNode.cs
irvinesunday Feb 4, 2021
876611b
Update src/Microsoft.OpenApi/Services/OpenApiUrlSpaceNode.cs
irvinesunday Feb 4, 2021
7b15e3e
Code formatting
irvinesunday Feb 4, 2021
30ad539
Update setters appropriately
irvinesunday Feb 4, 2021
f13906d
Merge remote-tracking branch 'irvinesunday/vnext' into vnext
irvinesunday Feb 4, 2021
a82a451
XML comments update
irvinesunday Feb 8, 2021
3016370
Change class name; remove unnecessary methods and properties
irvinesunday Feb 11, 2021
77869cd
Remove unnecessary extension method
irvinesunday Feb 11, 2021
9e45713
Merge pull request #536 from EricWilson-BluePrism/MultipleOf_Scientif…
darrelmiller Feb 13, 2021
54554b3
Merge branch 'vnext' into AllowWriteOpenApiStringAsRaw
darrelmiller Feb 13, 2021
e6fdb02
Merge pull request #528 from WillGunn/AllowWriteOpenApiStringAsRaw
darrelmiller Feb 13, 2021
65b70f2
Enabled async read for workspace
darrelmiller Feb 22, 2021
6b4e2ce
Merge branch 'vnext' into dm/openapiworkspace
darrelmiller Feb 28, 2021
5090c01
Support loading an OpenApiDocument with remote references.
darrelmiller Mar 3, 2021
36515c4
Added comments
darrelmiller Mar 3, 2021
672508e
Fixed warnings and updated to just .net standard
darrelmiller Mar 14, 2021
f02dc2f
Merge pull request #541 from microsoft/dm/openapiworkspace
darrelmiller Mar 14, 2021
bd10f4a
Merge branch 'vnext' into feature/explode-default-value
darrelmiller Mar 14, 2021
55317d3
Merge pull request #544 from simon-pearson/feature/explode-default-value
darrelmiller Mar 14, 2021
0cfb2ca
Merge branch 'vnext' into vnext
darrelmiller Mar 14, 2021
59564e0
Merge branch 'vnext' into feature/add_validator_for_path_parameters_n…
darrelmiller Mar 14, 2021
cc951a8
Added vscode config
darrelmiller Mar 14, 2021
4e81bd7
Removed comparer code for the 1.3 release
darrelmiller Mar 14, 2021
649f0b1
Merge pull request #557 from microsoft/dm/removecomparer
darrelmiller Mar 14, 2021
b4dd25c
Updated version and added extenalReference support to commandline tool
darrelmiller Mar 14, 2021
834e850
Added support for $ref in a pathitem
darrelmiller Mar 14, 2021
d96fdd8
Adding tests on .net 5 platform
darrelmiller Mar 14, 2021
bdc025f
Added support for parsing extensions in externaldocs
darrelmiller Mar 15, 2021
cfe7295
Merge branch 'vnext' into feature/add_validator_for_path_parameters_n…
darrelmiller Mar 15, 2021
de1f796
Remove OData specific functions
irvinesunday Mar 17, 2021
97ca318
Merge branch 'vnext' into vnext
irvinesunday Mar 17, 2021
407e64a
Update src/Microsoft.OpenApi/Extensions/StringExtensions.cs
darrelmiller Apr 4, 2021
8733ab7
Feature/dependabot (#1)
aleks-ivanov Apr 9, 2021
ea63b8b
Merge pull request #565 from pipeline-foundation/feature/dependabot
darrelmiller Apr 10, 2021
b9521cd
Merge branch 'vnext' into dm/updateversion
darrelmiller Apr 10, 2021
b3a54cb
Merge pull request #558 from microsoft/dm/updateversion
darrelmiller Apr 11, 2021
feaccf7
Added support for serializing additional properties in v2 schema
darrelmiller Apr 11, 2021
f29d6ba
Update package dependencies for tests
darrelmiller Apr 11, 2021
612fa81
Merge pull request #574 from microsoft/issues/561
darrelmiller Apr 11, 2021
8ba8192
Merge branch 'vnext' into issues/513
darrelmiller Apr 11, 2021
ba83f94
Merge branch 'vnext' into dm/updatedependencies
darrelmiller Apr 11, 2021
32b373f
Merge pull request #560 from microsoft/issues/513
darrelmiller Apr 11, 2021
315df74
Merge branch 'vnext' into dm/updatedependencies
darrelmiller Apr 11, 2021
3cca127
Merge pull request #575 from microsoft/dm/updatedependencies
darrelmiller Apr 11, 2021
3914db4
Merge branch 'vnext' into issue/288
darrelmiller Apr 11, 2021
6b26052
Merge pull request #559 from microsoft/issue/288
darrelmiller Apr 11, 2021
5869a55
Merge branch 'vnext' into vnext
darrelmiller Apr 11, 2021
c8cfe59
Added missing using and updated publicAPI
darrelmiller Apr 12, 2021
61094ca
Feature/codeql (#2)
aleks-ivanov Apr 12, 2021
64d6f31
Feature/codeql (#3)
aleks-ivanov Apr 12, 2021
1a3dc79
Merge branch 'vnext' of https://github.com/pipeline-foundation/OpenAP…
aleks-ivanov Apr 12, 2021
220f11d
Feature/codeql (#4)
aleks-ivanov Apr 12, 2021
1aea4d3
Feature/codeql (#5)
aleks-ivanov Apr 12, 2021
2b26975
Feature/codeql (#6)
aleks-ivanov Apr 12, 2021
ae54ea6
Feature/codeql (#7)
aleks-ivanov Apr 12, 2021
d623586
Merge pull request #578 from pipeline-foundation/feature/codeql
darrelmiller Apr 12, 2021
f777f75
Create CI/CD pipeline (#8)
aleks-ivanov Apr 13, 2021
a09c4bd
add documentation
aleks-ivanov Apr 13, 2021
6239db1
Merge pull request #9 from aleks-ivanov/feature/ci-cd
aleks-ivanov Apr 13, 2021
67e49bb
I negelcted to apply the NumberStyles.Float fix for supporting expone…
EricWilson-BluePrism Apr 14, 2021
59e0b72
Turns out some of the internal tests don't like the use of NumberStyl…
EricWilson-BluePrism Apr 16, 2021
510cd04
Removed commas from the test data for testing document parsing under …
EricWilson-BluePrism Apr 19, 2021
72364c5
Add utilities library
irvinesunday Apr 19, 2021
21d0688
Add new properties and remove redundant properties
irvinesunday Apr 19, 2021
b462fc5
Merge branch 'pr/irvinesunday/547' into vnext
irvinesunday Apr 20, 2021
a65d683
Update properties and tests
irvinesunday Apr 21, 2021
773e2b9
Restrict class access
irvinesunday Apr 21, 2021
5c6038c
Update public surface api text file with new properties and methods
irvinesunday Apr 21, 2021
9e7efcc
Remove unnecessary usings
irvinesunday Apr 21, 2021
95f71f6
Remove whitespaces
irvinesunday Apr 21, 2021
6becd0d
Update src/Microsoft.OpenApi/Services/OpenApiUrlTreeNode.cs
irvinesunday Apr 21, 2021
7d36d69
Update src/Microsoft.OpenApi/Services/OpenApiUrlTreeNode.cs
irvinesunday Apr 21, 2021
6650a28
PR feedback updates
irvinesunday Apr 21, 2021
2e6219b
Exclude NuGet publishing and replace GH release (#10)
aleks-ivanov Apr 22, 2021
0721eca
Merge branch 'vnext' into vnext
irvinesunday Apr 22, 2021
f3267bc
Add location context to all messages
darrelmiller Apr 30, 2021
9e609bf
Merge pull request #581 from EricWilson-BluePrism/ScientificNotationF…
darrelmiller May 1, 2021
9c859a3
Merge branch 'vnext' into vnext
darrelmiller May 1, 2021
9385ffe
Merge pull request #547 from irvinesunday/vnext
darrelmiller May 1, 2021
a956d83
Merge branch 'vnext' into feature/ci-cd
aleks-ivanov May 2, 2021
c664ea5
Added map keys into the context path
darrelmiller May 2, 2021
381c459
Converted OpenApiExceptions to OpenApiReaderExceptions
darrelmiller May 2, 2021
63c6345
Merge branch 'vnext' into issues/500
darrelmiller May 2, 2021
0630122
Fixed errors when reporting bad maps
darrelmiller May 2, 2021
c7ce197
Merge branch 'issues/500' of https://github.com/microsoft/openapi.net…
darrelmiller May 2, 2021
89c4569
Merge pull request #583 from microsoft/issues/500
darrelmiller May 2, 2021
d050b62
Fixed unnecessary
darrelmiller May 3, 2021
8f0de0d
Merge pull request #584 from microsoft/dm/fixbuildwarnings
darrelmiller May 3, 2021
415c959
Merge branch 'vnext' into feature/ci-cd
aleks-ivanov May 3, 2021
3b73598
add build definition
MIchaelMainer May 5, 2021
baa2a0c
set vmImage
MIchaelMainer May 5, 2021
e00d302
add symbols
MIchaelMainer May 5, 2021
cdc68de
Add source link
MIchaelMainer May 5, 2021
cea2aee
Approve new repoUrl attribute on public API
MIchaelMainer May 6, 2021
ec5a4b1
Add EmbedUntrackedSources
MIchaelMainer May 6, 2021
1a37084
Add EmbedUntrackedSources
MIchaelMainer May 6, 2021
d4a0b8e
Merge pull request #586 from microsoft/mmainer/build
irvinesunday May 11, 2021
e6c08c2
Merge branch 'vnext' into feature/ci-cd
aleks-ivanov May 12, 2021
05a1d77
Removed DataTypeMismatch as default rule
darrelmiller May 15, 2021
429c6e4
Fix broken tests
darrelmiller May 15, 2021
afe0675
Merge pull request #588 from microsoft/issues/407
darrelmiller May 15, 2021
7e91401
Merge remote-tracking branch 'origin/vnext' into pr/DCollart/524
darrelmiller May 15, 2021
92d5c3d
Added new rule to public API
darrelmiller May 15, 2021
6e86bff
Merge branch 'vnext' into feature/ci-cd
aleks-ivanov May 16, 2021
62a9fa1
Fix error reporting for simple maps
darrelmiller May 16, 2021
98aeb32
Merge pull request #591 from microsoft/dm/fixapigurutests
darrelmiller May 16, 2021
6a76108
Merge branch 'vnext' into feature/ci-cd
aleks-ivanov May 17, 2021
15352bd
Enhanced tool to support validation
darrelmiller May 17, 2021
cc0357a
Merge pull request #580 from pipeline-foundation/feature/ci-cd
darrelmiller May 19, 2021
3f685ef
Fixed merge conflict
darrelmiller May 22, 2021
a28f5dd
Merge pull request #524 from DCollart/feature/add_validator_for_path_…
darrelmiller May 22, 2021
8ce172a
Merge branch 'vnext' into dm/toolcleanup
darrelmiller May 22, 2021
7d236f8
fix: Changed OpenAPI.Tool to use ReadAsync so it can resolve external…
darrelmiller May 23, 2021
a008173
Merge pull request #596 from microsoft/dm/toolcleanup
darrelmiller May 23, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 126 additions & 0 deletions .azure-pipelines/ci-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

name: $(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)

trigger:
branches:
include:
- master
pr: none

pool:
name: Azure Pipelines
vmImage: windows-latest
demands:
- msbuild
- vstest

steps:
- task: NuGetCommand@2
displayName: 'NuGet restore'

- task: MSBuild@1
displayName: 'Build solution **/*.sln'
inputs:
configuration: Release

- task: VSTest@2
displayName: 'XUnit Tests'
inputs:
testAssemblyVer2: |
**\*.Tests.dll

vsTestVersion: 16.0
codeCoverageEnabled: true

- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
displayName: 'ESRP CodeSigning'
inputs:
ConnectedServiceName: 'microsoftgraph ESRP CodeSign DLL and NuGet (AKV)'
FolderPath: src
signConfigType: inlineSignParams
inlineOperation: |
[
{
"keyCode": "CP-230012",
"operationSetCode": "SigntoolSign",
"parameters": [
{
"parameterName": "OpusName",
"parameterValue": "Microsoft"
},
{
"parameterName": "OpusInfo",
"parameterValue": "http://www.microsoft.com"
},
{
"parameterName": "FileDigest",
"parameterValue": "/fd \"SHA256\""
},
{
"parameterName": "PageHash",
"parameterValue": "/NPH"
},
{
"parameterName": "TimeStamp",
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
}
],
"toolName": "sign",
"toolVersion": "1.0"
},
{
"keyCode": "CP-230012",
"operationSetCode": "SigntoolVerify",
"parameters": [ ],
"toolName": "sign",
"toolVersion": "1.0"
}
]
SessionTimeout: 20

- task: MSBuild@1
displayName: 'Pack OpenAPI'
inputs:
solution: src/Microsoft.OpenApi/Microsoft.OpenApi.csproj
configuration: Release
msbuildArguments: '/t:pack /p:PackageOutputPath=$(Build.ArtifactStagingDirectory) /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg'

- task: MSBuild@1
displayName: 'Pack OpenAPI Readers'
inputs:
solution: src/Microsoft.OpenApi.Readers/Microsoft.OpenApi.Readers.csproj
configuration: Release
msbuildArguments: '/t:pack /p:PackageOutputPath=$(Build.ArtifactStagingDirectory) /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg'

- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
displayName: 'ESRP CodeSigning Nuget Packages'
inputs:
ConnectedServiceName: 'microsoftgraph ESRP CodeSign DLL and NuGet (AKV)'
FolderPath: '$(Build.ArtifactStagingDirectory)'
Pattern: '*.nupkg'
signConfigType: inlineSignParams
inlineOperation: |
[
{
"keyCode": "CP-401405",
"operationSetCode": "NuGetSign",
"parameters": [ ],
"toolName": "sign",
"toolVersion": "1.0"
},
{
"keyCode": "CP-401405",
"operationSetCode": "NuGetVerify",
"parameters": [ ],
"toolName": "sign",
"toolVersion": "1.0"
}
]
SessionTimeout: 20

- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: Nugets'
inputs:
ArtifactName: Nugets
17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: 2
updates:
- package-ecosystem: "github-actions"
# default location of `.github/workflows`
directory: "/"
open-pull-requests-limit: 10
schedule:
interval: "weekly"

- package-ecosystem: "nuget"
# location of package manifests
directory: "/"
open-pull-requests-limit: 10
schedule:
interval: "daily"

# Built with ❤ by [Pipeline Foundation](https://pipeline.foundation)
143 changes: 143 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
name: CI/CD Pipeline

on: [push, pull_request, workflow_dispatch]

jobs:
ci:
name: Continuous Integration
runs-on: ubuntu-latest
outputs:
latest_version: ${{ steps.tag_generator.outputs.new_version }}
is_default_branch: ${{ steps.conditionals_handler.outputs.is_default_branch }}
env:
ARTIFACTS_FOLDER: ${{ github.workspace }}/Artifacts
GITHUB_RUN_NUMBER: ${{ github.run_number }}
steps:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x

- name: Data gatherer
id: data_gatherer
shell: pwsh
run: |
# Get default branch
$repo = 'microsoft/OpenAPI.NET'
$defaultBranch = Invoke-RestMethod -Method GET -Uri https://api.github.com/repos/$repo | Select-Object -ExpandProperty default_branch
Write-Output "::set-output name=default_branch::$(echo $defaultBranch)"

- name: Conditionals handler
id: conditionals_handler
shell: pwsh
run: |
$defaultBranch = "${{ steps.data_gatherer.outputs.default_branch }}"
$githubRef = "${{ github.ref }}"
$isDefaultBranch = 'false'
if ( $githubRef -like "*$defaultBranch*" ) {
$isDefaultBranch = 'true'
}
Write-Output "::set-output name=is_default_branch::$(echo $isDefaultBranch)"

- name: Checkout repository
id: checkout_repo
uses: actions/checkout@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0

- if: steps.conditionals_handler.outputs.is_default_branch == 'true'
name: Bump GH tag
id: tag_generator
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
default_bump: false
release_branches: ${{ steps.data_gatherer.outputs.default_branch }}

- name: Build projects
id: build_projects
shell: pwsh
run: |
$projectsArray = @(
'.\src\Microsoft.OpenApi\Microsoft.OpenApi.csproj',
'.\src\Microsoft.OpenApi.Readers\Microsoft.OpenApi.Readers.csproj',
'.\src\Microsoft.OpenApi.Tool\Microsoft.OpenApi.Tool.csproj'
)
$gitNewVersion = if ("${{ steps.tag_generator.outputs.new_version }}") {"${{ steps.tag_generator.outputs.new_version }}"} else {$null}
$projectCurrentVersion = ([xml](Get-Content .\src\Microsoft.OpenApi\Microsoft.OpenApi.csproj)).Project.PropertyGroup.Version
$projectNewVersion = $gitNewVersion ?? $projectCurrentVersion

$projectsArray | ForEach-Object {
dotnet build $PSItem `
-c Release # `
# -o $env:ARTIFACTS_FOLDER `
# /p:Version=$projectNewVersion
}

# Move NuGet packages to separate folder for pipeline convenience
# New-Item Artifacts/NuGet -ItemType Directory
# Get-ChildItem Artifacts/*.nupkg | Move-Item -Destination "Artifacts/NuGet"

- name: Run unit tests
id: run_unit_tests
shell: pwsh
run: |
$testProjectsArray = @(
'.\test\Microsoft.OpenApi.Tests\Microsoft.OpenApi.Tests.csproj',
'.\test\Microsoft.OpenApi.Readers.Tests\Microsoft.OpenApi.Readers.Tests.csproj',
'.\test\Microsoft.OpenApi.SmokeTests\Microsoft.OpenApi.SmokeTests.csproj'
)

$testProjectsArray | ForEach-Object {
dotnet test $PSItem `
-c Release
}

# - if: steps.tag_generator.outputs.new_version != ''
# name: Upload NuGet packages as artifacts
# id: ul_packages_artifact
# uses: actions/upload-artifact@v1
# with:
# name: NuGet packages
# path: Artifacts/NuGet/

cd:
if: needs.ci.outputs.is_default_branch == 'true' && needs.ci.outputs.latest_version != ''
name: Continuous Deployment
needs: ci
runs-on: ubuntu-latest
steps:
# - name: Download and extract NuGet packages
# id: dl_packages_artifact
# uses: actions/download-artifact@v2
# with:
# name: NuGet packages
# path: NuGet/

# - name: Push NuGet packages to NuGet.org
# id: push_nuget_packages
# continue-on-error: true
# shell: pwsh
# run: |
# Get-ChildItem NuGet/*.nupkg | ForEach-Object {
# nuget push $PSItem `
# -ApiKey $env:NUGET_API_KEY `
# -Source https://api.nuget.org/v3/index.json
# }
# env:
# NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}

- name: Create and publish release
id: create_release
uses: softprops/action-gh-release@v1
with:
name: OpenApi v${{ needs.ci.outputs.latest_version }}
tag_name: v${{ needs.ci.outputs.latest_version }}
# files: |
# NuGet/Microsoft.OpenApi.${{ needs.ci.outputs.latest_version }}.nupkg
# NuGet/Microsoft.OpenApi.Readers.${{ needs.ci.outputs.latest_version }}.nupkg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Built with ❤ by [Pipeline Foundation](https://pipeline.foundation)
47 changes: 47 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CodeQL Analysis

on:
push:
pull_request:
schedule:
- cron: '0 8 * * *'

jobs:
analyze:
name: CodeQL Analysis
runs-on: ubuntu-latest
steps:
- name: Checkout repository
id: checkout_repo
uses: actions/checkout@v2

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x

- name: Initialize CodeQL
id: init_codeql
uses: github/codeql-action/init@v1
with:
queries: security-and-quality

- name: Build projects
id: build_projects
shell: pwsh
run: |
$projectsArray = @(
'.\src\Microsoft.OpenApi\Microsoft.OpenApi.csproj',
'.\src\Microsoft.OpenApi.Readers\Microsoft.OpenApi.Readers.csproj',
'.\src\Microsoft.OpenApi.Tool\Microsoft.OpenApi.Tool.csproj'
)

$projectsArray | ForEach-Object {
dotnet build $PSItem -c Release
}

- name: Perform CodeQL Analysis
id: analyze_codeql
uses: github/codeql-action/analyze@v1

# Built with ❤ by [Pipeline Foundation](https://pipeline.foundation)
27 changes: 27 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"version": "0.2.0",
"configurations": [
{
// 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
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/src/Microsoft.OpenApi.Tool/bin/Debug/netcoreapp3.1/Microsoft.OpenApi.Tool.dll",
"args": [],
"cwd": "${workspaceFolder}/src/Microsoft.OpenApi.Tool",
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"workbench.colorCustomizations": {
"activityBar.background": "#03323C",
"titleBar.activeBackground": "#054754",
"titleBar.activeForeground": "#F0FCFE"
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

The **OpenAPI.NET** SDK contains a useful object model for OpenAPI documents in .NET along with common serializers to extract raw OpenAPI JSON and YAML documents from the model.

**See more information on the OpenAPI specification and its history here: <a href="https://www.openapis.org">Open API Initiative</a>**
**See more information on the OpenAPI specification and its history here: <a href="https://www.openapis.org">OpenAPI Initiative</a>**

Project Objectives

Expand Down
Loading