documentation.proto 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. // Copyright 2024 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.api;
  16. option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";
  17. option java_multiple_files = true;
  18. option java_outer_classname = "DocumentationProto";
  19. option java_package = "com.google.api";
  20. option objc_class_prefix = "GAPI";
  21. // `Documentation` provides the information for describing a service.
  22. //
  23. // Example:
  24. // <pre><code>documentation:
  25. // summary: >
  26. // The Google Calendar API gives access
  27. // to most calendar features.
  28. // pages:
  29. // - name: Overview
  30. // content: &#40;== include google/foo/overview.md ==&#41;
  31. // - name: Tutorial
  32. // content: &#40;== include google/foo/tutorial.md ==&#41;
  33. // subpages:
  34. // - name: Java
  35. // content: &#40;== include google/foo/tutorial_java.md ==&#41;
  36. // rules:
  37. // - selector: google.calendar.Calendar.Get
  38. // description: >
  39. // ...
  40. // - selector: google.calendar.Calendar.Put
  41. // description: >
  42. // ...
  43. // </code></pre>
  44. // Documentation is provided in markdown syntax. In addition to
  45. // standard markdown features, definition lists, tables and fenced
  46. // code blocks are supported. Section headers can be provided and are
  47. // interpreted relative to the section nesting of the context where
  48. // a documentation fragment is embedded.
  49. //
  50. // Documentation from the IDL is merged with documentation defined
  51. // via the config at normalization time, where documentation provided
  52. // by config rules overrides IDL provided.
  53. //
  54. // A number of constructs specific to the API platform are supported
  55. // in documentation text.
  56. //
  57. // In order to reference a proto element, the following
  58. // notation can be used:
  59. // <pre><code>&#91;fully.qualified.proto.name]&#91;]</code></pre>
  60. // To override the display text used for the link, this can be used:
  61. // <pre><code>&#91;display text]&#91;fully.qualified.proto.name]</code></pre>
  62. // Text can be excluded from doc using the following notation:
  63. // <pre><code>&#40;-- internal comment --&#41;</code></pre>
  64. //
  65. // A few directives are available in documentation. Note that
  66. // directives must appear on a single line to be properly
  67. // identified. The `include` directive includes a markdown file from
  68. // an external source:
  69. // <pre><code>&#40;== include path/to/file ==&#41;</code></pre>
  70. // The `resource_for` directive marks a message to be the resource of
  71. // a collection in REST view. If it is not specified, tools attempt
  72. // to infer the resource from the operations in a collection:
  73. // <pre><code>&#40;== resource_for v1.shelves.books ==&#41;</code></pre>
  74. // The directive `suppress_warning` does not directly affect documentation
  75. // and is documented together with service config validation.
  76. message Documentation {
  77. // A short description of what the service does. The summary must be plain
  78. // text. It becomes the overview of the service displayed in Google Cloud
  79. // Console.
  80. // NOTE: This field is equivalent to the standard field `description`.
  81. string summary = 1;
  82. // The top level pages for the documentation set.
  83. repeated Page pages = 5;
  84. // A list of documentation rules that apply to individual API elements.
  85. //
  86. // **NOTE:** All service configuration rules follow "last one wins" order.
  87. repeated DocumentationRule rules = 3;
  88. // The URL to the root of documentation.
  89. string documentation_root_url = 4;
  90. // Specifies the service root url if the default one (the service name
  91. // from the yaml file) is not suitable. This can be seen in any fully
  92. // specified service urls as well as sections that show a base that other
  93. // urls are relative to.
  94. string service_root_url = 6;
  95. // Declares a single overview page. For example:
  96. // <pre><code>documentation:
  97. // summary: ...
  98. // overview: &#40;== include overview.md ==&#41;
  99. // </code></pre>
  100. // This is a shortcut for the following declaration (using pages style):
  101. // <pre><code>documentation:
  102. // summary: ...
  103. // pages:
  104. // - name: Overview
  105. // content: &#40;== include overview.md ==&#41;
  106. // </code></pre>
  107. // Note: you cannot specify both `overview` field and `pages` field.
  108. string overview = 2;
  109. }
  110. // A documentation rule provides information about individual API elements.
  111. message DocumentationRule {
  112. // The selector is a comma-separated list of patterns for any element such as
  113. // a method, a field, an enum value. Each pattern is a qualified name of the
  114. // element which may end in "*", indicating a wildcard. Wildcards are only
  115. // allowed at the end and for a whole component of the qualified name,
  116. // i.e. "foo.*" is ok, but not "foo.b*" or "foo.*.bar". A wildcard will match
  117. // one or more components. To specify a default for all applicable elements,
  118. // the whole pattern "*" is used.
  119. string selector = 1;
  120. // Description of the selected proto element (e.g. a message, a method, a
  121. // 'service' definition, or a field). Defaults to leading & trailing comments
  122. // taken from the proto source definition of the proto element.
  123. string description = 2;
  124. // Deprecation description of the selected element(s). It can be provided if
  125. // an element is marked as `deprecated`.
  126. string deprecation_description = 3;
  127. }
  128. // Represents a documentation page. A page can contain subpages to represent
  129. // nested documentation set structure.
  130. message Page {
  131. // The name of the page. It will be used as an identity of the page to
  132. // generate URI of the page, text of the link to this page in navigation,
  133. // etc. The full page name (start from the root page name to this page
  134. // concatenated with `.`) can be used as reference to the page in your
  135. // documentation. For example:
  136. // <pre><code>pages:
  137. // - name: Tutorial
  138. // content: &#40;== include tutorial.md ==&#41;
  139. // subpages:
  140. // - name: Java
  141. // content: &#40;== include tutorial_java.md ==&#41;
  142. // </code></pre>
  143. // You can reference `Java` page using Markdown reference link syntax:
  144. // `[Java][Tutorial.Java]`.
  145. string name = 1;
  146. // The Markdown content of the page. You can use <code>&#40;== include {path}
  147. // ==&#41;</code> to include content from a Markdown file. The content can be
  148. // used to produce the documentation page such as HTML format page.
  149. string content = 2;
  150. // Subpages of this page. The order of subpages specified here will be
  151. // honored in the generated docset.
  152. repeated Page subpages = 3;
  153. }