hyperweb-io / hyperweb-io/ts-codegen

Supports untagged enum

オープン
#89 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
TypeScript
スター
126
フォーク
31
平均マージ
19分
マージ済み PR(30日)
2

説明

Current ts-codegen can't generate code from the following schema

```
{
...
"execute": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "ExecuteMsg",
"anyOf": [
{
"$ref": "#/definitions/ExecuteMsg_for_Nullable_Empty_and_Empty"
},
{
"$ref": "#/definitions/ICNSNameExecuteMsg"
}
],
"definitions": { ... },
...
}
```

as it tries to find properties under value of "execute" but it couldn't find one.

This schema is generated from

```rs
#[cw_serde]
#[serde(untagged)]
pub enum ExecuteMsg {
CW721Base(cw721_base::ExecuteMsg),
ICNSName(ICNSNameExecuteMsg),
}
```

It fails as it tries to find `Object.keys` on execute's `properties` but it couldn't find one on [this line of code](https://github.com/CosmWasm/ts-codegen/blob/cffa2acebb86f3c1f96fb00c4abae5ba0987e63e/packages/wasm-ast-types/src/client/client.ts#L266)

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。