@@ -275,6 +275,8 @@ void testEchoSchemaTypeMapping() throws Exception {
275275 assertEquals ("number" , echoProps .path ("epochSecondsTimestamp" ).path ("type" ).asText ());
276276 assertEquals ("string" , echoProps .path ("dateTimeTimestamp" ).path ("type" ).asText ());
277277 assertEquals ("string" , echoProps .path ("httpDateTimestamp" ).path ("type" ).asText ());
278+ // Default timestamp (no format trait) should be string (date-time format)
279+ assertEquals ("string" , echoProps .path ("defaultTimestamp" ).path ("type" ).asText ());
278280
279281 // Enum should be string with enum values
280282 assertEquals ("string" , echoProps .path ("enumValue" ).path ("type" ).asText ());
@@ -435,6 +437,15 @@ void testHttpDateTimestampRoundTrip() {
435437 assertEquals (httpDateStr , echo .getMember ("httpDateTimestamp" ).asString ());
436438 }
437439
440+ @ Test
441+ void testDefaultTimestampRoundTrip () {
442+ initializeLatestProtocol ();
443+ // Default format is date-time (ISO 8601 string)
444+ var dateTimeStr = "2023-11-14T22:13:20Z" ;
445+ var echo = echoSingleField ("defaultTimestamp" , Document .of (dateTimeStr ));
446+ assertEquals (dateTimeStr , echo .getMember ("defaultTimestamp" ).asString ());
447+ }
448+
438449 // ========== List Tests ==========
439450
440451 @ Test
@@ -796,6 +807,7 @@ void testInputFieldsAreCorrectlyDeserialized() {
796807 echoData .put ("epochSecondsTimestamp" , Document .of (1700000000.0 ));
797808 echoData .put ("dateTimeTimestamp" , Document .of ("2023-11-14T22:13:20Z" ));
798809 echoData .put ("httpDateTimestamp" , Document .of ("Tue, 14 Nov 2023 22:13:20 GMT" ));
810+ echoData .put ("defaultTimestamp" , Document .of ("2023-11-14T22:13:20Z" ));
799811 echoData .put ("stringList" , Document .of (List .of (Document .of ("a" ), Document .of ("b" ))));
800812 echoData .put ("integerList" , Document .of (List .of (Document .of (1 ), Document .of (2 ))));
801813 echoData .put ("stringMap" , Document .of (Map .of ("key1" , Document .of ("value1" ))));
@@ -833,6 +845,7 @@ void testInputFieldsAreCorrectlyDeserialized() {
833845 assertNotNull (echo .getEpochSecondsTimestamp ());
834846 assertNotNull (echo .getDateTimeTimestamp ());
835847 assertNotNull (echo .getHttpDateTimestamp ());
848+ assertNotNull (echo .getDefaultTimestamp ());
836849
837850 // Verify collections
838851 assertEquals (2 , echo .getStringList ().size ());
@@ -941,6 +954,7 @@ void testAllTypesValidateAgainstOutputSchema() throws Exception {
941954 echoData .put ("epochSecondsTimestamp" , Document .of (1700000000.0 ));
942955 echoData .put ("dateTimeTimestamp" , Document .of ("2023-11-14T22:13:20Z" ));
943956 echoData .put ("httpDateTimestamp" , Document .of ("Tue, 14 Nov 2023 22:13:20 GMT" ));
957+ echoData .put ("defaultTimestamp" , Document .of ("2023-11-14T22:13:20Z" ));
944958 echoData .put ("stringList" , Document .of (List .of (Document .of ("a" ))));
945959 echoData .put ("integerList" , Document .of (List .of (Document .of (1 ))));
946960 echoData .put ("nestedList" , Document .of (List .of (nested )));
0 commit comments