Skip to content

Commit

Permalink
Add remaining structured annotations
Browse files Browse the repository at this point in the history
Summary: Priority, URI, and the catch-all

Reviewed By: Mizuchi

Differential Revision: D50993041

fbshipit-source-id: 548240b8c494e5b221137c6be70d5b20489a93b2
  • Loading branch information
iahs authored and facebook-github-bot committed Nov 7, 2023
1 parent df3b08e commit 1bd75c0
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
1 change: 1 addition & 0 deletions thrift/annotation/hack.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ struct SkipCodegen {
// conflict errors in Hack codegen.
// For ex: reserved keywords in Hack language, symbols with similar names from
// other files in Hack
@scope.Definition
struct Name {
1: string name;
2: string reason;
Expand Down
33 changes: 32 additions & 1 deletion thrift/annotation/thrift.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ struct SerializeInFieldIdOrder {}

/**
* Indicates an enum is a bitmask and should support bit-wise operators.
* Currently generates additional code in C++ and Hack.
*/
@scope.Enum
@Experimental // TODO: Support in C++, Python, Java.
struct BitmaskEnum {}

/**
Expand Down Expand Up @@ -161,3 +161,34 @@ struct InternBox {}
*/
@scope.Interaction
struct Serial {}

/**
* Changes the URI of this definition away from the default-generated one.
*/
@scope.Definition
struct Uri {
1: string value;
}

/**
* Changes the priority of this function (default NORMAL).
*/
@scope.Function
struct Priority {
1: RpcPriority level;
}
enum RpcPriority {
HIGH_IMPORTANT = 0,
HIGH = 1,
IMPORTANT = 2,
NORMAL = 3,
BEST_EFFORT = 4,
}

/**
* Applies unstructured annotations to a definition.
*/
@scope.Definition
struct DeprecatedUnvalidatedAnnotations {
1: map<string, string> items;
}

0 comments on commit 1bd75c0

Please sign in to comment.