-
-
Notifications
You must be signed in to change notification settings - Fork 405
Description
I suspect this change was not intentional so reporting it.. I was previously on v13.0.23 and in the typings changes since the programmatic generateApi
function's typings no longer allow partial extractingOptions
config to be provided.
This is still typed as Partial<ExtractingOptions>
on CodeGenConfig
here where defaults are defined:
swagger-typescript-api/src/configuration.ts
Lines 183 to 204 in 75366cf
extractingOptions: Partial<ExtractingOptions> = { | |
requestBodySuffix: ["Payload", "Body", "Input"], | |
requestParamsSuffix: ["Params"], | |
responseBodySuffix: ["Data", "Result", "Output"], | |
responseErrorSuffix: [ | |
"Error", | |
"Fail", | |
"Fails", | |
"ErrorData", | |
"HttpError", | |
"BadResponse", | |
], | |
enumSuffix: ["Enum"], | |
discriminatorMappingSuffix: ["Mapping", "Mapper", "MapType"], | |
discriminatorAbstractPrefix: [ | |
"Base", | |
"Abstract", | |
"Discriminator", | |
"Internal", | |
"Polymorph", | |
], | |
}; |
But it looks like that is overridden by the parameter type here:
swagger-typescript-api/src/index.ts
Line 6 in 75366cf
config: Partial<GenerateApiConfiguration["config"]>, |
swagger-typescript-api/types/index.ts
Lines 171 to 172 in 75366cf
/** extra configuration for extracting type names operations */ | |
extractingOptions?: ExtractingOptions; |
In the earlier version index.d.ts
typed this prop as CodeGenConfig
still does:
swagger-typescript-api/types/index.d.ts
Lines 180 to 181 in 5a00cd5
/** extra configuration for extracting type names operations */ | |
extractingOptions?: Partial<ExtractingOptions>; |
My workaround for now casting to any