oapi-codegen / oapi-codegen

Generate Go client and server boilerplate from OpenAPI 3 specifications
Apache License 2.0
6.09k stars 843 forks source link

Custom Name Normalizer? #1766

Open lcrownover opened 1 week ago

lcrownover commented 1 week ago

I couldn't find anything in the existing issues for this, but I'm hoping it's possible somehow.

The API I'm generating against has endpoints that are versioned:

"/slurm/v0.0.41/nodes/": { ... }

And the outputted types are then named:

V0041OpenapiNodesResp

I want to be able to strip out the V0041 from all the types. I can do this pretty easily with awk, but I don't want to introduce more build dependencies unless necessary. Is there a built-in way to create my own name-normalizer function that I can reference in my config.yml file?

UVduane commented 1 week ago

I have a similar thing where every API endpoint for the API is prefixed with /web/api/v2.1 and all of the functions come out named WebApixxxxx