viper-framework / viper

Binary analysis and management framework
Other
1.54k stars 353 forks source link

Discrepancies between Viper documentation and Swagger UI API docs #748

Open FlawlessLawless opened 5 years ago

FlawlessLawless commented 5 years ago

There appear to be some discrepancies between the API docs that the Viper API generates in the Swagger UI versus what the Viper documentation specifies. Some examples:

Example: Uploading testfile.txt as myfile.txt with tags "one", "two", "three"

curl from Swagger UI: curl -X POST --header 'Content-Type: multipart/form-data' --header 'Accept: application/json' --header 'X-CSRFToken: <token value>' -F tag_list=one two three -F file=file=%2Fhome%2Fuser%2Ftestfile.txt -F file_name=myfile.txt http://<localhost>/api/v3/project/default/malware/upload/

Issues:

curl made using Viper docs (with correct output): curl -X POST -H 'Authorization: Token <token value>' -S -F "file=@/home/user/testfile.txt;type=text/plain;filename=myfile.txt" -F tag_list=one,two,three http://<localhost>/api/v3/project/default/malware/upload/

If it is not possible to correct what shows up in the Swagger UI docs, it would be nice if it could be clearly stated what Swagger UI elements are wrong and include all the correct use cases in the written documentation.

I would also suggest that some examples/documentation be created for implementing the API using the python requests library.