File tree Expand file tree Collapse file tree
src/SearchAPI/application Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,6 +25,14 @@ and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
2525-
2626
2727-->
28+ ------
29+ ## [ 1.0.5] ( https://github.com/asfadmin/Discovery-SearchAPI-v3/compare/v1.0.4...v1.0.5 )
30+ ### Added
31+ - Added ` json ` output format support
32+
33+ ### Changed
34+ - bump asf-search to v9.0.5
35+
2836------
2937## [ 1.0.5] ( https://github.com/asfadmin/Discovery-SearchAPI-v3/compare/v1.0.4...v1.0.5 )
3038### Added
Original file line number Diff line number Diff line change 6666
6767def as_output (results : asf .ASFSearchResults , output : str ) -> dict :
6868 output_format = output .lower ()
69- if output_format == "json" :
70- output_format = "jsonlite"
7169
7270 # Use a switch statement, so you only load the type of output you need:
7371 match output_format :
72+ case 'json' :
73+ return {
74+ 'content' : '' .join (results .json ()),
75+ 'media_type' : 'application/json; charset=utf-8' ,
76+ 'headers' : {
77+ ** constants .DEFAULT_HEADERS ,
78+ 'Content-Disposition' : f"attachment; filename={ make_filename ('json' )} " ,
79+ }
80+ }
7481 case 'jsonlite' :
7582 return {
7683 'content' : '' .join (results .jsonlite ()),
You can’t perform that action at this time.
0 commit comments