From 16893d8b0088f399cbafc8911018c224cc1cd35e Mon Sep 17 00:00:00 2001 From: bymyself Date: Mon, 14 Jul 2025 16:31:32 -0700 Subject: [PATCH] [openapi] Replace view metadata generic object with detailed schema Replace generic 'type: object' for /api/view_metadata endpoint with comprehensive ModelMetadata schema that includes: - Standard modelspec fields (date, architecture, title, description) - Implementation details (format, license, author) - Additional metadata with proper typing - Base64 thumbnail support This provides much better API documentation for model metadata responses than the previous generic object definition. --- openapi.yaml | 49 +++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 43 insertions(+), 6 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index aa2b73a8d..bad7a4ce3 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -498,18 +498,18 @@ paths: responses: '200': description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/ModelMetadata' + '404': + description: File not found '500': description: Internal server error content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' - content: - application/json: - schema: - type: object - '404': - description: File not found /api/models: get: tags: @@ -1100,6 +1100,43 @@ components: enabled: type: boolean description: Whether to enable or disable subscription + ModelMetadata: + type: object + description: Model metadata from safetensors files + properties: + modelspec.date: + type: string + description: Model creation date + modelspec.architecture: + type: string + description: Model architecture (e.g., stable-diffusion-v1) + modelspec.title: + type: string + description: Model title + modelspec.description: + type: string + description: Model description + modelspec.sai_model_spec: + type: string + description: SAI model specification version + format: + type: string + description: Model format (e.g., pt, safetensors) + modelspec.implementation: + type: string + description: Implementation URL or reference + modelspec.license: + type: string + description: Model license + modelspec.author: + type: string + description: Model author(s) + modelspec.thumbnail: + type: string + description: Base64-encoded thumbnail image + additionalProperties: + type: string + description: Additional metadata fields QueueItem: type: array description: Queue item containing execution details