Skip to content

Commit

Permalink
Issues/86 v2 (#87)
Browse files Browse the repository at this point in the history
* No longer need most of the overrides

* Remove more overrides

* Generate clients, lots to fix

* Prefer list

* Manual fix to generated code due to ComponentModel.Annotations not part of .NET Standard

* Server session is gone for good

* Remove unnecessary long names

* Update attributes APIs

* Update entries APIs

* Update APIs for field definitions

* Update APIs for link definitions

* Update APIs for listing repositories

* Update APIs for search

* Update APIs for tag definitions

* WIP: update APIs for template definitions

* Finish updating APIs for template definitions

* No longer needed

* No need to use so many fully qualified names

* Again, no need for fully qualified name

* Use shorter names

* Use null propagation

* Fix CreateEntry method

* Add missing API

* Fix test util methods and use simple import for entry creation

* Server session is gone

* Update parameter naming for entries API

* Update tests for attributes APIs

* Update tests for audit reason APIs

* For tests of attribtues APIs, rename test classes names and their tests since the API names have changed

* Rename tests for audit reasons since their names have changed

* Add standard assertion for collection response

* Update tests for copy entry API

* Use AssertCollectionResponse

* Update tests for create and copy entry APIs

* Update entry deletion related tests

* Rename since the API name has changed

* Remove the tests since the API is gone

* Update tests related to template definition listing API

* Delete since the API no longer exists

* Update list fields related tests

* Update list link related tests

* Update list entries related tests

* Update list tag related tests

* Update tests for set template API

* Update set tags related tests

* Update set links related tests

* Update tests related to set fields

* Update tests related to template removal API

* Update entry update API tests

* Update tests related to import entry

* Update get entry related tests

* Fix entry update tests

* Minor naming and syntax fixes

* Update tests related to field definitions

* Update test names as API names have changed

* Udpate tests related to link definitions

* Update tests related to listing repositories

* Tests can run on .NET 6

* More readable

* Use new assertion

* Update all search API releated tests

* Update tests realted to simple search API

* Update tag definition API related tests

* Update test names since their APIs have changed

* Update tests related to task listing

* Update tests related to task cancellation

* Update tests related to retriving a single template definition

* Update tests related to listing of template definitions

* Update list template fiels by template name tests

* Update tests related to ListTemplateFieldDefinitionsByTemplateId

* Pass in scopes

* Test no need to support .net core 3

* Simplify test naming

* ImportEntryRequest must have its Name field filled

* Problem details have changed

* FieldToUpdate needs its Name field set

* Fix set link test

* LFS behavior has changed, use a more robust check

* Pass in repository ID instead of task ID

* Non-null check is consistent with the JS client

* Should pass in repository ID instead

* Update task cancellation usage

* We already check equality using Linq

* Update task cancellation test since the original test no longer fits the API

* There's no server session anymore, so remove its tests

* There's no point unit testing auto generated implementation

* Remove tests since related class no longer exists

* Again, let's no to test auto-generated implementation

* Remove unused import

* Remove tests since CreateEntryResult no longer exists

* Remove the test since it's testing .NET HTTP client

* Use the repository that other client libraries use

* Do not run on production
  • Loading branch information
lf-jason-jia authored Sep 15, 2023
1 parent 6ef5ed0 commit b9dbe46
Show file tree
Hide file tree
Showing 133 changed files with 10,984 additions and 20,733 deletions.
14 changes: 1 addition & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,12 @@ jobs:
env:
ACCESS_KEY: ${{ secrets.DEV_CA_PUBLIC_USE_INTEGRATION_TEST_ACCESS_KEY }}
SERVICE_PRINCIPAL_KEY: ${{ secrets.DEV_CA_PUBLIC_USE_TESTOAUTHSERVICEPRINCIPAL_SERVICE_PRINCIPAL_KEY }}
REPOSITORY_ID: ${{ secrets.DEV_CA_PUBLIC_USE_REPOSITORY_ID_3 }}
REPOSITORY_ID: ${{ secrets.DEV_CA_PUBLIC_USE_REPOSITORY_ID_1 }}
AUTHORIZATION_TYPE: ${{ secrets.AUTHORIZATION_TYPE }}
TEST_HEADER: ${{ secrets.TEST_HEADER }}
run:
dotnet test tests/integration/Laserfiche.Repository.Api.Client.IntegrationTest.csproj --no-build --verbosity normal --logger "trx;LogFileName=integration-test-results.trx"

- name: Run integration tests on API Server
continue-on-error: true
env:
REPOSITORY_ID: ${{ secrets.APISERVER_REPOSITORY_ID }}
APISERVER_USERNAME: ${{ secrets.APISERVER_USERNAME }}
APISERVER_PASSWORD: ${{ secrets.APISERVER_PASSWORD }}
APISERVER_REPOSITORY_API_BASE_URL: ${{ secrets.APISERVER_REPOSITORY_API_BASE_URL }}
AUTHORIZATION_TYPE: ${{ secrets.APISERVER_AUTHORIZATION_TYPE }}
TEST_HEADER: ${{ secrets.TEST_HEADER }}
run:
dotnet test tests/integration/Laserfiche.Repository.Api.Client.IntegrationTest.csproj --no-build --verbosity normal --logger "trx;LogFileName=integration-test-self-hosted-results.trx"

- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
Expand Down
1 change: 1 addition & 0 deletions generate-client/nswag.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"generateOptionalParameters": true,
"generateUpdateJsonSerializerSettingsMethod": false,
"useBaseUrl": false,
"arrayType": "IList",
"templateDirectory": "nswag",
"wrapResponses": true,
"wrapResponseMethods": [
Expand Down
45 changes: 0 additions & 45 deletions generate-client/swagger-override.json
Original file line number Diff line number Diff line change
@@ -1,51 +1,6 @@
{
"components": {
"schemas": {
"PutFieldValsRequest": {
"allOf": [
{
"$ref": "#/components/schemas/SimpleImportMetadata"
},
{
"type": "object",
"description": "The request body containing fields that will be assigned to the entry.",
"additionalProperties": false,
"properties": {
"links": {
"type": "array",
"description": "The links that will be assigned to the entry.",
"nullable": true,
"items": {
"$ref": "#/components/schemas/LinkToUpdate"
}
}
}
}
]
},
"SimpleImportMetadata": {
"type": "object",
"additionalProperties": false,
"properties": {
"fields": {
"type": "object",
"description": "The fields that will be assigned to the entry.",
"nullable": true,
"additionalProperties": {
"$ref": "#/components/schemas/FieldToUpdate"
}
},
"tags": {
"type": "array",
"description": "The tags that will be assigned to the entry.",
"nullable": true,
"items": {
"type": "string"
}
}
}
},
"ImportAsyncMetadata": null
}
}
}
Loading

0 comments on commit b9dbe46

Please sign in to comment.