@@ -347,6 +347,32 @@ void notWithEmptyInnerSchemaWrapsPermissiveObject() {
347347 assertThat (((NotSchema ) s ).schema ()).isInstanceOf (ObjectSchema .class );
348348 }
349349
350+ @ Test
351+ void parsesImplicitObjectFromShapeKeywords () {
352+ // Schema with object-shape keywords but no explicit type still produces
353+ // an ObjectSchema (parseBaseIfPresent's implicit-object branch).
354+ Schema s =
355+ SchemaParser .parse (
356+ Map .of ("required" , List .of ("x" ), "properties" , Map .of ("x" , Map .of ("type" , "string" ))));
357+ assertThat (s ).isInstanceOf (ObjectSchema .class );
358+ ObjectSchema obj = (ObjectSchema ) s ;
359+ assertThat (obj .types ()).isEmpty ();
360+ assertThat (obj .required ()).containsExactly ("x" );
361+ assertThat (obj .properties ().get ("x" )).isInstanceOf (StringSchema .class );
362+ }
363+
364+ @ Test
365+ void parsesImplicitArrayFromShapeKeywords () {
366+ // Schema with array-shape keywords but no explicit type still produces
367+ // an ArraySchema (parseBaseIfPresent's implicit-array branch).
368+ Schema s = SchemaParser .parse (Map .of ("items" , Map .of ("type" , "integer" ), "minItems" , 1 ));
369+ assertThat (s ).isInstanceOf (ArraySchema .class );
370+ ArraySchema arr = (ArraySchema ) s ;
371+ assertThat (arr .types ()).isEmpty ();
372+ assertThat (arr .items ()).isInstanceOf (IntegerSchema .class );
373+ assertThat (arr .minItems ()).isEqualTo (1 );
374+ }
375+
350376 @ Test
351377 void oneOfContainingNestedAnyOfRecurses () {
352378 // Pins that combinator branches are themselves passed through parse(),
0 commit comments