Skip to content

Commit 382a4b4

Browse files
committed
Fix typedoc and build
1 parent c7dc6dc commit 382a4b4

File tree

4 files changed

+5
-17
lines changed

4 files changed

+5
-17
lines changed

src/core/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ export interface SwaggerDefinition {
366366
properties?: { [propertyName: string]: SwaggerDefinition };
367367
/** A map of regex patterns to schemas for properties key validation. */
368368
patternProperties?: { [pattern: string]: SwaggerDefinition };
369+
dependentSchemas?: Record<string, SwaggerDefinition>;
369370
discriminator?: DiscriminatorObject;
370371
readOnly?: boolean;
371372
writeOnly?: boolean;

src/core/utils.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,8 @@ export function getTypeScriptType(schema: SwaggerDefinition | undefined | null,
279279
// Handle 'dependentSchemas' (JSON Schema 2020-12).
280280
// If property X is present, then properties from Schema Y must also be valid.
281281
// We represent this as an intersection: `{ [x]: Type } & DependentSchemaType`
282-
if (schema['dependentSchemas']) { // Note: 'dependentSchemas' isn't in strict type, cast/access loosely or update type def
283-
// Assuming SwaggerDefinition includes generic indexer or updated type definition
284-
const deps = (schema as any).dependentSchemas;
282+
if (schema.dependentSchemas) {
283+
const deps = schema.dependentSchemas;
285284
Object.entries(deps).forEach(([prop, depSchema]) => {
286285
const depType = getTypeScriptType(depSchema as SwaggerDefinition, config, knownTypes);
287286
// In TS, this conditional relationship is hard to model perfectly static.

src/service/emit/service/service-method.generator.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,8 @@ import {
77
} from 'ts-morph';
88
import { GeneratorConfig, Parameter, PathInfo, SwaggerDefinition } from '@src/core/types.js';
99
import { camelCase, getTypeScriptType, isDataTypeInterface } from '@src/core/utils.js';
10-
import { HttpContext, HttpHeaders, HttpParams } from '@angular/common/http';
1110
import { SwaggerParser } from "@src/core/parser.js";
1211

13-
/** A strongly-typed representation of Angular's HttpRequest options. */
14-
interface HttpRequestOptions {
15-
headers?: HttpHeaders;
16-
context?: HttpContext;
17-
params?: HttpParams;
18-
reportProgress?: boolean;
19-
responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
20-
withCredentials?: boolean;
21-
observe?: 'body' | 'events' | 'response';
22-
}
23-
2412
export class ServiceMethodGenerator {
2513
constructor(
2614
private readonly config: GeneratorConfig,

tests/00-core/03-parser-coverage.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ describe('Core: SwaggerParser (Coverage)', () => {
121121
const parser = new SwaggerParser(specWithOverrides as any, { options: {} } as GeneratorConfig);
122122
// We resolve the wrapper object itself that has $ref + description
123123
const refObj = specWithOverrides.components.schemas.WithOverride;
124-
const resolved = parser.resolve(refObj);
124+
const resolved = parser.resolve<any>(refObj);
125125

126126
expect(resolved).not.toBe(REF_TARGET); // Should be a new object reference (clone)
127127
expect(resolved?.type).toBe('string');
@@ -132,7 +132,7 @@ describe('Core: SwaggerParser (Coverage)', () => {
132132
it('should return standard resolution if no overrides are present within the ref definition', () => {
133133
const parser = new SwaggerParser(specWithOverrides as any, { options: {} } as GeneratorConfig);
134134
const refObj = specWithOverrides.components.schemas.WithoutOverride;
135-
const resolved = parser.resolve(refObj);
135+
const resolved = parser.resolve<any>(refObj);
136136

137137
// When no overrides, it might return the original reference if optimization allows,
138138
// but our implementation currently delegates logic.

0 commit comments

Comments
 (0)