question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DateTime not supported in schema

See original GitHub issue

When I use a DateTime type field in the schema, it throws an Expcetion System.ArgumentException: DateTime not supported

Sample c# code:

class MessageDate
{
    public DateTime CreatedTime { get; set; }
}

[Fact]
public async Task SendMsg()
{
    var producer = await Client.NewProducer(Schema.JSON<MessageDate>())
        .Topic("schema")
        .CreateAsync();
    var consumer = await Client.NewConsumer(Schema.JSON<MessageDate>())
        .Topic("schema")
        .SubscriptionName("my-sub")
        .SubscribeAsync();

    var msg = new MessageDate {CreatedTime = DateTime.Today};
    await producer.SendAsync(msg);

    var cmsg = await consumer.ReceiveAsync();
    var value = cmsg.GetValue();
    Log.WriteLine(value.ToString());
}

Is it that DateTime cannot be used here? What is the best practice?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:27 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Lanayxcommented, Apr 14, 2021

@eaba Ok, I think we are good to go with that 😃

1reaction
eabacommented, Apr 13, 2021

Checked. I will work on that

Read more comments on GitHub >

github_iconTop Results From Across the Web

DateTime not supported in schema · Issue #9
When I use a DateTime type field in the schema, it throws an Exception: System.ArgumentException: DateTime not supported at AvroSchemaGenerator.
Read more >
Validate datetime value using python jsonschema
The error is jsonschema.exceptions.SchemaError: 'datetime' is not valid under any of the given schemas . How can I validate this correctly?
Read more >
Apollo iOS Swift DateTime Not Supported - Help
Hello Team, We are getting below issue when fetching datetime in graphQL Swift. Failure! Error: GraphQLResultError(path: delivery.nodes.0.
Read more >
MySQL data type 'datetime' not supported when importing ...
When editing an imported / existing table or creating a new table the MySQL data type 'datetime' is not available in the type...
Read more >
JSON schema validation does not validate date or time fields
The JSON schema validator in Mule Rutime 4 does not validate a date or time field.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found