CosmWasm / ts-codegen

Convert your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.
https://cosmology.zone/products/ts-codegen
Apache License 2.0
116 stars 27 forks source link

codegen errors for query case without parameters #64

Open pyramation opened 2 years ago

pyramation commented 2 years ago

related https://github.com/CosmWasm/cosmwasm/issues/1416

example https://github.com/grod220/ts-codegen-example

schema https://gist.github.com/pyramation/97af26385c9348688c74e849898ce419

the generated code that causes an issue (the enum):

  "execute": {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "ExecuteMsg",
    "oneOf": [
      {
        "type": "string",
        "enum": [
          "accept_ownership"
        ]
      },
      {
        "description": "Due to some chains being permissioned via governance, we must instantiate this contract first and give ownership access to Rover contract with this action after both are independently deployed.",
        "type": "object",
        "required": [
          "propose_new_owner"
        ],
        "properties": {
          "propose_new_owner": {
            "type": "object",
            "required": [
              "new_owner"
            ],
            "properties": {
              "new_owner": {
                "type": "string"
              }
            }
          }
        },
        "additionalProperties": false
      },
...