@@ -659,7 +659,10 @@ fn create_server(key_pair: KeyPair) -> rocket::Rocket<rocket::Build> {
659
659
. mount ( "/" , routes ! [ index] )
660
660
. mount ( "/" , routes ! [ get_list, get_pcf_unauth, post_event_fallback] )
661
661
. mount ( "/" , routes ! [ openid_configuration, jwks] )
662
- . mount ( "/" , routes ! [ shipment_footprint_schema, toc_schema, hoc_schema] )
662
+ . mount (
663
+ "/" ,
664
+ routes ! [ shipment_footprint_schema, toc_schema, hoc_schema] ,
665
+ )
663
666
. mount ( "/auth" , routes ! [ oauth2_create_token] )
664
667
. mount (
665
668
"/swagger-ui/" ,
@@ -1340,3 +1343,24 @@ fn get_tad_with_limit_and_filter_test() {
1340
1343
resp. into_string( ) . unwrap( )
1341
1344
) ;
1342
1345
}
1346
+
1347
+ #[ test]
1348
+ fn schema_jsons_test ( ) {
1349
+ let endpoints = vec ! [
1350
+ ( "/shipment-footprint.json" , schema_for!( ShipmentFootprint ) ) ,
1351
+ ( "/toc.json" , schema_for!( Toc ) ) ,
1352
+ ( "/hoc.json" , schema_for!( Hoc ) ) ,
1353
+ ] ;
1354
+
1355
+ let client = & Client :: tracked ( create_server ( TEST_KEYPAIR . clone ( ) ) ) . unwrap ( ) ;
1356
+
1357
+ for ( endpoint, schema) in endpoints {
1358
+ let schema_resp = client. get ( endpoint) . dispatch ( ) ;
1359
+
1360
+ assert_eq ! ( schema_resp. status( ) , rocket:: http:: Status :: Ok ) ;
1361
+
1362
+ let fetched_schema = schema_resp. into_json :: < RootSchema > ( ) ;
1363
+
1364
+ assert_eq ! ( fetched_schema. unwrap( ) , schema) ;
1365
+ }
1366
+ }
0 commit comments