File tree Expand file tree Collapse file tree
packages/openapi-code-generator/src
typescript/typescript-nextjs Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ export class OpenapiLoader {
2828 private readonly library = new Map < string , OpenapiDocument > ( )
2929
3030 private constructor (
31- private readonly entryPointKey : string ,
31+ public readonly entryPointKey : string ,
3232 private readonly config : { titleOverride : string | undefined } ,
3333 private readonly validator : OpenapiValidator ,
3434 private readonly genericLoader : GenericLoader ,
Original file line number Diff line number Diff line change @@ -428,8 +428,14 @@ export async function generateTypescriptNextJS(
428428) : Promise < void > {
429429 const input = config . input
430430
431- const appDirectory = "./app/api"
432- const routesDirectory = "./generated/api"
431+ const subDirectory = process . env [ "OPENAPI_INTEGRATION_TESTS" ]
432+ ? path . basename ( config . input . loader . entryPointKey )
433+ : ""
434+
435+ const appDirectory = [ "./app" , subDirectory ] . filter ( isDefined ) . join ( path . sep )
436+ const routesDirectory = [ "./generated" , subDirectory ]
437+ . filter ( isDefined )
438+ . join ( path . sep )
433439
434440 const rootTypeBuilder = await TypeBuilder . fromInput (
435441 "./generated/api/models.ts" ,
You can’t perform that action at this time.
0 commit comments