Skip to content

add typescript-axios-slim generator and parity tests#23108

Draft
scarf005 wants to merge 7 commits intoOpenAPITools:masterfrom
scarf005:feat/typescript-axios-slim-identity
Draft

add typescript-axios-slim generator and parity tests#23108
scarf005 wants to merge 7 commits intoOpenAPITools:masterfrom
scarf005:feat/typescript-axios-slim-identity

Conversation

@scarf005
Copy link
Contributor

@scarf005 scarf005 commented Mar 4, 2026

Add typescript-axios-slim generator, templates, and req/res parity tests against typescript-axios.

Validated:

  • ./mvnw -pl modules/openapi-generator -am -Dtest=TypeScriptAxiosSlimParityTest,TypeScriptAxiosClientCodegenTest -Dsurefire.failIfNoSpecifiedTests=false test
  • ./mvnw -pl modules/openapi-generator -am -DskipTests package
  • local req/res identity check across 9 Quotabook API specs (packages/api/*): identical

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package || exit
    ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
    ./bin/utils/export_docs_generators.sh || exit
    
  • File the PR against the correct branch: master.
  • If your PR solves a reported issue, reference it using GitHub's linking syntax.
  • If your PR is targeting a particular programming language, @mention the technical committee members.

Summary by cubic

Adds a new typescript-axios-slim generator that produces direct class-based axios clients using a single request-parameter object validated by valibot, returning payload data (Promise<T>). The single-parameter mode is now enforced and the useSingleRequestParameter option is removed for this generator; includes docs and parity tests with typescript-axios.

  • New Features

    • New generator: TypeScriptAxiosSlimClientCodegen (outputs to generated-code/typescript-axios-slim). Direct API classes only; useSingleRequestParameter is always on and hidden.
    • Runtime validation via valibot. Methods accept RawAxiosRequestConfig and return payload data (Promise<T>), not Axios wrappers.
    • Templates for base/common/configuration/models/docs; CJS + ESM builds; per-operation servers; optional separate models/api. Supports: withInterfaces, stringEnums, withNodeImports, withAWSV4Signature, withSeparateModelsAndApi, importFileExtension, useSquareBracketsInArrayNames.
    • Parity tests (TypeScriptAxiosSlimParityTest + identity-edge-cases.yaml) verify request interfaces, API signatures, enums, models, and payload-return behavior across fixtures and options.
    • Docs: docs/generators/typescript-axios-slim.md; linked from docs/generators.md. Removed redundant JSDoc @param annotations in slim templates.
  • Dependencies

    • Generated clients depend on valibot; add aws4-axios when withAWSV4Signature is enabled.

Written for commit 50ca85b. Summary will update on new commits.

@scarf005 scarf005 force-pushed the feat/typescript-axios-slim-identity branch from 8da8d77 to 111173a Compare March 10, 2026 01:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants