-
-
Notifications
You must be signed in to change notification settings - Fork 658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Frontend api openapi spec #4133
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
@@ -47,11 +46,7 @@ class IndexRouter extends Controller { | |||
|
|||
this.use( | |||
'/api/frontend', | |||
conditionalMiddleware( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
conditionalMiddleware is hiding openapi definitions so I moved the flag inside the 3 controller methods in the frontend API
@@ -146,6 +164,9 @@ export default class ProxyController extends Controller { | |||
req: ApiUserRequest, | |||
res: Response<ProxyFeaturesSchema>, | |||
) { | |||
if (!this.config.flagResolver.isEnabled('embedProxy')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replaces conditional middleware
@@ -9,12 +9,19 @@ export const proxyFeatureSchema = { | |||
properties: { | |||
name: { | |||
type: 'string', | |||
example: 'disable-comments', | |||
description: 'Unique feature name.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syncing descriptions with the feature-schema
}, | ||
enabled: { | ||
type: 'boolean', | ||
example: true, | ||
description: 'Always set to `true`.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FRONTEND api returns only enabled toggles for a given context
@@ -68,7 +70,12 @@ export default class ProxyController extends Controller { | |||
operationId: 'getFrontendFeatures', | |||
responses: { | |||
200: createResponseSchema('proxyFeaturesSchema'), | |||
...getStandardResponses(401, 404), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
404 when the frontend api/embedProxy is disabled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG
About the changes
Improving openapi spec for the frontend api - details inline
Important files
Discussion points