orval icon indicating copy to clipboard operation
orval copied to clipboard

mapping server types to existing client types

Open chiptus opened this issue 2 years ago • 5 comments

Our swagger doc is generated automatically with swaggo and we don't have a way to define x-enumNames: . is there any way to map server types to client types? so orval will know not to generate this type, but to rely on my own created type in ts? so something like this:

mapTypes: {
    `chiptus.Type`: `app/types@Type`
}

chiptus is the package name, app/types is the path and Type is the client-side type

chiptus avatar May 03 '23 12:05 chiptus

Hello, it's currently not possible but could be a cool feature

anymaniax avatar May 03 '23 12:05 anymaniax

would love to try to implement that, where do I start?

chiptus avatar May 03 '23 14:05 chiptus

First, check where to add it in the config and the property format. When you have an idea we can discuss it here. Then you can check the function getApiSchemas I think you can do it somewhere there.

anymaniax avatar May 03 '23 14:05 anymaniax

I think output.override.types?

chiptus avatar May 04 '23 01:05 chiptus

@anymaniax I was working on it, but was stuck because I couldn't really understand the logic. is there anyway we can discuss this?

chiptus avatar Sep 12 '23 09:09 chiptus