-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build(openapi): phase 2 - generate kotlin clients #468
Comments
Currently there is very limited support for oneOf, allOf, anyOf support for OpenApi v3.x |
OpenAPITools/openapi-generator#5381 Has been resolved in the meantime so this can be restarted. I made updates accordingly. |
There are still some issues while using OneOf to generate kotlin client. If one tries to generate kotlin code with the attached openapi.json file at the end of this comment (you can paste it in any package openapi.json) and then add this to their package.json
Then run in the package,
Then navigate to I tried creating another object in the schemas which has the entire But that creates another set of problem with Kotlin code generation (The problem is, it generates empty classes of this referenced oneOf object) [openapi file]
|
Primary Changes -------------- 1. Updated package.json files of several packages to include kotlin code generation script 2. Updated the ghpkg-all-kotlin-api-clients-publish.yaml to include the plugins updated in 1) package.json updated for the following plugins to incorporate 1) ---------------------------------------------------------------- a. packages/cactus-cmd-api-server b. packages/cactus-core-api c. packages/cactus-plugin-consortium-manual d. packages/cactus-plugin-keychain-aws-sm e. packages/cactus-plugin-keychain-azure-kv f. packages/cactus-plugin-keychain-google-sm g. packages/cactus-plugin-keychain-memory h. packages/cactus-plugin-keychain-memory-wasm i. packages/cactus-plugin-keychain-vault j. packages/cactus-plugin-ledger-connector-fabric k. packages/cactus-plugin-odap-hermes l. examples/cactus-example-carbon-accounting-business-logic-plugin m. examples/cactus-example-supply-chain-business-logic-plugin n. extensions/cactus-plugin-object-store-ipfs package.json updated for future incorporation of 1) -------------------------------------------------- a. packages/cactus-plugin-htlc-eth-besu b. packages/cactus-plugin-htlc-eth-besu-erc20 c. packages/cactus-plugin-ledger-connector-iroha d. packages/cactus-plugin-ledger-connector-iroha2 e. packages/cactus-plugin-ledger-connector-quorum f. packages/cactus-plugin-ledger-connector-xdai g. extensions/cactus-plugin-htlc-coordinator-besu Fixes hyperledger-cacti#468 Signed-off-by: jagpreetsinghsasan <[email protected]>
Primary Changes -------------- 1. Updated package.json files of several packages to include kotlin code generation script 2. Updated the ghpkg-all-kotlin-api-clients-publish.yaml to include the plugins updated in 1) package.json updated for the following plugins to incorporate 1) ---------------------------------------------------------------- a. packages/cactus-cmd-api-server b. packages/cactus-core-api c. packages/cactus-plugin-consortium-manual d. packages/cactus-plugin-keychain-aws-sm e. packages/cactus-plugin-keychain-azure-kv f. packages/cactus-plugin-keychain-google-sm g. packages/cactus-plugin-keychain-memory h. packages/cactus-plugin-keychain-memory-wasm i. packages/cactus-plugin-keychain-vault j. packages/cactus-plugin-ledger-connector-fabric k. packages/cactus-plugin-odap-hermes l. examples/cactus-example-carbon-accounting-business-logic-plugin m. examples/cactus-example-supply-chain-business-logic-plugin n. extensions/cactus-plugin-object-store-ipfs package.json updated for future incorporation of 1) -------------------------------------------------- a. packages/cactus-plugin-htlc-eth-besu b. packages/cactus-plugin-htlc-eth-besu-erc20 c. packages/cactus-plugin-ledger-connector-iroha d. packages/cactus-plugin-ledger-connector-iroha2 e. packages/cactus-plugin-ledger-connector-quorum f. packages/cactus-plugin-ledger-connector-xdai g. extensions/cactus-plugin-htlc-coordinator-besu Fixes hyperledger-cacti#468 Signed-off-by: jagpreetsinghsasan <[email protected]>
Primary Changes -------------- 1. Updated package.json files of several packages to include kotlin code generation script 2. Updated the ghpkg-all-kotlin-api-clients-publish.yaml to include the plugins updated in 1) package.json updated for the following plugins to incorporate 1) ---------------------------------------------------------------- a. packages/cactus-cmd-api-server b. packages/cactus-core-api c. packages/cactus-plugin-consortium-manual d. packages/cactus-plugin-keychain-aws-sm e. packages/cactus-plugin-keychain-azure-kv f. packages/cactus-plugin-keychain-google-sm g. packages/cactus-plugin-keychain-memory h. packages/cactus-plugin-keychain-memory-wasm i. packages/cactus-plugin-keychain-vault j. packages/cactus-plugin-ledger-connector-fabric k. packages/cactus-plugin-odap-hermes l. examples/cactus-example-carbon-accounting-business-logic-plugin m. examples/cactus-example-supply-chain-business-logic-plugin n. extensions/cactus-plugin-object-store-ipfs package.json updated for future incorporation of 1) -------------------------------------------------- a. packages/cactus-plugin-htlc-eth-besu b. packages/cactus-plugin-htlc-eth-besu-erc20 c. packages/cactus-plugin-ledger-connector-iroha d. packages/cactus-plugin-ledger-connector-iroha2 e. packages/cactus-plugin-ledger-connector-quorum f. packages/cactus-plugin-ledger-connector-xdai g. extensions/cactus-plugin-htlc-coordinator-besu Fixes hyperledger-cacti#468 Signed-off-by: jagpreetsinghsasan <[email protected]>
Primary Changes -------------- 1. Updated package.json files of several packages to include kotlin code generation script 2. Updated the ghpkg-all-kotlin-api-clients-publish.yaml to include the plugins updated in 1) package.json updated for the following plugins to incorporate 1) ---------------------------------------------------------------- a. packages/cactus-cmd-api-server b. packages/cactus-core-api c. packages/cactus-plugin-consortium-manual d. packages/cactus-plugin-keychain-aws-sm e. packages/cactus-plugin-keychain-azure-kv f. packages/cactus-plugin-keychain-google-sm g. packages/cactus-plugin-keychain-memory h. packages/cactus-plugin-keychain-memory-wasm i. packages/cactus-plugin-keychain-vault j. packages/cactus-plugin-ledger-connector-fabric k. packages/cactus-plugin-odap-hermes l. examples/cactus-example-carbon-accounting-business-logic-plugin m. examples/cactus-example-supply-chain-business-logic-plugin n. extensions/cactus-plugin-object-store-ipfs package.json updated for future incorporation of 1) -------------------------------------------------- a. packages/cactus-plugin-htlc-eth-besu b. packages/cactus-plugin-htlc-eth-besu-erc20 c. packages/cactus-plugin-ledger-connector-iroha d. packages/cactus-plugin-ledger-connector-iroha2 e. packages/cactus-plugin-ledger-connector-quorum f. packages/cactus-plugin-ledger-connector-xdai g. extensions/cactus-plugin-htlc-coordinator-besu Fixes hyperledger-cacti#468 Signed-off-by: jagpreetsinghsasan <[email protected]>
Primary Changes -------------- 1. Updated package.json files of several packages to include kotlin code generation script 2. Updated the ghpkg-all-kotlin-api-clients-publish.yaml to include the plugins updated in 1) package.json updated for the following plugins to incorporate 1) ---------------------------------------------------------------- a. packages/cactus-cmd-api-server b. packages/cactus-core-api c. packages/cactus-plugin-consortium-manual d. packages/cactus-plugin-keychain-aws-sm e. packages/cactus-plugin-keychain-azure-kv f. packages/cactus-plugin-keychain-google-sm g. packages/cactus-plugin-keychain-memory h. packages/cactus-plugin-keychain-memory-wasm i. packages/cactus-plugin-keychain-vault j. packages/cactus-plugin-ledger-connector-fabric k. packages/cactus-plugin-odap-hermes l. examples/cactus-example-carbon-accounting-business-logic-plugin m. examples/cactus-example-supply-chain-business-logic-plugin n. extensions/cactus-plugin-object-store-ipfs package.json updated for future incorporation of 1) -------------------------------------------------- a. packages/cactus-plugin-htlc-eth-besu b. packages/cactus-plugin-htlc-eth-besu-erc20 c. packages/cactus-plugin-ledger-connector-iroha d. packages/cactus-plugin-ledger-connector-iroha2 e. packages/cactus-plugin-ledger-connector-quorum f. packages/cactus-plugin-ledger-connector-xdai g. extensions/cactus-plugin-htlc-coordinator-besu Fixes hyperledger-cacti#468 Signed-off-by: jagpreetsinghsasan <[email protected]>
Primary Changes -------------- 1. Updated package.json files of several packages to include kotlin code generation script 2. Updated the ghpkg-all-kotlin-api-clients-publish.yaml to include the plugins updated in 1) package.json updated for the following plugins to incorporate 1) ---------------------------------------------------------------- a. packages/cactus-cmd-api-server b. packages/cactus-core-api c. packages/cactus-plugin-consortium-manual d. packages/cactus-plugin-keychain-aws-sm e. packages/cactus-plugin-keychain-azure-kv f. packages/cactus-plugin-keychain-google-sm g. packages/cactus-plugin-keychain-memory h. packages/cactus-plugin-keychain-memory-wasm i. packages/cactus-plugin-keychain-vault j. packages/cactus-plugin-ledger-connector-fabric k. packages/cactus-plugin-odap-hermes l. examples/cactus-example-carbon-accounting-business-logic-plugin m. examples/cactus-example-supply-chain-business-logic-plugin n. extensions/cactus-plugin-object-store-ipfs package.json updated for future incorporation of 1) -------------------------------------------------- a. packages/cactus-plugin-htlc-eth-besu b. packages/cactus-plugin-htlc-eth-besu-erc20 c. packages/cactus-plugin-ledger-connector-iroha d. packages/cactus-plugin-ledger-connector-iroha2 e. packages/cactus-plugin-ledger-connector-quorum f. packages/cactus-plugin-ledger-connector-xdai g. extensions/cactus-plugin-htlc-coordinator-besu Fixes #468 Signed-off-by: jagpreetsinghsasan <[email protected]>
Primary Changes -------------- 1. Updated package.json files of several packages to include kotlin code generation script 2. Updated the ghpkg-all-kotlin-api-clients-publish.yaml to include the plugins updated in 1) package.json updated for the following plugins to incorporate 1) ---------------------------------------------------------------- a. packages/cactus-cmd-api-server b. packages/cactus-core-api c. packages/cactus-plugin-consortium-manual d. packages/cactus-plugin-keychain-aws-sm e. packages/cactus-plugin-keychain-azure-kv f. packages/cactus-plugin-keychain-google-sm g. packages/cactus-plugin-keychain-memory h. packages/cactus-plugin-keychain-memory-wasm i. packages/cactus-plugin-keychain-vault j. packages/cactus-plugin-ledger-connector-fabric k. packages/cactus-plugin-odap-hermes l. examples/cactus-example-carbon-accounting-business-logic-plugin m. examples/cactus-example-supply-chain-business-logic-plugin n. extensions/cactus-plugin-object-store-ipfs package.json updated for future incorporation of 1) -------------------------------------------------- a. packages/cactus-plugin-htlc-eth-besu b. packages/cactus-plugin-htlc-eth-besu-erc20 c. packages/cactus-plugin-ledger-connector-iroha d. packages/cactus-plugin-ledger-connector-iroha2 e. packages/cactus-plugin-ledger-connector-quorum f. packages/cactus-plugin-ledger-connector-xdai g. extensions/cactus-plugin-htlc-coordinator-besu Fixes hyperledger-cacti#468 Signed-off-by: jagpreetsinghsasan <[email protected]>
Primary Changes -------------- 1. Updated package.json files of several packages to include kotlin code generation script 2. Updated the ghpkg-all-kotlin-api-clients-publish.yaml to include the plugins updated in 1) package.json updated for the following plugins to incorporate 1) ---------------------------------------------------------------- a. packages/cactus-cmd-api-server b. packages/cactus-core-api c. packages/cactus-plugin-consortium-manual d. packages/cactus-plugin-keychain-aws-sm e. packages/cactus-plugin-keychain-azure-kv f. packages/cactus-plugin-keychain-google-sm g. packages/cactus-plugin-keychain-memory h. packages/cactus-plugin-keychain-memory-wasm i. packages/cactus-plugin-keychain-vault j. packages/cactus-plugin-ledger-connector-fabric k. packages/cactus-plugin-odap-hermes l. examples/cactus-example-carbon-accounting-business-logic-plugin m. examples/cactus-example-supply-chain-business-logic-plugin n. extensions/cactus-plugin-object-store-ipfs package.json updated for future incorporation of 1) -------------------------------------------------- a. packages/cactus-plugin-htlc-eth-besu b. packages/cactus-plugin-htlc-eth-besu-erc20 c. packages/cactus-plugin-ledger-connector-iroha d. packages/cactus-plugin-ledger-connector-iroha2 e. packages/cactus-plugin-ledger-connector-quorum f. packages/cactus-plugin-ledger-connector-xdai g. extensions/cactus-plugin-htlc-coordinator-besu Fixes hyperledger-cacti#468 Signed-off-by: jagpreetsinghsasan <[email protected]>
Primary Changes -------------- 1. Updated package.json files of several packages to include kotlin code generation script 2. Updated the ghpkg-all-kotlin-api-clients-publish.yaml to include the plugins updated in 1) package.json updated for the following plugins to incorporate 1) ---------------------------------------------------------------- a. packages/cactus-cmd-api-server b. packages/cactus-core-api c. packages/cactus-plugin-consortium-manual d. packages/cactus-plugin-keychain-aws-sm e. packages/cactus-plugin-keychain-azure-kv f. packages/cactus-plugin-keychain-google-sm g. packages/cactus-plugin-keychain-memory h. packages/cactus-plugin-keychain-memory-wasm i. packages/cactus-plugin-keychain-vault j. packages/cactus-plugin-ledger-connector-fabric k. packages/cactus-plugin-odap-hermes l. examples/cactus-example-carbon-accounting-business-logic-plugin m. examples/cactus-example-supply-chain-business-logic-plugin n. extensions/cactus-plugin-object-store-ipfs package.json updated for future incorporation of 1) -------------------------------------------------- a. packages/cactus-plugin-htlc-eth-besu b. packages/cactus-plugin-htlc-eth-besu-erc20 c. packages/cactus-plugin-ledger-connector-iroha d. packages/cactus-plugin-ledger-connector-iroha2 e. packages/cactus-plugin-ledger-connector-quorum f. packages/cactus-plugin-ledger-connector-xdai g. extensions/cactus-plugin-htlc-coordinator-besu Fixes hyperledger-cacti#468 Signed-off-by: jagpreetsinghsasan <[email protected]>
Meta
A major refactoring of this issue has been done by Peter on 2022-05-03
I've broken this up into two phases, this is the issue for the second phase.
./packages/cactus-plugin-ledger-connector-corda/src/main/json/openapi.json
)Description
As a developer I want to not be forced to use the NodeJS/Javascript API client if my primary programming language is something else so that I can achieve high productivity through Cactus no matter the language I'm using.
This is different from a similar looking issue which discusses the possibility of writing plugins in different languages as well.
Here is a complete list of programming languages that are supported by the OpenAPI generator (which we can take full advantage of since we are using the OpenAPI specs)
https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator/src/main/resources
How to get going with this?
First you can establish that the code generation works at all by running it locally.
Take a look at
"generate-sdk":
named scripts in the package.json files.You can get a list of the openapi.json files that need to be covered by searching for them with a handy tool called
find
$ find ./ -iwholename "./**/src/main/json/openapi.json" ./examples/cactus-example-supply-chain-business-logic-plugin/src/main/json/openapi.json ./examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/json/openapi.json ./packages/cactus-plugin-keychain-google-sm/src/main/json/openapi.json ./packages/cactus-plugin-ledger-connector-quorum/src/main/json/openapi.json ./packages/cactus-plugin-ledger-connector-fabric/src/main/json/openapi.json ./packages/cactus-plugin-ledger-connector-iroha/src/main/json/openapi.json ./packages/cactus-plugin-htlc-eth-besu/src/main/json/openapi.json ./packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json ./packages/cactus-plugin-keychain-azure-kv/src/main/json/openapi.json ./packages/cactus-plugin-keychain-memory-wasm/src/main/json/openapi.json ./packages/cactus-plugin-ledger-connector-xdai/src/main/json/openapi.json ./packages/cactus-core-api/src/main/json/openapi.json ./packages/cactus-plugin-htlc-eth-besu-erc20/src/main/json/openapi.json ./packages/cactus-plugin-keychain-aws-sm/src/main/json/openapi.json ./packages/cactus-plugin-odap-hermes/src/main/json/openapi.json ./packages/cactus-plugin-ledger-connector-corda/src/main/json/openapi.json ./packages/cactus-cmd-api-server/src/main/json/openapi.json ./packages/cactus-plugin-keychain-memory/src/main/json/openapi.json ./packages/cactus-plugin-keychain-vault/src/main/json/openapi.json ./packages/cactus-plugin-consortium-manual/src/main/json/openapi.json ./extensions/cactus-plugin-object-store-ipfs/src/main/json/openapi.json ./extensions/cactus-plugin-htlc-coordinator-besu/src/main/json/openapi.json
Once verified that the code generation can work, add scripts similar to the existing ones that generate the typescript code (
"generate-sdk":
) and call those scripts the same in each package, like"generate-client-java"
.Identify a set of suitable candidates for publishing the JVM artifacts, then have a conversation with Peter about which one should we pick.
Then add the workflow yaml file for publishing on git tags made on the main branch.
Acceptance Criteria
3.1 Identify candidates of where to publish Java artifacts - ask the Hyperledger Foundation community architects on Discord about what other projects have done/do.
packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/
(https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator/src/main/resources/kotlin-client)openapi-kotlin-client-publish.yaml
github workflow file that does the publishing which gets triggered on git tags on the main branch (e.g. when we issue a release)4. Client side routing is supported by the Java API clients as well.cc: @takeutak @sfuji822 @jonathan-m-hamilton
Update 2022-05-03: Crossed out acceptance criteria 4 until a more detailed design of it can be provided.
The text was updated successfully, but these errors were encountered: