Closed alexisohayon closed 6 years ago
timestamp
is not a valid json schema type. You shouldn't use that.
Good to know..! What do you use as type when it's a timestamp in the database? just date?
Date isn't a type either. You should probably read the this. JSON schema only allows json types string
, boolean
, number
, null
, object
and array
. For other types you need to use format
keyword.
Thanks, still learning :) It helps a lot <3
Hello! I am facing the same problem, One of my models has a date time value (expiration) as following, so I triwed to call it "format as recommanded but I get
cannot convert json schema type "format" into GraphQL type
static get jsonSchema() {
return {
type : 'object',
required: [ 'token' ],
properties: {
id : { type: 'integer' },
userId: { type: 'integer' },
device: {
type: 'string', minLength: 1, maxLength: 255
},
expiration: { type: 'format' },
token : {
type: 'string', minLength: 1, maxLength: 255
},
}
};
}
Any ideas @koskimas , maybe I am doing something wrong? Thanks for your help.
It seems that date and date-time are new type in the json schema ? https://json-schema.org/understanding-json-schema/reference/string.html
Hi! I didn't find a way to make this work, dont know what to do..?
Thanks ;)