Skip to content

Commit

Permalink
fix: includes additional properties in schema
Browse files Browse the repository at this point in the history
  • Loading branch information
foray1010 committed Dec 23, 2020
1 parent 821257b commit da81aa5
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
18 changes: 18 additions & 0 deletions e2e/api-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,15 @@
"format": "date-time",
"type": "string"
}
},
{
"name": "filter",
"required": true,
"in": "query",
"schema": {
"additionalProperties": true,
"type": "object"
}
}
],
"responses": {
Expand Down Expand Up @@ -507,6 +516,15 @@
"format": "date-time",
"type": "string"
}
},
{
"name": "filter",
"in": "query",
"required": true,
"schema": {
"additionalProperties": true,
"type": "object"
}
}
],
"responses": {
Expand Down
6 changes: 6 additions & 0 deletions e2e/src/cats/dto/pagination-query.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ export class PaginationQuery {
@ApiProperty()
beforeDate: Date;

@ApiProperty({
type: 'object',
additionalProperties: true
})
filter: Record<string, any>;

static _OPENAPI_METADATA_FACTORY() {
return {
sortBy: { type: () => [String] }
Expand Down
1 change: 1 addition & 0 deletions lib/services/swagger-types-mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export class SwaggerTypesMapper {

private getSchemaOptionsKeys(): Array<keyof SchemaObject> {
return [
'additionalProperties',
'minimum',
'maximum',
'maxProperties',
Expand Down

0 comments on commit da81aa5

Please sign in to comment.