-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #120 from Luxoft/118-119
fix: deep property models not generated; simple params in body request;
- Loading branch information
Showing
13 changed files
with
249 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/models/method-parameter/IReturnType.ts → src/models/method-parameter/ITypeInfo.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { PropertyKind } from '../models/kinds/PropertyKind'; | ||
import { IModelsContainer } from '../models/ModelsContainer'; | ||
import { OpenAPIService } from '../swagger/OpenAPIService'; | ||
import { IOpenAPI3Reference } from '../swagger/v3/reference'; | ||
import { IModel } from './ServiceMappingService'; | ||
|
||
export class ModelFinder { | ||
public constructor(private readonly openAPIService: OpenAPIService, private readonly models: IModelsContainer) {} | ||
|
||
public find(ref: IOpenAPI3Reference): IModel | undefined { | ||
const name = this.openAPIService.getSchemaKey(ref); | ||
|
||
const objectModel = this.models.objects.find((x) => x.name === name); | ||
if (objectModel) { | ||
return { kind: PropertyKind.Object, name, dtoType: objectModel.dtoType }; | ||
} | ||
|
||
const identityModel = this.models.identities.find((x) => x.name === name); | ||
if (identityModel) { | ||
return { kind: PropertyKind.Identity, name, dtoType: identityModel.dtoType }; | ||
} | ||
|
||
const enumModel = this.models.enums.find((x) => x.name === name); | ||
if (enumModel) { | ||
return { kind: PropertyKind.Enum, name, dtoType: name }; | ||
} | ||
|
||
return undefined; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.