ecyrbe / zodios

typescript http client and server with zod validation
https://www.zodios.org/
MIT License
1.71k stars 46 forks source link

some utilities are no longer visible #205

Closed koichik closed 2 years ago

koichik commented 2 years ago

Hi, I've created a Zodios client plugin which uses the following utilities:

import { findEndpoint } from '@zodios/core/lib/plugins/zodios-plugins.utils'
import { replacePathParams } from '@zodios/core/lib/utils'

It worked fine until v10.2.0, however since v10.3.0 these utilities are no longer visible. These may not have been intended to be public APIs, but I think they are very useful.

Is it possible to use these utilities in a custom plugins? Or is there an alternative?

ecyrbe commented 2 years ago

Hello,

Yes be carefull, there are no garanties on these internal helpers. They are not part of Zodios public API.

I suggest you keep an implementation in you own plugin. They are really small, duplicating them in your code should not be an issue and would evoid these kind of issues in the future.

I did the same for my plugins, not using axios internal helpers but implementing them myself. This strategy allowed fetch plugin to be compatible with axios .x and 1.x at the same time, while axios team changed all their internal utilities.

koichik commented 2 years ago

Okay, thanks for your advice!!