1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-10-18 11:14:57 +02:00
unleash.unleash/src/lib/openapi/util/api-operation.ts
Gastón Fournier ff83f934d5
feat: clean up old OAS and ability to add badges to descriptions (#10038)
## About the changes
This removes some old and unused files from an initial test of setting
up openapi that's currently not working:

![image](https://github.com/user-attachments/assets/5ed9b1bf-a3b1-48ec-9232-6e534e6ceb96)


Also, adds the ability of marking endpoints as (note, the endpoints are
made up just for illustration purposes):
- Enterprise only 

![image](https://github.com/user-attachments/assets/0f8768b3-051f-4dc5-89d9-f09b38d5ca4c)

- Beta: 

![image](https://github.com/user-attachments/assets/45a29b16-6063-4718-bda6-e6ac28061be5)

- Both: 

![image](https://github.com/user-attachments/assets/2ed8bc95-868b-4577-8f84-67b74e739a51)

---------

Co-authored-by: Thomas Heartman <thomas@getunleash.io>
2025-05-28 13:14:00 +02:00

20 lines
785 B
TypeScript

import type { OpenAPIV3 } from 'openapi-types';
import type { OpenApiTag } from './openapi-tags.js';
type DeprecatedOpenAPITag =
// Deprecated tag names. Please use a tag from the OpenAPITag type instead.
//
// These tag names were the original ones we used for OpenAPI, but they
// turned out to be too generic and/or didn't match the new tag naming
// schema. Because we require our operations to have one of a predefined set
// of values, it would be breaking change to remove them completely.
'client' | 'other' | 'auth' | 'admin';
export interface ApiOperation<Tag = OpenApiTag | DeprecatedOpenAPITag>
extends Omit<OpenAPIV3.OperationObject, 'tags'> {
operationId: string;
tags: [Tag];
beta?: boolean;
enterpriseOnly?: boolean;
}