web3j-openapi icon indicating copy to clipboard operation
web3j-openapi copied to clipboard

import from exists contract not generate OpenApi specs

Open stvkoch opened this issue 1 year ago • 0 comments

The swagger and openApi specs are empty when I create a new project.

I'm following the documentation and using the command:

web3j openapi import \
    -s=./contracts/contracts/HelloWorld.sol \
    --package=dummy.HelloWorld \
    --project-name=HelloWorld \
    --output-dir=./web3j

First thing I did was added into global gradle settings the missing "consensys" dep to be able to run the project.

when run the task ./gradlew run the swagger doesn't show any helloworld methods showing "no operations defined..."

looking into build/resources/openapi/main/openapi.json I found just the header {"openapi":"3.0.1"}

Looks good the ABIs and metadata files into build/resources/main/solidity...

I'm running a hardhat local node and set the envs:

export WEB3J_ENDPOINT=http://localhost:8545
export WEB3J_PRIVATE_KEY=...
export WEB3J_OPENAPI_HOST=localhost
export WEB3J_OPENAPI_PORT=9090

I'm missing some step?

It's happens too when I just create a new project using default parameters

web3j openapi new

stvkoch avatar May 16 '24 09:05 stvkoch