diff --git a/apps/webservice/src/app/api/v1/openapi.ts b/apps/webservice/src/app/api/v1/openapi.ts index 21a97f1aa..97506be78 100644 --- a/apps/webservice/src/app/api/v1/openapi.ts +++ b/apps/webservice/src/app/api/v1/openapi.ts @@ -331,6 +331,24 @@ export const openapi: Swagger.SwaggerV3 = { }, }, }, + SystemWithEnvironmentsAndDeployments: { + allOf: [ + { $ref: "#/components/schemas/System" }, + { + type: "object", + properties: { + environments: { + type: "array", + items: { $ref: "#/components/schemas/Environment" }, + }, + deployments: { + type: "array", + items: { $ref: "#/components/schemas/Deployment" }, + }, + }, + }, + ], + }, }, }, }; diff --git a/apps/webservice/src/app/api/v1/systems/[systemId]/openapi.ts b/apps/webservice/src/app/api/v1/systems/[systemId]/openapi.ts index 9bedaafdf..319af9e98 100644 --- a/apps/webservice/src/app/api/v1/systems/[systemId]/openapi.ts +++ b/apps/webservice/src/app/api/v1/systems/[systemId]/openapi.ts @@ -26,22 +26,7 @@ export const openapi: Swagger.SwaggerV3 = { content: { "application/json": { schema: { - allOf: [ - { $ref: "#/components/schemas/System" }, - { - type: "object", - properties: { - environments: { - type: "array", - items: { $ref: "#/components/schemas/Environment" }, - }, - deployments: { - type: "array", - items: { $ref: "#/components/schemas/Deployment" }, - }, - }, - }, - ], + $ref: "#/components/schemas/SystemWithEnvironmentsAndDeployments", }, }, }, diff --git a/openapi.v1.json b/openapi.v1.json index b0ef2296c..71af9d28e 100644 --- a/openapi.v1.json +++ b/openapi.v1.json @@ -2538,28 +2538,7 @@ "content": { "application/json": { "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/System" - }, - { - "type": "object", - "properties": { - "environments": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Environment" - } - }, - "deployments": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Deployment" - } - } - } - } - ] + "$ref": "#/components/schemas/SystemWithEnvironmentsAndDeployments" } } } @@ -4062,6 +4041,30 @@ "type": "boolean" } } + }, + "SystemWithEnvironmentsAndDeployments": { + "allOf": [ + { + "$ref": "#/components/schemas/System" + }, + { + "type": "object", + "properties": { + "environments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Environment" + } + }, + "deployments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Deployment" + } + } + } + } + ] } }, "securitySchemes": {