Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Support google timestamps, use date-time format in json schema #25

Merged
merged 1 commit into from
Jul 11, 2020

Conversation

chrusty
Copy link
Owner

@chrusty chrusty commented Jun 23, 2020

This has been resurrected from a closed PR raised by @huttotw.

From his original PR:

The well known type google/protobuf/timestamp.proto will now be represented as:

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "properties": {
        "timestamp": {
            "type": "string",
            "format": "date-time"
        }
    },
    "additionalProperties": true,
    "type": "object"
}

@chrusty
Copy link
Owner Author

chrusty commented Jun 24, 2020

@mier85 How would this affect you guys? We never had any specific tests for TimeStamp.

xylo04 added a commit to k0swe/adif-json-protobuf that referenced this pull request Jul 8, 2020
@xylo04
Copy link

xylo04 commented Jul 10, 2020

I'm just barely adopting protoc-gen-jsonschema and therefore not a critical stakeholder, but FWIW, I'm very much in favor of this change.

@chrusty chrusty merged commit aa01df3 into master Jul 11, 2020
@chrusty chrusty deleted the timestamps_as_strings branch July 11, 2020 00:53
@xylo04
Copy link

xylo04 commented Jul 15, 2020

I was mulling this over and getting worried that we'd have to roll it back for compatibility with other tooling, but I found official documentation that this is the correct behavior: https://github.com/protocolbuffers/protobuf/blob/d4ec70fdd3380e7113e9e3c23cef2bea50dbf2e7/src/google/protobuf/timestamp.proto#L99-L124

@chrusty
Copy link
Owner Author

chrusty commented Jul 15, 2020

@xylo04 let's see how it goes. None of the unit tests were harmed. If we get any issues then I can put this behind another CLI parameter.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants