algorand / algorand/generator

Generate `deprecated` tags and annotations

Abierto
#41 0 comentarios 0 reacciones 0 asignados Ver en GitHub
new-feature-request Team Lamprey
Lenguaje dominante
Java
Estrellas
10
Forks
12
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.