@@ -441,7 +441,8 @@ def published_data_dictionary(dataset_type: str) -> Response:
441441 return _data_dictionary (dataset_type , published_resource = True )
442442
443443
444- def _schema_json (dataset_type : str , published_resource : bool = False ) -> Response :
444+ def _schema_json (dataset_type : str , published_resource : bool = False ,
445+ include_example : bool = True ) -> Response :
445446 try :
446447 geno = get_geno (dataset_type )
447448 except RecombinantException :
@@ -526,7 +527,7 @@ def _schema_json(dataset_type: str, published_resource: bool = False) -> Respons
526527 for ck , cv in choice_fields [fld ['id' ]]:
527528 choices [ck ] = cv
528529
529- if not published_resource and 'examples' in chromo :
530+ if include_example and 'examples' in chromo :
530531 ex_record = chromo ['examples' ]['record' ]
531532 example = {}
532533 for field in chromo ['fields' ]:
@@ -554,7 +555,9 @@ def schema_json(dataset_type: str) -> Response:
554555@recombinant .route ('/recombinant-published-schema/<dataset_type>.json' )
555556@nocache_store
556557def published_schema_json (dataset_type : str ) -> Response :
557- return _schema_json (dataset_type , published_resource = True )
558+ include_example = asbool (request .args .get ('include_example' , False ))
559+ return _schema_json (dataset_type , published_resource = True ,
560+ include_example = include_example )
558561
559562
560563@recombinant .route ('/recombinant/<resource_name>' )
0 commit comments