Skip to content

Commit ae54697

Browse files
committed
Stop reading endpoints from jsonSpec
1 parent a105a28 commit ae54697

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

compiler/src/compiler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export default class Compiler {
5656
generateModel (): this {
5757
this.jsonSpec = buildJsonSpec()
5858
const endpoints = compileEndpoints(this.jsonSpec)
59-
this.model = compileSpecification(this.jsonSpec, endpoints, this.specsFolder, this.outputFolder)
59+
this.model = compileSpecification(endpoints, this.specsFolder, this.outputFolder)
6060
return this
6161
}
6262

compiler/src/model/build-model.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export function compileEndpoints (jsonSpec: Map<string, JsonSpec>): Record<strin
9090
return map
9191
}
9292

93-
export function compileSpecification (jsonSpec: Map<string, JsonSpec>, endpointMappings: Record<string, model.Endpoint>, specsFolder: string, outputFolder: string): model.Model {
93+
export function compileSpecification (endpointMappings: Record<string, model.Endpoint>, specsFolder: string, outputFolder: string): model.Model {
9494
const tsConfigFilePath = join(specsFolder, 'tsconfig.json')
9595
const project = new Project({ tsConfigFilePath })
9696

@@ -131,8 +131,8 @@ export function compileSpecification (jsonSpec: Map<string, JsonSpec>, endpointM
131131
definedButNeverUsed.join('\n'),
132132
{ encoding: 'utf8', flag: 'w' }
133133
)
134-
for (const api of jsonSpec.keys()) {
135-
model.endpoints.push(endpointMappings[api])
134+
for (const endpoint of Object.values(endpointMappings)) {
135+
model.endpoints.push(endpoint)
136136
}
137137

138138
// Visit all class, interface, enum and type alias definitions

0 commit comments

Comments
 (0)