Skip to content

Commit

Permalink
Merge pull request #116 from onfido/release-upgrade
Browse files Browse the repository at this point in the history
Refresh onfido-java after onfido-openapi-spec update (38a8740)
  • Loading branch information
dvacca-onfido authored Jun 17, 2024
2 parents 9d9fbad + cbfbd93 commit 0149a1c
Show file tree
Hide file tree
Showing 14 changed files with 1,342 additions and 20 deletions.
34 changes: 33 additions & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
npm install google-java-format
npx google-java-format --set-exit-if-changed -i $(git ls-files src/test/\*.java)
- name: Cache local Maven repository
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
Expand All @@ -40,6 +40,7 @@ jobs:
- name: Build with Maven
run: mvn -B package --file pom.xml -Dmaven.test.skip
- name: Run integration tests with Maven
if: ${{ github.repository_owner == 'onfido' }}
run: mvn test
env:
ONFIDO_API_TOKEN: ${{ secrets.ONFIDO_API_TOKEN }}
Expand All @@ -52,9 +53,12 @@ jobs:
publish:
runs-on: ubuntu-latest
needs: integration-tests
environment: delivery
if: github.event_name == 'release'
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_ACTION_ACCESS_TOKEN }}
- name: Set up Maven Central Repository
uses: actions/setup-java@v4
with:
Expand All @@ -79,3 +83,31 @@ jobs:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Update CHANGELOG.md
run: |
TMP_FILE=$(mktemp)
RELEASE_VERSION=$(jq -r '.release' .release.json)
RELEASE_DATE=`date +'%dth %B %Y' | sed -E 's/^0//;s/^([2,3]?)1th/\11st/;s/^([2]?)2th/\12nd/;s/^([2]?)3th/\13rd/'`
SPEC_COMMIT_SHA=$(jq -r '.source.short_sha' .release.json)
SPEC_COMMIT_URL=$(jq -r '.source.repo_url + "/commit/" + .source.long_sha' .release.json)
SPEC_RELEASE_VERSION=$(jq -r '.source.version' .release.json)
SPEC_RELEASE_URL=$(jq -r '.source.repo_url + "/releases/tag/" + .source.version' .release.json)
echo -e "# Changelog\n\n## $RELEASE_VERSION $RELEASE_DATE\n\n" >| $TMP_FILE
echo -en "${{ github.event.release.body }}\nBased on Onfido OpenAPI spec " >> $TMP_FILE
if [ -z $SPEC_RELEASE_VERSION ]; then
echo "up to commit [$SPEC_COMMIT_SHA](${SPEC_COMMIT_URL})." >> $TMP_FILE
else
echo "version [$SPEC_RELEASE_VERSION](${SPEC_RELEASE_URL})." >> $TMP_FILE
fi
grep -v "^# Changelog" CHANGELOG.md >> $TMP_FILE
mv $TMP_FILE CHANGELOG.md
git config user.name "GitHub Actions Bot"
git config user.email "<>"
git commit -m "Update CHANGELOG.md after library release" CHANGELOG.md
git push
9 changes: 9 additions & 0 deletions .release.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"source": {
"repo_url": "https://github.com/onfido/onfido-openapi-spec",
"short_sha": "38a8740",
"long_sha": "38a87401552386cb0b17aae28385c5e2f4af7bfc",
"version": ""
},
"release": "v4.0.0"
}
4 changes: 0 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# Changelog

## v4.0.0 11th Jun 2024

