Skip to content

Commit

Permalink
💚 Added .yaml for sdk file
Browse files Browse the repository at this point in the history
  • Loading branch information
naelob committed Jul 23, 2024
1 parent 6592772 commit 449e87b
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 17,975 deletions.
6 changes: 3 additions & 3 deletions packages/api/src/ats/candidate/types/model.unified.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,22 +120,22 @@ export class UnifiedCandidateInput {
tags?: (string | UnifiedTagOutput)[];

@ApiPropertyOptional({
type: [],
type: [Url],
description:
'The urls of the candidate, possible values for Url type are WEBSITE, BLOG, LINKEDIN, GITHUB, or OTHER',
})
@IsOptional()
urls?: Url[];

@ApiPropertyOptional({
type: [],
type: [Phone],
description: 'The phone numbers of the candidate',
})
@IsOptional()
phone_numbers?: Phone[];

@ApiPropertyOptional({
type: [],
type: [Email],
description: 'The email addresses of the candidate',
})
@IsOptional()
Expand Down
19 changes: 17 additions & 2 deletions packages/api/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,30 @@ async function bootstrap() {
)
.build();
const document = SwaggerModule.createDocument(app, config);
// Add x-speakeasy-name-override
document['x-speakeasy-name-override'] = [
{
operationId: '^get.*',
methodNameOverride: 'retrieve',
},
{
operationId: '^list.*',
methodNameOverride: 'list',
},
{
operationId: '^new.*',
methodNameOverride: 'create',
},
];

useContainer(app.select(AppModule), { fallbackOnErrors: true });

SwaggerModule.setup('docs', app, document);
fs.writeFileSync('./swagger/swagger-spec.yaml', yaml.dump(document));
fs.writeFileSync(
/*fs.writeFileSync(
'./swagger/swagger-spec.json',
JSON.stringify(document, null, 2),
);
);*/
app.use(cors());
app.useLogger(app.get(Logger));
app.useGlobalInterceptors(new LoggerErrorInterceptor());
Expand Down
Loading

0 comments on commit 449e87b

Please sign in to comment.