swagger-typescript-api icon indicating copy to clipboard operation
swagger-typescript-api copied to clipboard

Add possibility to change default request params

Open k1rd3rf opened this issue 1 month ago • 3 comments

Useful when overriding the http client, and you want to make sure the request params are set.

Can be set to "" in order to not make it optional.


[!NOTE] Introduce defaultRequestParams config/CLI flag to set the default request params in generated APIs, applied in templates and covered by tests.

  • Config & CLI
    • Add default-request-params CLI arg and plumb to generateApi as defaultRequestParams.
    • Set default in CodeGenConfig (defaultRequestParams = "{}").
  • Templates
    • Use config.defaultRequestParams for request config arg default in templates/default/procedure-call.ejs and templates/modular/procedure-call.ejs.
  • Types
    • Extend GenerateApiConfiguration.config with defaultRequestParams: string.
  • Tests
    • Add tests/spec/defaultRequestParams/* with snapshots for basic, modular, and empty default cases.

Written by Cursor Bugbot for commit 8d6260009210b9e08e65a9cce059498519afdeee. This will update automatically on new commits. Configure here.

k1rd3rf avatar Oct 24 '25 09:10 k1rd3rf