Skip to content

Commit

Permalink
loosen the JSONSchema typings allow any string in
Browse files Browse the repository at this point in the history
  • Loading branch information
koskimas committed Jan 6, 2020
1 parent d247fc9 commit 78bf469
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tests/ts/examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ class Person extends objection.Model {

static columnNameMappers = objection.snakeCaseMappers();

static jsonSchema: JSONSchema = {
static jsonSchema = {
type: 'object',

properties: {
firstName: {
type: 'string'
type: 'string',
}
}
};
Expand Down
8 changes: 4 additions & 4 deletions typings/objection/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1352,9 +1352,7 @@ declare namespace Objection {
new (): T;
}

export interface ModelConstructor<M extends Model> extends Constructor<M> {

}
export interface ModelConstructor<M extends Model> extends Constructor<M> {}

export interface ModelClass<M extends Model> extends ModelConstructor<M> {
QueryBuilder: typeof QueryBuilder;
Expand Down Expand Up @@ -1812,7 +1810,9 @@ declare namespace Objection {
| 'boolean'
| 'object'
| 'array'
| 'null';
| 'null'
| string;

export type JSONSchemaType = JSONSchemaArray[] | boolean | number | null | object | string;

// Workaround for infinite type recursion
Expand Down

0 comments on commit 78bf469

Please sign in to comment.