algorand / algorand/generator

Generate `deprecated` tags and annotations

Open
#41 0 comments 0 reactions 0 assignees View on GitHub
new-feature-request Team Lamprey
Dominant language
Java
Stars
10
Forks
12
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.