File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
packages/openapi-code-generator/src
typescript/typescript-nextjs Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ export class OpenapiLoader {
2424 private readonly library = new Map < string , OpenapiDocument > ( )
2525
2626 private constructor (
27- private readonly entryPointKey : string ,
27+ public readonly entryPointKey : string ,
2828 private readonly validator : OpenapiValidator ,
2929 private readonly genericLoader : GenericLoader ,
3030 ) {
Original file line number Diff line number Diff line change @@ -423,8 +423,14 @@ export async function generateTypescriptNextJS(
423423) : Promise < void > {
424424 const input = config . input
425425
426- const appDirectory = "./app/api"
427- const routesDirectory = "./generated/api"
426+ const subDirectory = process . env [ "OPENAPI_INTEGRATION_TESTS" ]
427+ ? path . basename ( config . input . loader . entryPointKey )
428+ : ""
429+
430+ const appDirectory = [ "./app" , subDirectory ] . filter ( isDefined ) . join ( path . sep )
431+ const routesDirectory = [ "./generated" , subDirectory ]
432+ . filter ( isDefined )
433+ . join ( path . sep )
428434
429435 const rootTypeBuilder = await TypeBuilder . fromInput (
430436 "./generated/api/models.ts" ,
You can’t perform that action at this time.
0 commit comments