openapi-processor / openapi-processor/openapi-processor-spring

interpretation of openapi readOnly flag in model

未關閉
#334 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
Kotlin
星號
56
分支
11
平均合併
2 天 4 小時
30 天內合併 PR
8

描述

Given a definition like:

``yaml

Data:
  type: object
  properties:        
    status:
      type: string)
      readOnly: true

get generated java:


```java

public record Data {
    @JsonProperty(value = "status", access = JsonProperty.Access.READ_ONLY)
    String status
) {}

This is correct if the generated code is for the provider of the interface (i.e. server-side). But if the code is to be the client of the interface, the field should instead be annotated with JsonProperty.Access.WRITE_ONLY.

So, as a feature request, it would be useful if there was a code generation option that declared the intended usage of the generated code.

See: https://fasterxml.github.io/jackson-annotations/javadoc/2.6/com/fasterxml/jackson/annotation/JsonProperty.Access.html

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

Issue 中未識別原始檔案、測試或進入點。先追蹤 generator 如何將 OpenAPI 的 readOnly 屬性映射至 Jackson 存取註解,接著判定應在哪裡設定 provider-versus-client 產生選項,並定義涵蓋兩種模式的測試。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
java, openapi, spring-boot
領域
backend-api-design, tooling
Issue 類型
功能
難度
5/5
預估耗時
一週以上
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。