Rebuild with tableMetaData example, and now stable content map for query & count

This commit is contained in:
2025-05-29 12:32:20 -05:00
parent 7b3cafe348
commit 7a450eed08
2 changed files with 52 additions and 11 deletions

View File

@ -24,6 +24,7 @@ package com.kingsrook.qqq.middleware.javalin.specs.v1.utils;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.kingsrook.qqq.backend.core.context.QContext; import com.kingsrook.qqq.backend.core.context.QContext;
@ -57,7 +58,7 @@ public class QuerySpecUtils
ContentType.APPLICATION_JSON.getMimeType(), new Content() ContentType.APPLICATION_JSON.getMimeType(), new Content()
.withSchema(new Schema() .withSchema(new Schema()
.withType(Type.OBJECT) .withType(Type.OBJECT)
.withProperties(Map.of( .withProperties(new LinkedHashMap<>(Map.of(
"filter", new Schema() "filter", new Schema()
.withDescription("QueryFilter to specify matching records to be returned by the query") .withDescription("QueryFilter to specify matching records to be returned by the query")
.withRef("#/components/schemas/QueryFilter"), .withRef("#/components/schemas/QueryFilter"),
@ -69,7 +70,7 @@ public class QuerySpecUtils
"tableVariant", new Schema() "tableVariant", new Schema()
.withDescription("For tables that use variant backends, specification of which variant to use.") .withDescription("For tables that use variant backends, specification of which variant to use.")
.withRef("#/components/schemas/TableVariant") .withRef("#/components/schemas/TableVariant")
)) )))
) )
)); ));
} }

View File

@ -1954,7 +1954,47 @@ paths:
content: content:
application/json: application/json:
examples: examples:
TODO: {} Example:
value:
tableMetaData:
capabilities:
- "TABLE_COUNT"
- "TABLE_GET"
- "TABLE_QUERY"
- "QUERY_STATS"
- "TABLE_INSERT"
- "TABLE_UPDATE"
- "TABLE_DELETE"
deletePermission: true
editPermission: true
fields:
id:
displayFormat: "%s"
isEditable: true
isHeavy: false
isHidden: false
isRequired: false
label: "Id"
name: "id"
type: "INTEGER"
icon:
name: "person_outline"
insertPermission: true
isHidden: false
label: "Person"
name: "person"
primaryKeyField: "id"
readPermission: true
sections:
- fieldNames:
- "id"
hidden: false
icon:
name: "badge"
label: "Identity"
name: "identity"
tier: "T1"
usesVariants: false
schema: schema:
$ref: "#/components/schemas/TableMetaDataResponseV1" $ref: "#/components/schemas/TableMetaDataResponseV1"
description: "The full table metadata" description: "The full table metadata"
@ -1981,10 +2021,6 @@ paths:
application/json: application/json:
schema: schema:
properties: properties:
tableVariant:
$ref: "#/components/schemas/TableVariant"
description: "For tables that use variant backends, specification\
\ of which variant to use."
filter: filter:
$ref: "#/components/schemas/QueryFilter" $ref: "#/components/schemas/QueryFilter"
description: "QueryFilter to specify matching records to be returned\ description: "QueryFilter to specify matching records to be returned\
@ -1995,6 +2031,10 @@ paths:
items: items:
$ref: "#/components/schemas/QueryJoin" $ref: "#/components/schemas/QueryJoin"
type: "array" type: "array"
tableVariant:
$ref: "#/components/schemas/TableVariant"
description: "For tables that use variant backends, specification\
\ of which variant to use."
type: "object" type: "object"
required: false required: false
responses: responses:
@ -2049,10 +2089,6 @@ paths:
application/json: application/json:
schema: schema:
properties: properties:
tableVariant:
$ref: "#/components/schemas/TableVariant"
description: "For tables that use variant backends, specification\
\ of which variant to use."
filter: filter:
$ref: "#/components/schemas/QueryFilter" $ref: "#/components/schemas/QueryFilter"
description: "QueryFilter to specify matching records to be returned\ description: "QueryFilter to specify matching records to be returned\
@ -2063,6 +2099,10 @@ paths:
items: items:
$ref: "#/components/schemas/QueryJoin" $ref: "#/components/schemas/QueryJoin"
type: "array" type: "array"
tableVariant:
$ref: "#/components/schemas/TableVariant"
description: "For tables that use variant backends, specification\
\ of which variant to use."
type: "object" type: "object"
required: false required: false
responses: responses: