neo-project / neo-modules

MIT License
61 stars 102 forks source link

Oracle: Add Other Mime Types #870

Open cschuchardt88 opened 5 months ago

cschuchardt88 commented 5 months ago

Summary or problem description Currently oracle only allow mime type application/json and if the server returns a mime type of application/json; charset=utf-8. This will invalidate the oracle request and throw an error code of 31.

Do you have any solution you want to propose? Fix the logic to allow any mime type of application/json

Where in the software does this update applies to?

cschuchardt88 commented 5 months ago

@Jim8y @shargon

Jim8y commented 5 months ago

@shargon can you please take a look?

roman-khimov commented 5 months ago
  1. This limitation existed since the oracle implementation.
  2. But I never really understood it, it looks artificial and not helpful in any way. So I'm for allowing more, in general.
  3. We at the same time have JSON filters in the API now and this complicates the matter, we can't just enable any MIME types at the oracle module level, filter + non-JSON reply can't work.
  4. So maybe we need an additional request API at the oracle contract level for non-JSON things.
shargon commented 5 months ago

I think that currently it is not necessary, with json should be sufficient for current services, I also think that it's more interesting an aggregator of different sources, usually oracle is used for prices, and all the apis produce json