···33import { defaultPaginationKeywords } from '~/config/parser';
44import type { Config } from '~/types/config';
5566+import type { Context } from '../context';
67import { operationPagination } from '../operation';
78import { getPaginationKeywordsRegExp } from '../pagination';
89import type { IR } from '../types';
···9293 ...(pagination ? { pagination: true } : {}),
9394 });
94959595- const emptyContext = {} as IR.Context;
9696+ const emptyContext = {} as Context;
96979798 const baseOperationMeta = {
9899 method: 'post' as const,
···216217 });
217218218219 it('resolves $ref and uses the resolved pagination property', () => {
219219- const context: IR.Context = {
220220+ const context: Context = {
220221 resolveIrRef: vi.fn().mockReturnValue({
221222 properties: {
222223 pagination: {
···228229 },
229230 type: 'object',
230231 }),
231231- } as unknown as IR.Context;
232232+ } as unknown as Context;
232233233234 const operation: IR.OperationObject = {
234235 ...baseOperationMeta,
+2-1
packages/openapi-ts/src/ir/operation.ts
···11+import type { Context } from './context';
12import type { Pagination } from './pagination';
23import {
34 hasParametersObjectRequired,
···3334 context,
3435 operation,
3536}: {
3636- context: IR.Context;
3737+ context: Context;
3738 operation: IR.OperationObject;
3839}): Pagination | undefined => {
3940 const body = operation.body;
+3-2
packages/openapi-ts/src/ir/parameter.ts
···11+import type { Context } from './context';
12import type { Pagination } from './pagination';
23import type { IR } from './types';
34···56 context,
67 parameter,
78}: {
88- context: IR.Context;
99+ context: Context;
910 parameter: IR.ParameterObject;
1011}): IR.SchemaObject | undefined => {
1112 if (!parameter.pagination) {
···6667 context,
6768 parameters,
6869}: {
6969- context: IR.Context;
7070+ context: Context;
7071 parameters: IR.ParametersObject | undefined;
7172}): Pagination | undefined => {
7273 if (!parameters) {
-2
packages/openapi-ts/src/ir/types.d.ts
···44 ServerObject,
55} from '~/openApi/3.1.x/types/spec';
6677-import type { Context as IRContext } from './context';
87import type { IRMediaType } from './mediaType';
98109interface IRBodyObject {
···221220export namespace IR {
222221 export type BodyObject = IRBodyObject;
223222 export type ComponentsObject = IRComponentsObject;
224224- export type Context<Spec extends Record<string, any> = any> = IRContext<Spec>;
225223 export type Model = IRModel;
226224 export type OperationObject = IROperationObject;
227225 export type ParameterObject = IRParameterObject;
···11import { describe, expect, it } from 'vitest';
2233-import type { IR } from '../../../../ir/types';
33+import type { Context } from '~/ir/context';
44+45import type { ParameterObject, SecuritySchemeObject } from '../../types/spec';
56import { parsePathOperation } from '../operation';
67···2728 resolveRef: () =>
2829 // Mock implementation
2930 undefined,
3030- }) as unknown as IR.Context;
3131+ }) as unknown as Context;
31323233describe('operation', () => {
3334 const context = createContext();
···11import { describe, expect, it } from 'vitest';
2233-import type { IR } from '../../../../ir/types';
33+import type { Context } from '~/ir/context';
44+45import type { SecuritySchemeObject } from '../../types/spec';
56import { parsePathOperation } from '../operation';
67···1516 paths: {},
1617 servers: [],
1718 },
1818- } as unknown as IR.Context;
1919+ } as unknown as Context;
19202021 it('should parse operation correctly', () => {
2122 const method = 'get';
···11import { describe, expect, it } from 'vitest';
2233-import type { IR } from '../../../../ir/types';
33+import type { Context } from '~/ir/context';
44+45import type { SecuritySchemeObject } from '../../types/spec';
56import { parsePathOperation } from '../operation';
67···1516 paths: {},
1617 servers: [],
1718 },
1818- } as unknown as IR.Context;
1919+ } as unknown as Context;
19202021 it('should parse operation correctly', () => {
2122 const method = 'get';