adorsys / adorsys/status-list-server

Align OpenAPI status contract & dual string/integer deserialization

オープン
#480 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug high rust
主要言語
Rust
スター
22
フォーク
5
平均マージ
2日 11時間
マージ済み PR(30日)
47

説明

## Objective

Resolve the contract mismatch between `docs/openapi.yaml` and `src/server/handlers/status_list/utils/request.rs` by supporting both string and integer status representations in serde and accurately documenting them.

## Context

In `docs/openapi.yaml`, `StatusValue` is documented as a string enum (`"VALID"`, `"INVALID"`, `"SUSPENDED"`). However, the serde deserializer in `src/server/handlers/status_list/utils/request.rs` only accepts numeric integers (`0`, `1`, `2`, `>=256`). When API clients generated from the OpenAPI specification send the documented string values (e.g. `{"index": 0, "status": "VALID"}`), the server rejects them with `HTTP 422 Unprocessable Entity`.

## Deliverables

- [ ] Update `Deserialize` for `Status` in `src/server/handlers/status_list/utils/request.rs` to accept:
- Numeric integers: `0` (VALID), `1` (INVALID), `2` (SUSPENDED), and `>=256` (ApplicationSpecific).
- String names (case-insensitive): `"VALID"` / `"valid"`, `"INVALID"` / `"invalid"`, `"SUSPENDED"` / `"suspended"`, and stringified integers (e.g. `"0"`).
- [ ] Update `docs/openapi.yaml` to document both formats using `oneOf` or a unified schema so client generators generate correct models.
- [ ] Add unit tests verifying successful deserialization of both string enum values and numeric values, and rejection of reserved integers (3..=255) and invalid strings.

## Acceptance Criteria

- [ ] `{"index": 0, "status": "VALID"}` and `{"index": 0, "status": 0}` are both accepted and deserialize to `Status::VALID`.
- [ ] OpenAPI specification matches server acceptance behavior.
- [ ] Standard OpenAPI-generated SDKs can publish and update status lists without deserialization errors.

## References

- `docs/openapi.yaml` (lines 560–565)
- `src/server/handlers/status_list/utils/request.rs` (lines 23–38)
- Arc review: `arc-review/finalReview/application-functional-bugs/README.md` (PoC 1)

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。