Skip to content

Commit

Permalink
fix(@whook/http-router): fix compatibility issue
Browse files Browse the repository at this point in the history
  • Loading branch information
nfroidure committed Mar 3, 2021
1 parent bf5ed69 commit e0b3a60
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
5 changes: 4 additions & 1 deletion packages/whook-example/src/handlers/getTime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ export const timeSchema: WhookAPISchemaDefinition<Components.Schemas.TimeSchema>
type: 'object',
additionalProperties: false,
properties: {
currentDate: { type: 'string', format: 'date-time' },
currentDate: {
type: 'string',
// format: 'date-time'
},
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ Object {
"additionalProperties": false,
"properties": Object {
"currentDate": Object {
"format": "date-time",
"type": "string",
},
},
Expand Down
10 changes: 9 additions & 1 deletion packages/whook-http-router/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -565,10 +565,18 @@ async function _createRouters({
if (p.style) {
log('warning', '⚠️ - Only a style subset is supported currently!');
}

return {
...p,
pattern: '^.*$',
// TODO: Remove when this issue is tackled:
// https://github.com/nfroidure/siso/issues/45
...((p.schema as OpenAPIV3.SchemaObject)?.enum
? {}
: {
pattern: '^.*$',
}),
...p.schema,
schema: undefined,
};
});
const ammendedParameters = extractOperationSecurityParameters(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const definition: WhookAPIHandlerDefinition = {
properties: {
redirectURI: {
type: 'string',
format: 'uri',
// format: 'uri',
},
},
},
Expand Down

0 comments on commit e0b3a60

Please sign in to comment.