Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
Fix issue where format wasnt passed through
Browse files Browse the repository at this point in the history
  • Loading branch information
Dom Harrington committed Dec 1, 2017
1 parent 4c28df0 commit 6778fbf
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,24 +209,28 @@ test('it should pass through type for non-body parameters', () => {
},
},
],
}),
).toEqual([
{
label: 'Query Params',
type: 'query',
schema: {
type: 'object',
properties: {
checkbox: {
type: 'boolean',
})[0].schema.properties.checkbox.type,
).toEqual('boolean')
});

test('it should pass through format', () => {
expect(
parametersToJsonSchema({
parameters: [
{
in: 'query',
name: 'checkbox',
schema: {
type: 'integer',
format: 'int32'
},
},
required: [],
},
},
]);
],
})[0].schema.properties.checkbox.format
).toEqual('int32');
});


test('it should pass through description', () => {
expect(
parametersToJsonSchema({
Expand Down
4 changes: 2 additions & 2 deletions packages/api-explorer-ui/dist/index.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ function getOtherParams(pathOperation) {
if (current.schema.default) schema.default = current.schema.default;
if (current.schema.enum) schema.enum = current.schema.enum;
if (current.schema.type) schema.type = current.schema.type;
if (current.schema.format) schema.format = current.schema.format;
}

prev[current.name] = schema;
Expand Down

0 comments on commit 6778fbf

Please sign in to comment.