astahmer / openapi-zod-client

Generate a zodios (typescript http client with zod validation) from an OpenAPI spec (json/yaml)
openapi-zod-client.vercel.app
734 stars 82 forks source link

Move endpointRefiner function call location to just before the endpoint information being pushed to endpoints array #241

Closed imballinst closed 10 months ago

imballinst commented 10 months ago

Hello! I submitted this issue before https://github.com/astahmer/openapi-zod-client/issues/173 and the PR for adding that feature before.

However, I think I made a mistake. Instead of placing it here, where it's still "fresh":

https://github.com/astahmer/openapi-zod-client/blob/986126340ed00b4cd97e002d12c77622d98005bb/lib/src/getZodiosEndpointDefinitionList.ts#L154-L169

Perhaps it would be better to place it here, just before it's being pushed so that endpointRefiner can "inspect" all fields that are going to be used in the Handlebars template.

https://github.com/astahmer/openapi-zod-client/blob/986126340ed00b4cd97e002d12c77622d98005bb/lib/src/getZodiosEndpointDefinitionList.ts#L380-L384

What do you think? Aalso I'm unsure if it counts as a minor change or patch change, let me know. Thanks!

astahmer commented 10 months ago

yeah that makes sense, a patch is fine since it shouldnt break any current behaviour

imballinst commented 10 months ago

Alrighty! I'm going to submit a PR in a bit. Thanks for the confirmation!