algorand / algorand/generator

Generate `deprecated` tags and annotations

オープン
#41 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
new-feature-request Team Lamprey
主要言語
Java
スター
10
フォーク
12
PR マージ指標
30日以内にマージされた PR はありません

説明

## Problem

We currently cannot add `deprecated` tags or annotations on generated code. Here are some examples in:

[Java](https://github.com/algorand/java-algorand-sdk/blob/0ed5109f59800a1cbaf2dcd90f28fcb21da767cb/src/main/java/com/algorand/algosdk/v2/client/model/DryrunTxnResult.java#L37)

```
/**
* Net cost of app execution. Field is DEPRECATED and is subject for removal.
* Instead, use `budget-added` and `budget-consumed.
*/
@JsonProperty("cost")
public Long cost;
```

[Go](https://github.com/algorand/go-algorand-sdk/blob/63d400966ce917bf544bfa9e922b61041aaa3f7a/client/v2/common/models/dryrun_txn_result.go#L18)

```
// Cost net cost of app execution. Field is DEPRECATED and is subject for removal.
// Instead, use `budget-added` and `budget-consumed.
Cost uint64 `json:"cost,omitempty"`
```

It would be nice if there was a way to follow language specific deprecation conventions, i.e. `@Deprecated` tag for Java and `// Deprecated:` for Go.

## Solution

It looks like the OA3 spec allows the [`deprecated` keyword in its schema](https://swagger.io/docs/specification/data-models/keywords/), but OA2 does not, so maybe a custom solution is necessary as long as we rely on the OA2 spec.

## Urgency

Nice to have - noticed it and writing it down for documentation purposes.

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

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

評価

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

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

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