openapistack / openapi-client-axios

JavaScript client library for consuming OpenAPI-enabled APIs with axios
https://openapistack.co
MIT License
556 stars 67 forks source link

Issue when trying to use openapi-client-axios with react native #140

Closed FranDepascuali closed 1 year ago

FranDepascuali commented 1 year ago

Hi, thanks for this awesome lib!! I'm trying to integrate it with react-native. The project compiles, but whenever I run it, I receive the error:

https could not be found within the project or in these directories:
node_modules/@apidevtools/json-schema-ref-parser/node_modules
node_modules

As little as I understand, https module seems to not be included in the react-native runtime. https://stackoverflow.com/questions/29371694/react-native-and-requirehttp

For this specific case you'll likely want to use the fetch API which is provided by the environment. React Native does not run inside of the node runtime.

I tried to registerRunner but didn't have any luck :(

Is there any fallback I could try here?

Thanks! Depa

anttiviljami commented 1 year ago

Fixed with openapi-client-axios@6.1.0