kbase / staging_service

MIT License
0 stars 9 forks source link

Update docs for file to app mapping endpoint re query params for regular http queries #112

Open MrCreosote opened 3 years ago

MrCreosote commented 3 years ago

Currently shows usage for a custom client, which doesn't translate to curl / requests / etc.

Correct query for multiple files with requests:

In [15]: r = requests.get('https://ci.kbase.us/services/staging_service/importer
    ...: _mappings/?file_list=foo.gff.gz&file_list=foo.fa.gz')                  
In [16]: r.json()['mappings']                                                   
Out[16]: 
[[{'id': 'gff_genome', 'title': 'GFF/FASTA Genome', 'app_weight': 1},
  {'id': 'gff_metagenome', 'title': 'GFF/FASTA MetaGenome', 'app_weight': 1}],
 [{'id': 'assembly', 'title': 'Assembly', 'app_weight': 1},
  {'id': 'gff_genome', 'title': 'GFF/FASTA Genome', 'app_weight': 1},
  {'id': 'gff_metagenome', 'title': 'GFF/FASTA MetaGenome', 'app_weight': 1}]]
bio-boris commented 3 years ago

Could also update the endpoint to work in the expected way for curl/requests etc

Compatibility needs to be maintained for https://github.com/kbase/narrative/blob/truss/kbase-extension/static/kbase/js/widgets/narrative_core/upload/stagingAreaViewer.js#L274-L284 https://github.com/kbase/narrative/blob/truss/kbase-extension/static/kbase/js/api/StagingServiceClient.js https://github.com/kbase/narrative/blob/truss/kbase-extension/static/kbase/js/api/RestAPIClient.js