OpenAPITools / OpenAPITools/openapi-generator

mapping from python to java and back

Open
#20,835 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

i am trying to generate clients for python and java in a way that python can serialize a model class (to Kafka) and loading it into Java Spring Boot application on the other end.

i have the python side generating pydantic-based models, which are great for serializtion, but on other end i cannot load them because the java generator generate model classes with camelCase field names, where the python side dumps them to json with snake_case field names.

my focus so far has been to try and get jackson to generate json mapping that would allow loading snake_case json into a model, but no success so far. i know pydantic supports serialization_alias which could be used to serialize to another name, but have had no success with this either.

anyone has any idea or experience with such a conversion?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No repository file or test is named. Start by reproducing the generated Python Pydantic model and Java Spring Boot model at the Kafka JSON boundary, then inspect the generator and serialization settings involved in their field naming. Done means the Python-generated JSON loads into the Java model and the naming behavior is documented or covered by a reproducible test.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kafka, openapi, python, spring-boot
Domain
api, backend, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.