square / square/wire

More detail about a `.wire` file

Open
#1,706 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

documentation
Dominant language
Kotlin
Stars
4.4k
Forks
627
Avg merge
3d 15m
Merged PRs (30d)
20

Description

By reading the source code, I found that it supports a mechanism called profile, which is described by the .wire file,describes how to map .proto to .java.
But I did not find a more detailed document or sample code to illustrate how to use this mechanism.For example, the TypeConfigElement information in the profile file seems to describe the configuration of different fields, but I don't quite understand how to use it for the val with: List<OptionElement> = emptyList(), field.


I'm dealing with a requirement—— I hope to keep some fields in the original java file when generating (more precisely, updating) java through the proto file. These fields may not be declared and defined in the proto file. It seems that it can be configured with the with information of this profile file, but I don't know how to do it. Can anyone give me some explanations or examples.

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

Start by reading the source code for profiles, TypeConfigElement, and the with field in the .wire configuration. Document how profiles map .proto fields to generated .java fields, with a sample showing the relevant configuration and whether existing Java fields can be retained.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.