tazatechnology / openapi_spec

Dart based OpenAPI specification generator and parser
BSD 3-Clause "New" or "Revised" License
8 stars 5 forks source link

Remove dependency on io.HttpException #46

Closed davidmigloz closed 9 months ago

davidmigloz commented 9 months ago

HttpException is part of dart:io and consequently cannot be used when targeting web.

This PR changes the parent class from the client Exception from HttpException to Exception.

cc @walsha2

davidmigloz commented 9 months ago

I guess as far as an exception is not thrown it will work without issues. But at the moment your client exception class needs to be instantiated it will throw an exception as dart:io is not available on the browser.

Also, if you check the pinecone package in pub.dev it doesn't show web as a supported platform. It was the same for openai_dart until I remove this dependency, now it does show web as supported.

walsha2 commented 9 months ago

Published: https://pub.dev/packages/openapi_spec v0.7.9

davidmigloz commented 9 months ago

Ah! I just realised that I included the global queryParams in the PR. Sorry about that, I wanted to create a separate PR with those. I basically needed them to be able to consume the Azure OpenAI API which requires a version query param in every endpoint.

walsha2 commented 9 months ago

Ah! I just realised that I included the global queryParams in the PR. Sorry about that, I wanted to create a separate PR with those. I basically needed them to be able to consume the Azure OpenAI API which requires a version query param in every endpoint.

No worries. I saw that and assumed it was an additional feature that snuck in. LGTM. If you need to make some other mods to it, just open a new PR!