- Refresh library up to commit: [62dc554](https://github.com/onfido/onfido-openapi-spec/commit/62dc5541a4a51e8de313fc99fb3dec496033a23e)

## v3.1.0 13th May 2024 (pre-release)

- Include `nexus-staging-maven-plugin` only when necessary
Expand Down
32 changes: 27 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,19 @@ try {
}
```

### Recommendation
### Recommendations

It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.
### Don't share DefaultApi among different threads

It's recommended to create an instance of `DefaultApi` per thread in a multithreaded environment to avoid any potential issues.

#### Do not use additional properties

Retain from using `getAdditionalProperty()` or `getAdditionalProperties()` methods to access not defined properties to avoid breaking changes when these fields will appear.

## Contributing

This library is automatically generated using [OpenAPI Generator](https://openapi-generator.tech) - version: 7.6.0; therefore all the contributions, except tests files, should target [Onfido OpenAPI specification repository](https://github.com/onfido/onfido-openapi-spec/tree/master) instead of this repository.
This library is automatically generated using [OpenAPI Generator](https://openapi-generator.tech) (version: 7.6.0); therefore all the contributions, except tests files, should target [Onfido OpenAPI specification repository](https://github.com/onfido/onfido-openapi-spec/tree/master) instead of this repository.

For contributions to the tests instead, please follow the steps below:

Expand All @@ -167,11 +173,27 @@ For contributions to the tests instead, please follow the steps below:
5. Push to the branch (`git push origin my-new-feature`)
6. Create a new Pull Request

## Versioning policy

[Semantic Versioning](https://semver.org) policy is used for library versioning, following guidelines and limitations below:

- MAJOR versions (x.0.0) might:
- target a new API version
- include non-backward compatible change
- MINOR versions (0.x.0) might:
- add a new functionality, non-mandatory parameter or property
- deprecate an old functionality
- include non-backward compatible change to a functionality which is:
- labelled as alpha or beta
- completely broken and not usable
- PATCH version (0.0.x) might:
- fix a bug
- include backward compatible changes only

## More documentation

More documentation and code examples can be found at <https://documentation.onfido.com>.

## Support

Should you encounter any technical issues during integration, please contact Onfido's Customer Support team
via the [Customer Experience Portal](https://public.support.onfido.com/) which also includes support documentation.
Should you encounter any technical issues during integration, please contact Onfido's Customer Support team via the [Customer Experience Portal](https://public.support.onfido.com/) which also includes support documentation.
4 changes: 4 additions & 0 deletions src/main/java/com/onfido/JSON.java
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.FacialSimilarityMotionBreakdownVisualAuthenticity.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.FacialSimilarityMotionBreakdownVisualAuthenticityBreakdown.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.FacialSimilarityMotionBreakdownVisualAuthenticityBreakdownSpoofingDetection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.FacialSimilarityMotionProperties.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.FacialSimilarityMotionReport.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.FacialSimilarityPhotoBreakdown.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.FacialSimilarityPhotoBreakdownFaceComparison.CustomTypeAdapterFactory());
Expand All @@ -277,7 +278,9 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.FacialSimilarityPhotoFullyAutoBreakdownImageIntegrity.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.FacialSimilarityPhotoFullyAutoBreakdownImageIntegrityBreakdown.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.FacialSimilarityPhotoFullyAutoBreakdownImageIntegrityBreakdownSourceIntegrity.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.FacialSimilarityPhotoFullyAutoProperties.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.FacialSimilarityPhotoFullyAutoReport.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.FacialSimilarityPhotoProperties.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.FacialSimilarityPhotoReport.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.FacialSimilarityVideoBreakdown.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.FacialSimilarityVideoBreakdownFaceComparison.CustomTypeAdapterFactory());
Expand All @@ -289,6 +292,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.FacialSimilarityVideoBreakdownVisualAuthenticityBreakdown.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.FacialSimilarityVideoBreakdownVisualAuthenticityBreakdownLivenessDetected.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.FacialSimilarityVideoBreakdownVisualAuthenticityBreakdownSpoofingDetection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.FacialSimilarityVideoProperties.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.FacialSimilarityVideoReport.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.IdNumber.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.IdPhoto.CustomTypeAdapterFactory());
Expand Down
Loading

0 comments on commit 0149a1c

Please sign in to comment.