orval-labs/orval

Add naming convention conversion for schema property names

Open

#2381 aperta il 19 set 2025

Vedi su GitHub
 (0 commenti) (3 reazioni) (0 assegnatari)TypeScript (648 fork)auto 404
enhancementhelp wanted

Metriche repository

Star
 (6272 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

Hi everyone, this is a follow-up for the following discussion https://github.com/orval-labs/orval/discussions/218

Summary

Add a native support for converting schema field names from diffent conventions like snake_case to camelCase in generated TypeScript interfaces and types, similar to what openapi-generator provides.

Problem Description

Many APIs (especially those built with Python/FastAPI, Ruby on Rails, etc.) use snake_case naming conventions for their schema properties, but TypeScript/JavaScript codebases typically use camelCase. Currently, Orval users need to implement complex workarounds using mutators and transformers to achieve this conversion, which:

Proposed Solution

Building on the recent implementation of output.overrides.namingConvention.enum (added in #2125) we could have something like :

module.exports = {
  petstore: {
    output: {
      override: {
        namingConvention: {
          enum: 'camelCase', 
          properties: 'camelCase'      // New property
        }
      }
    }
  }
}

Guida contributor