Fix OpenAPI spec linting

Signed-off-by: solimant <solimant@users.noreply.github.com>
This commit is contained in:
solimant
2024-12-31 05:46:28 +00:00
parent 68eca7b9a0
commit ac5613f635
23 changed files with 226 additions and 1178 deletions
@@ -1,45 +0,0 @@
/*
* Copyright 2024 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// ******************************************************************
// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *
// ******************************************************************
import { EntityMeta } from '../models/EntityMeta.model';
import { EntityRelation } from '../models/EntityRelation.model';
/**
* The parts of the format that's common to all versions/kinds of entity.
* @public
*/
export interface Entity {
/**
* The relations that this entity has with other entities.
*/
relations?: Array<EntityRelation>;
/**
* A type representing all allowed JSON object values.
*/
spec?: { [key: string]: any };
metadata: EntityMeta;
/**
* The high level entity type being described.
*/
kind: string;
/**
* The version of specification format for this particular entity that this is written against.
*/
apiVersion: string;
}
@@ -1,42 +0,0 @@
/*
* Copyright 2024 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// ******************************************************************
// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *
// ******************************************************************
/**
* A link to external information that is related to the entity.
* @public
*/
export interface EntityLink {
/**
* An optional value to categorize links into specific groups
*/
type?: string;
/**
* An optional semantic key that represents a visual icon.
*/
icon?: string;
/**
* An optional descriptive title for the link.
*/
title?: string;
/**
* The url to the external site, document, etc.
*/
url: string;
}
@@ -1,69 +0,0 @@
/*
* Copyright 2024 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// ******************************************************************
// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *
// ******************************************************************
import { EntityLink } from '../models/EntityLink.model';
/**
* Metadata fields common to all versions/kinds of entity.
* @public
*/
export interface EntityMeta {
[key: string]: any;
/**
* A list of external hyperlinks related to the entity.
*/
links?: Array<EntityLink>;
/**
* A list of single-valued strings, to for example classify catalog entities in various ways.
*/
tags?: Array<string>;
/**
* Construct a type with a set of properties K of type T
*/
annotations?: { [key: string]: string };
/**
* Construct a type with a set of properties K of type T
*/
labels?: { [key: string]: string };
/**
* A short (typically relatively few words, on one line) description of the entity.
*/
description?: string;
/**
* A display name of the entity, to be presented in user interfaces instead of the `name` property above, when available. This field is sometimes useful when the `name` is cumbersome or ends up being perceived as overly technical. The title generally does not have as stringent format requirements on it, so it may contain special characters and be more explanatory. Do keep it very short though, and avoid situations where a title can be confused with the name of another entity, or where two entities share a title. Note that this is only for display purposes, and may be ignored by some parts of the code. Entity references still always make use of the `name` property, not the title.
*/
title?: string;
/**
* The namespace that the entity belongs to.
*/
namespace?: string;
/**
* The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair. This value is part of the technical identifier of the entity, and as such it will appear in URLs, database tables, entity references, and similar. It is subject to restrictions regarding what characters are allowed. If you want to use a different, more human readable string with fewer restrictions on it in user interfaces, see the `title` field below.
*/
name: string;
/**
* An opaque string that changes for each update operation to any part of the entity, including metadata. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, and the server will then reject the operation if it does not match the current stored value.
*/
etag?: string;
/**
* A globally unique ID for the entity. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, but the server is free to reject requests that do so in such a way that it breaks semantics.
*/
uid?: string;
}
@@ -1,34 +0,0 @@
/*
* Copyright 2024 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// ******************************************************************
// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *
// ******************************************************************
/**
* A relation of a specific type to another entity in the catalog.
* @public
*/
export interface EntityRelation {
/**
* The entity ref of the target of this relation.
*/
targetRef: string;
/**
* The type of the relation.
*/
type: string;
}
@@ -1,32 +0,0 @@
/*
* Copyright 2024 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// ******************************************************************
// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *
// ******************************************************************
/**
* @public
*/
export type TaskRecoverStrategy = 'none' | 'startOver';
/**
* @public
*/
export const TaskRecoverStrategy = {
None: 'none' as TaskRecoverStrategy,
StartOver: 'startOver' as TaskRecoverStrategy,
};
@@ -1,46 +0,0 @@
/*
* Copyright 2024 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// ******************************************************************
// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *
// ******************************************************************
import { TaskStepEach } from '../models/TaskStepEach.model';
/**
* An individual step of a scaffolder task, as stored in the database.
* @public
*/
export interface TaskStep {
[key: string]: any;
/**
* A unique identifier for this step.
*/
id: string;
/**
* A display name to show the user.
*/
name: string;
/**
* The underlying action ID that will be called as part of running this step.
*/
action: string;
/**
* A type representing all allowed JSON object values.
*/
input?: { [key: string]: any };
each?: TaskStepEach;
}
@@ -1,26 +0,0 @@
/*
* Copyright 2024 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// ******************************************************************
// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *
// ******************************************************************
import { JsonValue } from '../models/JsonValue.model';
/**
* Run step repeatedly.
* @public
*/
export type TaskStepEach = Array<JsonValue> | string;
@@ -1,36 +0,0 @@
/*
* Copyright 2024 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// ******************************************************************
// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *
// ******************************************************************
import { TemplateInfoEntity } from '../models/TemplateInfoEntity.model';
/**
* Information about a template that is stored on a task specification. Includes a stringified entityRef, and the baseUrl which is usually the relative path of the template definition
* @public
*/
export interface TemplateInfo {
/**
* The entityRef of the template.
*/
entityRef: string;
/**
* Where the template is stored, so we can resolve relative paths for things like `fetch:template` paths.
*/
baseUrl?: string;
entity?: TemplateInfoEntity;
}
@@ -1,28 +0,0 @@
/*
* Copyright 2024 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// ******************************************************************
// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *
// ******************************************************************
import { EntityMeta } from '../models/EntityMeta.model';
/**
* The Template entity.
* @public
*/
export interface TemplateInfoEntity {
metadata: EntityMeta;
}
@@ -32,10 +32,6 @@ export * from '../models/DryRunResult.model';
export * from '../models/DryRunResultLogInner.model';
export * from '../models/DryRunResultLogInnerBody.model';
export * from '../models/DryRunResultLogInnerBodyAllOf.model';
export * from '../models/Entity.model';
export * from '../models/EntityLink.model';
export * from '../models/EntityMeta.model';
export * from '../models/EntityRelation.model';
export * from '../models/ErrorError.model';
export * from '../models/ErrorRequest.model';
export * from '../models/ErrorResponse.model';
@@ -51,14 +47,9 @@ export * from '../models/SerializedFile.model';
export * from '../models/SerializedTask.model';
export * from '../models/SerializedTaskEvent.model';
export * from '../models/TaskEventType.model';
export * from '../models/TaskRecoverStrategy.model';
export * from '../models/TaskSecrets.model';
export * from '../models/TaskSecretsAllOf.model';
export * from '../models/TaskStatus.model';
export * from '../models/TaskStep.model';
export * from '../models/TaskStepEach.model';
export * from '../models/TemplateInfo.model';
export * from '../models/TemplateInfoEntity.model';
export * from '../models/TemplateParameterSchema.model';
export * from '../models/TemplateParameterSchemaStepsInner.model';
export * from '../models/ValidationError.model';
@@ -365,21 +365,18 @@ describe('api', () => {
it('should list tasks with limit and offset', async () => {
server.use(
rest.get(
`${mockBaseUrl}/v2/tasks?limit=5&offset=0`,
(_req, res, ctx) => {
return res(
ctx.json([
{
createdBy: null,
},
{
createdBy: null,
},
]),
);
},
),
rest.get(`${mockBaseUrl}/v2/tasks`, (_req, res, ctx) => {
return res(
ctx.json([
{
createdBy: null,
},
{
createdBy: null,
},
]),
);
}),
);
const result = await apiClient.listTasks({