Skip to content

Commit

Permalink
Read Me: added example of deprecate syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
laurameckley-wk committed Nov 9, 2018
1 parent b6a019e commit e40ebf5
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion README.md
Expand Up @@ -215,7 +215,7 @@ Some common annotations are listed below
| Annotation | Values | Allowed Places | Description
| ------------- | ------------- | -------------- | -----------
| vendor | Optional location | Namespaces, Includes | See [vendoring includes](#vendoring-includes)
| deprecated | Optional description | Service methods, Struct/union/exception fields | Marks a method or field as deprecated (if supported by the language, or in a comment otherwise), and logs a warning if a deprecated method is called.
| deprecated | Optional description | Service methods, Struct/union/exception fields | See [deprecating](#deprecating)

### Vendoring Includes

Expand Down Expand Up @@ -273,6 +273,35 @@ IDL has a vendor path set for the Go namespace. Instead, the generated code for
`foo.frugal` will reference the vendor path specified in `bar.frugal`
(github.com/Workiva/my-repo/gen-go/bar).

### Deprecating
Marks a method or field as deprecated (if supported by the language, or in a comment otherwise), and logs a warning if a deprecated method is called. This is not available on an entire struct, only the fields within the struct.
```
Struct GetFooRequest {
1: String value (deprecated="Use newValue instead")
}
GetFooResponse getFoo(10: GetFooRequest request) throws (
1: FooError error
) (deprecated="Use getBar instead")
```
In Dart, this compiles to
```
class GetFooRequest implements thrift.TBase {
...
/// Deprecated: Use newValue instead
@deprecated
List<String> _value;
...
}
```

```
/// Deprecated: Use getBar instead
@deprecated
Future<namespace.GetFooResponse> getFoo(frugal.FContext ctx, namespace.GetFooRequest request);
```


## Thrift Parity

Expand Down

0 comments on commit e40ebf5

Please sign in to comment.