mirror of
https://github.com/netbirdio/docs.git
synced 2026-04-16 07:26:35 +00:00
[API] add cloud and experimantal badges + new pages (#292)
This commit is contained in:
@@ -49,6 +49,7 @@ export default async function gen(inputFileName: string, outputDir: string) {
|
||||
|
||||
type v3OperationWithPath = OpenAPIV3.OperationObject & {
|
||||
path: string
|
||||
|
||||
}
|
||||
|
||||
export type objectRepresentation = {
|
||||
@@ -104,22 +105,16 @@ async function gen_v3(spec: OpenAPIV3.Document, dest: string) {
|
||||
}
|
||||
}
|
||||
|
||||
// if(operation.summary == "List all Tokens") {
|
||||
// console.log(response.example)
|
||||
// console.log(operation.responses["200"]["content"]["application/json"].schema.items.properties)
|
||||
// }
|
||||
|
||||
|
||||
const enriched = {
|
||||
...operation,
|
||||
path: key,
|
||||
fullPath,
|
||||
operationId: slugify(operation.summary!),
|
||||
|
||||
responseList: toArrayWithKey(operation.responses!, 'responseCode') || [],
|
||||
request: request,
|
||||
response: response,
|
||||
}
|
||||
|
||||
let tag = operation.tags.pop()
|
||||
let tagOperations = tagGroups.get(tag) ?? []
|
||||
tagGroups.set(tag, tagOperations.concat(enriched))
|
||||
|
||||
@@ -4,7 +4,7 @@ export const title = '<%- tag %>'
|
||||
|
||||
<% operations.forEach(function(operation){ %>
|
||||
|
||||
## <%- operation.summary %> {{ tag: '<%- operation.operation.toUpperCase() %>' , label: '<%- operation.path %>' }} <% if(operation.deprecated) { %><Badge status="warning" text="Deprecated" /><% } %>
|
||||
## <%- operation.summary %> <% if(operation.deprecated) { %> <Badge status="warning" text="Deprecated" /> <% } %><% if(operation["x-cloud-only"]) { %> <Badge status="cloud-only" text="Cloud-Only" /> <% } %><% if(operation["x-experimental"]) { %> <Badge status="experimental" text="Experimental" /> <% } %> {{ tag: '<%- operation.operation.toUpperCase() %>' , label: '<%- operation.path %>' }}
|
||||
|
||||
<Row>
|
||||
<Col>
|
||||
|
||||
Reference in New Issue
Block a user