-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat(openapi): x-fern-base-path #1862
Conversation
…atform into chdeskur/fern-base-path
📦 Next.js Bundle Analysis for fern-platform-monorepoThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
packages/parsers/src/openapi/3.1/extensions/XFernBasePathConverter.node.ts
Outdated
Show resolved
Hide resolved
} | ||
|
||
parse(): void { | ||
this.basePath = extendType<{ "x-fern-base-path"?: string }>(this.input)["x-fern-base-path"]; |
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.
we should put x-fern-base-path
into a const at the top of the file, so that we can keep things in lockstep, my fault for not including this earlier, but there are examples in the last opened PR
@@ -122,8 +124,11 @@ export class OperationObjectConverterNode extends BaseOpenApiV3_1ConverterNode< | |||
} | |||
|
|||
const path = this.path.startsWith("/") ? this.path.slice(1) : this.path; | |||
const basePath = this.basePath?.convert(); | |||
const pathParts = basePath ? [basePath].concat(path.split("/")) : path.split("/"); |
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.
nit: [basePath, ...path.split("/"))]
is a slightly nicer syntax
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.
Looks fantastic! Left some minor comments.
Playwright test resultsDetails 101 tests across 10 suites Flaky testschromium › forward-proxy/nextjs.spec.ts › capture the flag Skipped testschromium › posthog.spec.ts › Posthog loads successfully |
…atform into chdeskur/fern-base-path
This PR adds the node, corresponding logic, and tests to parse
x-fern-base-path