algorand / algorand/generator

Generate `deprecated` tags and annotations

Offen
#41 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
new-feature-request Team Lamprey
Vorherrschende Sprache
Java
Sterne
10
Forks
12
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.