algorand / algorand/generator

Generate `deprecated` tags and annotations

Aperta
#41 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
new-feature-request Team Lamprey
Lingua principale
Java
Stelle
10
Fork
12
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

## 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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.