mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-14 00:19:16 +01:00
fix: Add deprecated openapi tags as valid tags for operations (#1916)
## PR text I realized that the tag changes we introduced in #1907 would be breaking for people who use the unleash-server package and implement their own endpoints on top of it (as we do in unleash-enterprise). This change makes it possible to still use the old tags. However, these tags are purposefully not added to the root schema or the list of OpenAPI tag types. Any of our endpoints still using them (I think there is one in Unleash enterprise, see ivarconr/unleash-enterprise#109) should switch over when possible. ## Commits * fix: Add deprecated openapi tags as valid tags for operations * Docs: add explanatory comment for why the type exists.
This commit is contained in:
parent
6516ac21ee
commit
b04920602b
@ -1,7 +1,16 @@
|
||||
import { OpenAPIV3 } from 'openapi-types';
|
||||
import { OpenApiTag } from './openapi-tags';
|
||||
|
||||
export interface ApiOperation<Tag = OpenApiTag>
|
||||
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];
|
||||
|
Loading…
Reference in New Issue
Block a user