Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hiro Ordinals API mime type query param documentation and implementation mismatch #101

Closed
thecolorblocks opened this issue Nov 11, 2023 · 2 comments

Comments

@thecolorblocks
Copy link

Describe the bug
Documentation states mime_type query param for /inscriptions endpoint is array of mime types, which produces 400 Bad Request error: querystring/mime_type/0 must match pattern \"^\\w+\\/[-.\\w]+(?:\\+[-.\\w]+)?$\"

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://docs.hiro.so/ordinals/list-of-inscriptions
  2. Click on 'Show optional parameters' on the right
  3. Scroll down to 'mime_type -- query' and click on 'Add item'
  4. Add two valid mime types, such as image/jpeg and image/png
  5. Scroll down and click execute. See error response
{
  "statusCode": 400,
  "error": "Bad Request",
  "message": "querystring/mime_type/0 must match pattern \"^\\w+\\/[-.\\w]+(?:\\+[-.\\w]+)?$\""
}

Expected behavior
Return 200 success

Screenshots
If applicable, add screenshots or consol.log to help explain your problem.
Screenshot 2023-11-11 203343

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser Opera (Chromium)
  • Version 104.0.4944.36
@janniks
Copy link
Collaborator

janniks commented Nov 11, 2023

Thanks for the report, I‘ll try to fix the docs.
If you want to use the API it should be enough to encode to parameter as a URI component https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent

@thecolorblocks
Copy link
Author

Thanks for the report, I‘ll try to fix the docs. If you want to use the API it should be enough to encode to parameter as a URI component https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent

So does the API supports multiple mime types or just a single mime type at this time? Would love to implement file type filtering but filtering for specific file extensions do not seem user friendly, otherwise would have to fetch the API multiple times for different image file extensions and consolidate to return the "image" type inscriptions. Same goes for audio, video, and so on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants