DEV Community

Discussion on: I've made a RESTful HTTP client which will make your life much easier

 
ecyrbe profile image
ecyrbe • Edited

Thank you for the feedback,

  • naming is a matter of taste, and i would prefer evoid taking decisions in the place of the end user. But i also would like to evoid making zodios asCrudApi a helper monster that tries to fit everyone needs. So maybe, i'll instead add guidance in the documentation on how to write your own helpers like asCrudApi.
  • As of today, i did not add runtime validation for parameters. I would prefer enforcing typescript string validation for this use case (see typescript template type literals that can typecheck for you your strings at compile time). But if you have a use case where we can't check parameters at compile time, i might change my mind.
  • For splitting the API, take a look at dev.to directory in examples. it's called asApi and can be used to code split your deplarations by models.
  • validation customization is already possible per endpoint. Just not for asCrudApi. i would also suggest the user to create is own helper if his use cases are too complex or even not use one and use zodios already generic api declaration for this use case.