Skip to content

Commit 356d8ab

Browse files
author
Stefan Cooper
committed
chore: lint
Signed-off-by: Stefan Cooper <stefan.cooper27@gmail.com>
1 parent fe5d9f4 commit 356d8ab

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

src/schema-routes/schema-routes.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ export class SchemaRoutes {
346346
if (schemasWithDataTypes.length === 1) {
347347
return schemasWithDataTypes[0];
348348
}
349-
349+
350350
// If there are multiple schemas, create a oneOf schema to generate a union type
351351
if (schemasWithDataTypes.length > 1) {
352352
return {
@@ -374,20 +374,21 @@ export class SchemaRoutes {
374374
// If we have a oneOf schema (multiple media types), handle it specially
375375
if (schema.oneOf) {
376376
// Process each schema in the oneOf array
377-
const unionTypes = schema.oneOf.map(subSchema => {
377+
const unionTypes = schema.oneOf.map((subSchema) => {
378378
return this.schemaParserFabric.getInlineParseContent(
379379
subSchema,
380380
typeName,
381381
[operationId],
382382
);
383383
});
384-
384+
385385
// Filter out any duplicates or Any types
386-
const filteredTypes = this.schemaParserFabric.schemaUtils.filterSchemaContents(
387-
unionTypes,
388-
(content) => content !== this.config.Ts.Keyword.Any
389-
);
390-
386+
const filteredTypes =
387+
this.schemaParserFabric.schemaUtils.filterSchemaContents(
388+
unionTypes,
389+
(content) => content !== this.config.Ts.Keyword.Any,
390+
);
391+
391392
// Create a union type
392393
return this.config.Ts.UnionType(filteredTypes);
393394
} else {

tests/spec/multiple-media-types/index.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe("multiple media types in request body", async () => {
1717

1818
test("should generate union type for request body with multiple media types", async () => {
1919
const fileName = "MultipleMediaTypesApi";
20-
20+
2121
await generateApi({
2222
fileName,
2323
input: path.resolve(__dirname, "./schema.json"),
@@ -32,7 +32,7 @@ describe("multiple media types in request body", async () => {
3232

3333
// Save the snapshot for future comparison
3434
expect(content).toMatchSnapshot();
35-
35+
3636
// Additional specific checks
3737
expect(content).toContain("Cat | Dog");
3838
expect(content).toContain("addPet");

tests/spec/multiple-media-types/schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,4 @@
8181
}
8282
}
8383
}
84-
}
84+
}

0 commit comments

Comments
 (0)