Skip to content

Commit

Permalink
Merge pull request #88 from api3dao/widen-accepted-parameter-types
Browse files Browse the repository at this point in the history
Widen accepted parameter type
  • Loading branch information
aquarat authored Jun 6, 2023
2 parents 643c43f + 6d789d2 commit 42f7395
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/ois.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
reservedParameterSchema,
reservedParametersSchema,
packageVersionCompatibleSemverSchema,
fixedParameterSchema,
} from './ois';
import { version as packageVersion } from '../package.json';

Expand Down Expand Up @@ -695,3 +696,14 @@ describe('API call skip validation', () => {
);
});
});

describe('fixedOperationParameters', () => {
it('allows objects as values', () => {
const valueWithObject = {
operationParameter: { in: 'query', name: 'params' },
value: ['finalized', false],
};

expect(() => fixedParameterSchema.parse(valueWithObject)).not.toThrow();
});
});
2 changes: 1 addition & 1 deletion src/ois.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const operationParameterSchema = z
export const fixedParameterSchema = z
.object({
operationParameter: operationParameterSchema,
value: z.string(),
value: z.any(),
})
.strict();

Expand Down

0 comments on commit 42f7395

Please sign in to comment.