main.dot 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <!-- AUTO-GENERATED-CONTENT:START (TOC) -->
  2. <!-- AUTO-GENERATED-CONTENT:END -->
  3. {{= data.tags.section }}
  4. <h1 id="{{=data.title_prefix}}">{{=data.api.info && data.api.info.title}} {{=data.version}}</h1>
  5. > Scroll down for {{? data.header.language_tabs.length}}code samples, {{?}}example requests and responses.
  6. {{? data.api.info && data.api.info.description}}{{=data.api.info.description}}{{?}}
  7. {{? data.api.servers }}
  8. Base URLs:
  9. {{~data.api.servers :s}}
  10. * <a href="{{=s.url}}">{{=s.url}}</a>
  11. {{ for(var v in s.variables) { }}
  12. * **{{=v}}** - {{=s.variables[v].description||''}} Default: {{=s.variables[v].default}}
  13. {{? s.variables[v].enum}}
  14. {{~ s.variables[v].enum :e}}
  15. * {{= e}}
  16. {{~}}
  17. {{?}}
  18. {{ } }}
  19. {{~}}
  20. {{?}}
  21. {{? data.api.info && data.api.info.termsOfService}}<a href="{{=data.api.info.termsOfService}}">Terms of service</a>{{?}}
  22. {{? data.api.info && data.api.info.contact}}{{? data.api.info.contact.email}}Email: <a href="mailto:{{=data.api.info.contact.email}}">{{=data.api.info.contact.name || 'Support'}}</a> {{?}}{{? data.api.info.contact.url}}Web: <a href="{{=data.api.info.contact.url}}">{{= data.api.info.contact.name || 'Support'}}</a> {{?}}{{?}}
  23. {{? data.api.info && data.api.info.license}}{{? data.api.info.license.url}}License: <a href="{{=data.api.info.license.url}}">{{=data.api.info.license.name}}</a>{{??}} License: {{=data.api.info.license.name}}{{?}}{{?}}
  24. {{= data.tags.endSection }}
  25. {{? data.api.components && data.api.components.securitySchemes }}
  26. {{#def.security}}
  27. {{?}}
  28. {{ for (var r in data.resources) { }}
  29. {{ data.resource = data.resources[r]; }}
  30. {{= data.tags.section }}
  31. <h1 id="{{=data.title_prefix+'-'+data.utils.slugify(r)}}">{{= r}}</h1>
  32. {{? data.resource.description }}{{= data.resource.description}}{{?}}
  33. {{? data.resource.externalDocs}}
  34. <a href="{{=data.resource.externalDocs.url}}">{{=data.resource.externalDocs.description||'External documentation'}}</a>
  35. {{?}}
  36. {{ for (var m in data.resource.methods) { }}
  37. {{ data.operationUniqueName = m; }}
  38. {{ data.method = data.resource.methods[m]; }}
  39. {{ data.operationUniqueSlug = data.method.slug; }}
  40. {{ data.operation = data.method.operation; }}
  41. {{= data.templates.operation(data) }}
  42. {{ } /* of methods */ }}
  43. {{= data.tags.endSection }}
  44. {{ } /* of resources */ }}
  45. {{? data.api.components && data.api.components.schemas }}
  46. {{= data.tags.section }}
  47. # Schemas
  48. {{ for (var s in data.components.schemas) { }}
  49. {{ var origSchema = data.components.schemas[s]; }}
  50. {{ var schema = data.api.components.schemas[s]; }}
  51. {{= data.tags.section }}
  52. <h2 id="tocS_{{=s}}">{{=s}}</h2>
  53. {{ /* backwards compatibility */ }}
  54. <a id="schema{{=s.toLowerCase()}}"></a>
  55. <a id="schema_{{=s}}"></a>
  56. <a id="tocS{{=s.toLowerCase()}}"></a>
  57. <a id="tocs{{=s.toLowerCase()}}"></a>
  58. {{? data.options.yaml }}
  59. ```yaml
  60. {{=data.utils.yaml.stringify(data.utils.getSample(schema,data.options,{quiet:true},data.api))}}
  61. {{??}}
  62. ```json
  63. {{=data.utils.safejson(data.utils.getSample(schema,data.options,{quiet:true},data.api),null,2)}}
  64. {{?}}
  65. ```
  66. {{ var enums = []; }}
  67. {{ var blocks = data.utils.schemaToArray(origSchema,-1,{trim:true,join:true},data); }}
  68. {{ for (var block of blocks) {
  69. for (var p of block.rows) {
  70. if (p.schema && p.schema.enum) {
  71. for (var e of p.schema.enum) {
  72. enums.push({name:p.name,value:e});
  73. }
  74. }
  75. }
  76. }
  77. }}
  78. {{~ blocks :block}}
  79. {{? block.title }}{{= block.title}}{{= '\n\n'}}{{?}}
  80. {{? block.externalDocs}}
  81. <a href="{{=block.externalDocs.url}}">{{=block.externalDocs.description||'External documentation'}}</a>
  82. {{?}}
  83. {{? block===blocks[0] }}
  84. {{= data.tags.section }}
  85. ### Properties
  86. {{?}}
  87. {{? block.rows.length}}|Name|Type|Required|Restrictions|Description|
  88. |---|---|---|---|---|{{?}}
  89. {{~ block.rows :p}}|{{=p.displayName}}|{{=p.safeType}}|{{=p.required}}|{{=p.restrictions||'none'}}|{{=p.description||'none'}}|
  90. {{~}}
  91. {{~}}
  92. {{? (blocks[0].rows.length === 0) && (blocks.length === 1) }}
  93. *None*
  94. {{?}}
  95. {{? enums.length > 0 }}
  96. {{= data.tags.section }}
  97. #### Enumerated Values
  98. |Property|Value|
  99. |---|---|
  100. {{~ enums :e}}|{{=e.name}}|{{=data.utils.toPrimitive(e.value)}}|
  101. {{~}}
  102. {{= data.tags.endSection }}
  103. {{?}}
  104. {{= data.tags.endSection }}
  105. {{= data.tags.endSection }}
  106. {{ } /* of schemas */ }}
  107. {{?}}
  108. {{#def.footer}}
  109. {{? data.options.discovery}}
  110. {{#def.discovery}}
  111. {{?}}