11# CDOC2 OpenAPI
22
3- Contains OpenAPI specifications.
3+ Contains OpenAPI specifications for [ CDOC2 project ] ( https://open-eid.github.io/CDOC2 )
44
55## Java
66
7- Openapi specification maven artifacts can be installed (local ` ~/.m2 ` directory) or deployed
7+ Openapi specification maven artifacts ( ` packaging=yaml ` ) can be installed (local ` ~/.m2 ` directory) or deployed
88(remote maven package repository) with standard ` mvn install ` or ` mvn deploy ` commands.
99
10+ ` mvn install ` will parse ` info.version ` from ` *-openapi.yaml ` and use that as maven package version.
11+
1012### Get from GitHub package repo
1113
1214Configure github package repo access
@@ -34,7 +36,17 @@ can be found in maven package repository:
3436
3537https://github.com/open-eid/cdoc2-openapi/packages
3638
37- ## Releasing/Publishing OpenApi specification
39+ ## Releasing/Publishing OpenApi using GitHub actions
40+
41+ Push a new version of * -openapi.yaml to GitHub.
42+
43+ Create GitHub Release
44+ https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository#creating-a-release
45+
46+ That will trigger ` .github/workflows/maven-publish.yml ` that will call ` mvn deploy ` with correct parameters
47+
48+
49+ ## Releasing/Publishing OpenApi specification manually
3850
3951Deploy/publish OpenApi manually:
4052` mvn -Dproject.distributionManagement.repository.id=github -Dproject.distributionManagement.repository.url=https://maven.pkg.github.com/open-eid/cdoc2-openapi deploy `
@@ -56,6 +68,16 @@ mvn deploy:deploy-file \
5668```
5769Refer: https://maven.apache.org/plugins/maven-deploy-plugin/deploy-file-mojo.html
5870
71+ ## Delete OpenApi package from local Maven repository
72+ ```
73+ mvn dependency:purge-local-repository -DmanualInclude=ee.cyber.cdoc2.openapi:cdoc2-key-capsules-openapi
74+ ```
75+
76+ ## Usage from Java Maven projects for code generation
77+
78+ See:
79+ * https://github.com/open-eid/cdoc2-java-ref-impl/blob/master/cdoc2-client/pom.xml
80+ * https://github.com/open-eid/cdoc2-capsule-server/blob/master/cdoc2-server-openapi/pom.xml
5981
6082
6183
0 commit comments