fix(spec): API specification (#8119)

This commit is contained in:
Víctor Fernández Poyatos
2025-06-27 10:49:36 +02:00
committed by GitHub
parent 8e635b3bd4
commit 7858c147f7
2 changed files with 543 additions and 1 deletions
+542
View File
@@ -2877,6 +2877,180 @@ paths:
schema:
$ref: '#/components/schemas/OpenApiResponseResponse'
description: ''
/api/v1/lighthouse-configurations:
get:
operationId: lighthouse_configurations_list
description: Retrieve a list of all Lighthouse configurations.
summary: List all Lighthouse configurations
parameters:
- in: query
name: fields[lighthouse-configurations]
schema:
type: array
items:
type: string
enum:
- name
- api_key
- model
- temperature
- max_tokens
- business_context
- is_active
- inserted_at
- updated_at
- url
description: endpoint return only specific fields in the response on a per-type
basis by including a fields[TYPE] query parameter.
explode: false
- name: filter[search]
required: false
in: query
description: A search term.
schema:
type: string
- name: page[number]
required: false
in: query
description: A page number within the paginated result set.
schema:
type: integer
- name: page[size]
required: false
in: query
description: Number of results to return per page.
schema:
type: integer
- name: sort
required: false
in: query
description: '[list of fields to sort by](https://jsonapi.org/format/#fetching-sorting)'
schema:
type: array
items:
type: string
enum:
- name
- -name
- inserted_at
- -inserted_at
- updated_at
- -updated_at
- is_active
- -is_active
explode: false
tags:
- Lighthouse
security:
- jwtAuth: []
responses:
'200':
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/PaginatedLighthouseConfigList'
description: ''
post:
operationId: lighthouse_configurations_create
description: Create a new Lighthouse configuration with the specified details.
summary: Create a new Lighthouse configuration
tags:
- Lighthouse
requestBody:
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/LighthouseConfigCreateRequest'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/LighthouseConfigCreateRequest'
multipart/form-data:
schema:
$ref: '#/components/schemas/LighthouseConfigCreateRequest'
required: true
security:
- jwtAuth: []
responses:
'201':
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/LighthouseConfigCreateResponse'
description: ''
/api/v1/lighthouse-configurations/{id}:
patch:
operationId: lighthouse_configurations_partial_update
description: Update certain fields of an existing Lighthouse configuration.
summary: Partially update a Lighthouse configuration
parameters:
- in: path
name: id
schema:
type: string
required: true
tags:
- Lighthouse
requestBody:
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/PatchedLighthouseConfigUpdateRequest'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/PatchedLighthouseConfigUpdateRequest'
multipart/form-data:
schema:
$ref: '#/components/schemas/PatchedLighthouseConfigUpdateRequest'
required: true
security:
- jwtAuth: []
responses:
'200':
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/LighthouseConfigUpdateResponse'
description: ''
delete:
operationId: lighthouse_configurations_destroy
description: Remove a Lighthouse configuration by its ID.
summary: Delete a Lighthouse configuration
parameters:
- in: path
name: id
schema:
type: string
required: true
tags:
- Lighthouse
security:
- jwtAuth: []
responses:
'204':
description: No response body
/api/v1/lighthouse-configurations/{id}/connection:
post:
operationId: lighthouse_configurations_connection_create
description: Verify the connection to the OpenAI API for a specific Lighthouse
configuration.
summary: Check the connection to the OpenAI API
parameters:
- in: path
name: id
schema:
type: string
required: true
tags:
- Lighthouse
security:
- jwtAuth: []
responses:
'202':
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/OpenApiResponseResponse'
description: ''
/api/v1/overviews/findings:
get:
operationId: overviews_findings_retrieve
@@ -8464,6 +8638,290 @@ components:
$ref: '#/components/schemas/InvitationUpdate'
required:
- data
LighthouseConfig:
type: object
required:
- type
- id
additionalProperties: false
properties:
type:
allOf:
- $ref: '#/components/schemas/Type4bfEnum'
description: The [type](https://jsonapi.org/format/#document-resource-object-identification)
member is used to describe resource objects that share common attributes
and relationships.
id:
type: string
format: uuid
attributes:
type: object
properties:
name:
type: string
description: Name of the configuration
maxLength: 100
minLength: 3
api_key:
type: string
model:
enum:
- gpt-4o-2024-11-20
- gpt-4o-2024-08-06
- gpt-4o-2024-05-13
- gpt-4o
- gpt-4o-mini-2024-07-18
- gpt-4o-mini
type: string
description: |-
Must be one of the supported model names
* `gpt-4o-2024-11-20` - GPT-4o v2024-11-20
* `gpt-4o-2024-08-06` - GPT-4o v2024-08-06
* `gpt-4o-2024-05-13` - GPT-4o v2024-05-13
* `gpt-4o` - GPT-4o Default
* `gpt-4o-mini-2024-07-18` - GPT-4o Mini v2024-07-18
* `gpt-4o-mini` - GPT-4o Mini Default
temperature:
type: number
format: double
description: Must be between 0 and 1
max_tokens:
type: integer
maximum: 2147483647
minimum: -2147483648
description: Must be between 500 and 5000
business_context:
type: string
description: Additional business context for this AI model configuration
is_active:
type: boolean
readOnly: true
inserted_at:
type: string
format: date-time
readOnly: true
updated_at:
type: string
format: date-time
readOnly: true
required:
- name
LighthouseConfigCreate:
type: object
required:
- type
additionalProperties: false
properties:
type:
allOf:
- $ref: '#/components/schemas/Type4bfEnum'
description: The [type](https://jsonapi.org/format/#document-resource-object-identification)
member is used to describe resource objects that share common attributes
and relationships.
attributes:
type: object
properties:
name:
type: string
description: Name of the configuration
maxLength: 100
minLength: 3
api_key:
type: string
writeOnly: true
model:
enum:
- gpt-4o-2024-11-20
- gpt-4o-2024-08-06
- gpt-4o-2024-05-13
- gpt-4o
- gpt-4o-mini-2024-07-18
- gpt-4o-mini
type: string
description: |-
Must be one of the supported model names
* `gpt-4o-2024-11-20` - GPT-4o v2024-11-20
* `gpt-4o-2024-08-06` - GPT-4o v2024-08-06
* `gpt-4o-2024-05-13` - GPT-4o v2024-05-13
* `gpt-4o` - GPT-4o Default
* `gpt-4o-mini-2024-07-18` - GPT-4o Mini v2024-07-18
* `gpt-4o-mini` - GPT-4o Mini Default
temperature:
type: number
format: double
description: Must be between 0 and 1
max_tokens:
type: integer
maximum: 2147483647
minimum: -2147483648
description: Must be between 500 and 5000
business_context:
type: string
description: Additional business context for this AI model configuration
is_active:
type: boolean
readOnly: true
inserted_at:
type: string
format: date-time
readOnly: true
updated_at:
type: string
format: date-time
readOnly: true
required:
- name
- api_key
LighthouseConfigCreateRequest:
type: object
properties:
data:
type: object
required:
- type
additionalProperties: false
properties:
type:
type: string
description: The [type](https://jsonapi.org/format/#document-resource-object-identification)
member is used to describe resource objects that share common attributes
and relationships.
enum:
- lighthouse-configurations
attributes:
type: object
properties:
name:
type: string
minLength: 3
description: Name of the configuration
maxLength: 100
api_key:
type: string
writeOnly: true
minLength: 1
model:
enum:
- gpt-4o-2024-11-20
- gpt-4o-2024-08-06
- gpt-4o-2024-05-13
- gpt-4o
- gpt-4o-mini-2024-07-18
- gpt-4o-mini
type: string
description: |-
Must be one of the supported model names
* `gpt-4o-2024-11-20` - GPT-4o v2024-11-20
* `gpt-4o-2024-08-06` - GPT-4o v2024-08-06
* `gpt-4o-2024-05-13` - GPT-4o v2024-05-13
* `gpt-4o` - GPT-4o Default
* `gpt-4o-mini-2024-07-18` - GPT-4o Mini v2024-07-18
* `gpt-4o-mini` - GPT-4o Mini Default
temperature:
type: number
format: double
description: Must be between 0 and 1
max_tokens:
type: integer
maximum: 2147483647
minimum: -2147483648
description: Must be between 500 and 5000
business_context:
type: string
description: Additional business context for this AI model configuration
is_active:
type: boolean
readOnly: true
inserted_at:
type: string
format: date-time
readOnly: true
updated_at:
type: string
format: date-time
readOnly: true
required:
- name
- api_key
required:
- data
LighthouseConfigCreateResponse:
type: object
properties:
data:
$ref: '#/components/schemas/LighthouseConfigCreate'
required:
- data
LighthouseConfigUpdate:
type: object
required:
- type
- id
additionalProperties: false
properties:
type:
allOf:
- $ref: '#/components/schemas/Type4bfEnum'
description: The [type](https://jsonapi.org/format/#document-resource-object-identification)
member is used to describe resource objects that share common attributes
and relationships.
id:
type: string
format: uuid
attributes:
type: object
properties:
name:
type: string
description: Name of the configuration
maxLength: 100
minLength: 3
api_key:
type: string
writeOnly: true
model:
enum:
- gpt-4o-2024-11-20
- gpt-4o-2024-08-06
- gpt-4o-2024-05-13
- gpt-4o
- gpt-4o-mini-2024-07-18
- gpt-4o-mini
type: string
description: |-
Must be one of the supported model names
* `gpt-4o-2024-11-20` - GPT-4o v2024-11-20
* `gpt-4o-2024-08-06` - GPT-4o v2024-08-06
* `gpt-4o-2024-05-13` - GPT-4o v2024-05-13
* `gpt-4o` - GPT-4o Default
* `gpt-4o-mini-2024-07-18` - GPT-4o Mini v2024-07-18
* `gpt-4o-mini` - GPT-4o Mini Default
temperature:
type: number
format: double
description: Must be between 0 and 1
max_tokens:
type: integer
maximum: 2147483647
minimum: -2147483648
description: Must be between 500 and 5000
business_context:
type: string
description: Additional business context for this AI model configuration
is_active:
type: boolean
readOnly: true
LighthouseConfigUpdateResponse:
type: object
properties:
data:
$ref: '#/components/schemas/LighthouseConfigUpdate'
required:
- data
Membership:
type: object
required:
@@ -8830,6 +9288,15 @@ components:
$ref: '#/components/schemas/Invitation'
required:
- data
PaginatedLighthouseConfigList:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/LighthouseConfig'
required:
- data
PaginatedMembershipList:
type: object
properties:
@@ -9153,6 +9620,73 @@ components:
title: roles
required:
- data
PatchedLighthouseConfigUpdateRequest:
type: object
properties:
data:
type: object
required:
- type
- id
additionalProperties: false
properties:
type:
type: string
description: The [type](https://jsonapi.org/format/#document-resource-object-identification)
member is used to describe resource objects that share common attributes
and relationships.
enum:
- lighthouse-configurations
id:
type: string
format: uuid
attributes:
type: object
properties:
name:
type: string
minLength: 3
description: Name of the configuration
maxLength: 100
api_key:
type: string
writeOnly: true
minLength: 1
model:
enum:
- gpt-4o-2024-11-20
- gpt-4o-2024-08-06
- gpt-4o-2024-05-13
- gpt-4o
- gpt-4o-mini-2024-07-18
- gpt-4o-mini
type: string
description: |-
Must be one of the supported model names
* `gpt-4o-2024-11-20` - GPT-4o v2024-11-20
* `gpt-4o-2024-08-06` - GPT-4o v2024-08-06
* `gpt-4o-2024-05-13` - GPT-4o v2024-05-13
* `gpt-4o` - GPT-4o Default
* `gpt-4o-mini-2024-07-18` - GPT-4o Mini v2024-07-18
* `gpt-4o-mini` - GPT-4o Mini Default
temperature:
type: number
format: double
description: Must be between 0 and 1
max_tokens:
type: integer
maximum: 2147483647
minimum: -2147483648
description: Must be between 500 and 5000
business_context:
type: string
description: Additional business context for this AI model configuration
is_active:
type: boolean
readOnly: true
required:
- data
PatchedProviderGroupMembershipRequest:
type: object
properties:
@@ -12649,6 +13183,10 @@ components:
type: string
enum:
- provider-groups
Type4bfEnum:
type: string
enum:
- lighthouse-configurations
Type6bbEnum:
type: string
enum:
@@ -12970,3 +13508,7 @@ tags:
description: Endpoints for managing third-party integrations, including registration,
configuration, retrieval, and deletion of integrations such as S3, JIRA, or other
services.
- name: Lighthouse
description: Endpoints for managing Lighthouse configurations, including creation,
retrieval, updating, and deletion of configurations such as OpenAI keys, models,
and business context.
+1 -1
View File
@@ -3050,7 +3050,7 @@ class ComplianceOverviewViewSet(BaseRLSViewSet, TaskManagementMixin):
@extend_schema(tags=["Overview"])
@extend_schema_view(
list=extend_schema(
providers=extend_schema(
summary="Get aggregated provider data",
description=(
"Retrieve an aggregated overview of findings and resources grouped by providers. "