custom-options.json 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. {
  2. "package": null,
  3. "messages": [
  4. {
  5. "ref": "google.protobuf.FileOptions",
  6. "fields": [
  7. {
  8. "rule": "optional",
  9. "options": {},
  10. "type": "string",
  11. "name": "my_file_option",
  12. "id": 50000
  13. }
  14. ]
  15. },
  16. {
  17. "ref": "google.protobuf.MessageOptions",
  18. "fields": [
  19. {
  20. "rule": "optional",
  21. "options": {},
  22. "type": "int32",
  23. "name": "my_message_option",
  24. "id": 50001
  25. }
  26. ]
  27. },
  28. {
  29. "ref": "google.protobuf.FieldOptions",
  30. "fields": [
  31. {
  32. "rule": "optional",
  33. "options": {},
  34. "type": "float",
  35. "name": "my_field_option",
  36. "id": 50002
  37. }
  38. ]
  39. },
  40. {
  41. "ref": "google.protobuf.EnumOptions",
  42. "fields": [
  43. {
  44. "rule": "optional",
  45. "options": {},
  46. "type": "bool",
  47. "name": "my_enum_option",
  48. "id": 50003
  49. }
  50. ]
  51. },
  52. {
  53. "ref": "google.protobuf.EnumValueOptions",
  54. "fields": [
  55. {
  56. "rule": "optional",
  57. "options": {},
  58. "type": "uint32",
  59. "name": "my_enum_value_option",
  60. "id": 50004
  61. }
  62. ]
  63. },
  64. {
  65. "ref": "google.protobuf.ServiceOptions",
  66. "fields": [
  67. {
  68. "rule": "optional",
  69. "options": {},
  70. "type": "MyEnum",
  71. "name": "my_service_option",
  72. "id": 50005
  73. }
  74. ]
  75. },
  76. {
  77. "ref": "google.protobuf.MethodOptions",
  78. "fields": [
  79. {
  80. "rule": "optional",
  81. "options": {},
  82. "type": "MyMessage",
  83. "name": "my_method_option",
  84. "id": 50006
  85. }
  86. ]
  87. },
  88. {
  89. "name": "MyMessage",
  90. "fields": [
  91. {
  92. "rule": "optional",
  93. "options": {
  94. "(my_field_option)": 4.5
  95. },
  96. "type": "int32",
  97. "name": "foo",
  98. "id": 1
  99. },
  100. {
  101. "rule": "optional",
  102. "options": {},
  103. "type": "string",
  104. "name": "bar",
  105. "id": 2
  106. }
  107. ],
  108. "enums": [],
  109. "messages": [],
  110. "options": {
  111. "(my_message_option)": 1234
  112. }
  113. },
  114. {
  115. "name": "RequestType",
  116. "fields": [],
  117. "enums": [],
  118. "messages": [],
  119. "options": {}
  120. },
  121. {
  122. "name": "ResponseType",
  123. "fields": [],
  124. "enums": [],
  125. "messages": [],
  126. "options": {}
  127. }
  128. ],
  129. "enums": [
  130. {
  131. "name": "MyEnum",
  132. "values": [
  133. {
  134. "name": "FOO",
  135. "id": 1
  136. },
  137. {
  138. "name": "BAR",
  139. "id": 2
  140. }
  141. ],
  142. "options": {
  143. "(my_enum_option)": true
  144. }
  145. }
  146. ],
  147. "imports": [],
  148. "options": {
  149. "(my_file_option)": "Hello world!"
  150. },
  151. "services": [
  152. {
  153. "name": "MyService",
  154. "rpc": {
  155. "MyMethod": {
  156. "request": "RequestType",
  157. "response": "ResponseType",
  158. "options": {
  159. "(my_method_option).foo": 567,
  160. "(my_method_option).bar": "Some string"
  161. }
  162. }
  163. },
  164. "options": {
  165. "(my_service_option)": "FOO"
  166. }
  167. }
  168. ]
  169. }