[API] add cloud and experimantal badges + new pages (#292)

This commit is contained in:
Pascal Fischer
2025-03-20 18:04:45 +01:00
committed by GitHub
parent 553d2908b8
commit 4a66f17880
18 changed files with 2873 additions and 97 deletions

View File

@@ -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))

View File

@@ -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>